-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EHCache not working in native mode with docker builds #456
Comments
Hey @antonwiens - the Quarkus CXF extension leverages ehcache 3.9.3, while your error shows ehcache 3.9.6. Something definitely appears off with your dependencies. I'm also able to compile and execute native mode with WS-Security just fine using Quarkus 2.10.0.CR1, so my bets are that this is something specific to your setup. Which OS are you on, and can you share the output of |
I am using gradle and can see the following problem: org.apache.cxf:cxf-rt-ws-security:3.5.2 is pulled in by quarkus-cxf-rt-ws-security. Gradle is taking 3.9.6 there to replace 3.9.3. I will try forcing either version to fix this problem. EDIT: The tree for quarkus-cxf-rt-ws-security:
|
This is the result of trying to force ehcache 3.9.3. Isnt it kinda strange to search for an jar in a native executable?
|
Strange indeed ... I would love to help you, but this does not appear in any way to be an issue with the extension. Please feel free to put together a simple reproducer project if you'd like for me to try to take a look? |
The problem seems to be related to org.ehcache.xml.XmlConfiguration#CORE_SCHEMA_URL.
And it seems like it is loaded in org/ehcache/xml/ConfigurationParser.java:158. But i can`t find where my problem is coming from... When i have time, i will try to create a reproducer. |
The attached gradle-ws-security.zip gradle project executes without any issues for me. I'm still thinking there's something off in your setup, and likely the issue has nothing to do with the actual loading of the xsd in XmlConfiguration. Can you try run this project; once you run the native executable, try something like: curl -X POST "http://localhost:8080/soap/greeting-service" \
-H 'Content-Type: text/xml' \
-H 'SOAPAction:' \
-d '<soapenv:Envelope xmlns:acme="http://acme.org/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken><wsse:Username>joe</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">wss4j</wsse:Password></wsse:UsernameToken></wsse:Security></soapenv:Header>
<soapenv:Body>
<acme:hello>
<arg0>Shumon</arg0>
</acme:hello>
</soapenv:Body>
</soapenv:Envelope>' |
Edit: Thanks for providing the test project. Ok. i build your project with
then i build docker image with
I then run it with
After using your command i get the same error on server side:
And the request + response from the server:
So to me it does not look like it is related to my project. |
You're right, I stand corrected - the issue appears to be specific to the docker images. Things are fine when running the native binary without docker. Will dig in and keep you posted. |
Hey @antonwiens So I dug in a little, and it may take a while for me to identify and address the root cause of this issue. I'm posting a temporary workaround below until I can figure out what's happening. import io.quarkus.arc.Unremovable;
import io.quarkus.runtime.StartupEvent;
import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.ws.security.tokenstore.MemoryTokenStore;
import org.apache.cxf.ws.security.tokenstore.TokenStore;
import javax.enterprise.event.Observes;
@Unremovable
public class TokenStoreConfigurer {
void onStart(@Observes StartupEvent ev) {
final Bus bus = BusFactory.getThreadDefaultBus();
bus.setProperty(TokenStore.class.getName(), new MemoryTokenStore());
}
} |
Thanks for looking into it and the workaround. If i understand correctly the workaround disables EHCache for the TokenStore for the time being? |
That's correct. Keep in mind there's a difference in the token TTL, which may have some ramifications if you have a high throughput application. You can tune the TTL by setting the value directly on the From the From the Just wanted to note: this page lists a whole bunch of properties you can use to configure WS-Security: |
Thanks for all the hints. |
This is reproducible with the WS Security test in #503 and fixed by upgrading to Ehcache 3.10.0 and moving the init of some classes to runtime - see the fix in the same PR. |
As mentioned in the related issue, i am having problems getting ehcache to run with quarkus 2.10.0.CR1 and quarkus-cxf 1.1.0.
I do not exclude the ehcache dependency or anything related to it.
Do you have any idea why i get this error message?
Originally posted by @antonwiens in #443 (comment)
The text was updated successfully, but these errors were encountered: