Regarding the problem described in my previous email, I have tried running the jar of my program exported from Eclipse with the following instruction:
java -cp .;EinsatzleitungJAX_Server.jar;C:\.m2\repository;$MULE_HOME\lib de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Server
This way I can’t have missed any required libraries, right? But I still get an exception:
Exception in thread "main" com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
at com.sun.xml.internal.ws.transport.http.server.ServerMgr.createContext(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(Unknown Source)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(Unknown Source)
at javax.xml.ws.Endpoint.publish(Unknown Source)
at de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Server.<init>(Einsatzleitung_EinsatzleitungWSI_Server.java:19)
at de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Server.main(Einsatzleitung_EinsatzleitungWSI_Server.java:23)
Caused by: java.net.BindException: Cannot assign requested address: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at sun.net.httpserver.ServerImpl.<init>(Unknown Source)
at sun.net.httpserver.HttpServerImpl.<init>(Unknown Source)
at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(Unknown Source)
at com.sun.net.httpserver.HttpServer.create(Unknown Source)
... 7 more
Line 19 is: “Endpoint.publish(address, implementor);”, implementor being an instance of EinsatzleitungImpl.
I would suspect my code to be at fault, but since it runs just fine in Eclipse, I doubt that cause. But that exception really does not tell me anything. Does anyone have an idea what might have caused it? Please help me, I am at my wits’ end.
Regards,
Anne
Hi all,
I finally got my CXF/JAX-WS service to run (of course it was just a classpath problem), and now I would like to run it outside of Eclipse. To make things easier, I have written an Ant build file and a batch file, both of which are, again, adapted from the bookstore example and which I have included below. Unfortunately, when I run said batch file which deploys my server, I get the following error:
Running in console/foreground mode by default, use Ctrl-C to exit...
--> Wrapper Started as Console
Launching a JVM...
Starting class de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Server...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
Starting Server
18.11.2008 14:43:47 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
INFO: No cxf.xml configuration file detected, relying on defaults.
18.11.2008 14:43:48 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {http://katastropheneinsatz.fgan.de}EinsatzleitungProvider from WSDL: file:C:\Dokumente und Einstellungen\Diefenbach\eclipseworkspace\Katastropheneinsatzleitung_Mule\Einsatzleitung.wsdl
WrapperSimpleApp: Encountered an error running main: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:267)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:84)
at javax.xml.ws.Endpoint.publish(Unknown Source)
at de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Server.<init>(Einsatzleitung_EinsatzleitungWSI_Server.java:19)
at de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Server.main(Einsatzleitung_EinsatzleitungWSI_Server.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:136)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:336)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251)
... 11 more
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/soap/http.
at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:115)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:85)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117)
... 14 more
<-- Wrapper Stopped
Isn't it complaining about the address & port having been taken already?
Andrew
On Nov 19, 2008 3:48 AM, "Diefenbach Anne" <Diefe...@fgan.de> wrote:
Regarding the problem described in my previous email, I have tried running the jar of my program exported from Eclipse with the following instruction:
java -cp .;EinsatzleitungJAX_Server.jar;C:\.m2\repository;$MULE_HOME\lib de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Server
This way I can't have missed any required libraries, right? But I still get an exception:
Exception in thread "main" com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
at com.sun.xml.internal.ws.transport.http.server.ServerMgr.createContext(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(Unknown Source)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(Unknown Source)
at javax.xml.ws.Endpoint.publish(Unknown Source) at de.fgan.katastropheneinsatz.E...
Caused by: java.net.BindException: Cannot assign requested address: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at sun.net.httpserver.ServerImpl.<init>(Unknown Source)
at sun.net.httpserver.HttpServerImpl.<init>(Unknown Source)
at sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(Unknown Source)
at com.sun.net.httpserver.HttpServer.create(Unknown Source)
... 7 more
Line 19 is: "Endpoint.publish(address, implementor);", implementor being an instance of EinsatzleitungImpl.
I would suspect my code to be at fault, but since it runs just fine in Eclipse, I doubt that cause. But that exception really does not tell me anything. Does anyone have an idea what might have caused it? Please help me, I am at my wits' end.
Regards,
Anne
Hi all, I finally got my CXF/JAX-WS service to run (of course it was just a classpath problem)...
No, that would’ve made more sense to me. However, I was able to solve this issue by setting the provider’s address to localhost instead of its IP address. Judging by the other occurrence of this address, it might actually have been an address in the wrong network, as I substituted a 6 for a 2 there. ^^; Though I wonder if that was the case, how my service could ever run in Eclipse.
Now I’m trying to get the client to work, which gives me a com.sun.xml.internal.ws.client.ClientTransportException. The full error is:
Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused: connect
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at $Proxy33.requestAssistance(Unknown Source)
at de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Client.main(Einsatzleitung_EinsatzleitungWSI_Client.java:92)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(UnknownSource)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
... 14 more
I call java -cp .;EinsatzleitungJAX_Client.jar;$MULE_HOME\lib;C:\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\.m2\repository de.fgan.katastropheneinsatz.Einsatzleitung_EinsatzleitungWSI_Client; the separate specification of commons-logging.jar is apparently needed, otherwise I get an exception complaining about it. Now I just wonder whether there is another Jar I need to point out to java specifically or if there is another cause for this exception. I have checked and double-checked IP and port address, they are correct in both WSDL and configuration file (though I’m pretty sure only the former is ever used). The port is free; I have used it previously for testing another ESB. The server is running and waiting for calls.
If anyone has an idea, I’ll be thankful for hints.
Regards,
Anne
Got it! For some reason, it seems the server doesn’t like localhost after all; I used my computer’s (correct) IP address and finally, finally could reach it! I still got an exception, but hey, it was only after it had answered my client.
(If someone knows what it means, though:
javax.xml.ws.WebServiceException: java.io.IOException: Stream is closed
at com.sun.xml.internal.ws.streaming.TidyXMLStreamReader.close(Unknown Source)
at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.close(Unknown Source)
at com.sun.xml.internal.ws.message.stream.StreamMessage.readPayloadAsJAXB(Unknown Source)
at com.sun.xml.internal.ws.server.sei.EndpointArgumentsBuilder$Body.readRequest(Unknown Source)
at com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(Unknown Source)
at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Stream is closed
at sun.net.httpserver.FixedLengthInputStream.readImpl(Unknown Source)
at sun.net.httpserver.LeftOverInputStream.drain(Unknown Source)
at sun.net.httpserver.LeftOverInputStream.close(Unknown Source)
at java.io.FilterInputStream.close(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.ServerConnectionImpl$1.close(Unknown Source)
... 24 more
Is this just because the client finished running? It uses a request-response and then a one-way operation.)
Regards,
Anne