I’m new to Apache CXF and I’m trying to set up a connection using the Simple Frontend. I’ve configured both the server and client sides, but I’m running into a strange error when calling service methods.
Here’s what I’ve done:
- Set up a server configuration with a Spring/JPA service bean
- Created a client configuration to connect to the service
- Injected the generated service into my web app (using Wicket)
When I try to call any service method, I get an IllegalStateException saying ‘Already connected’. This happens on the first service call, right after the WSDL is fetched.
I’ve looked online for similar issues but haven’t found anything that matches my problem. I’m using the Simple Frontend because I don’t want to annotate my service with JAX-WS.
Has anyone run into this before or know what might be causing it? I’m really stuck and could use some help figuring this out.
Here’s a simplified version of the error I’m seeing:
java.lang.IllegalStateException: Already connected
at java.net.HttpURLConnection.setFixedLengthStreamingMode(HttpURLConnection.java:103)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.thresholdNotReached(HTTPConduit.java:1889)
at org.apache.cxf.io.AbstractThresholdOutputStream.close(AbstractThresholdOutputStream.java:99)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1980)
Any ideas on how to fix this? Thanks!