My Domino Web Service Provider broke when I upgraded the (Win64) server from 8.5.3FP2 to FP3. I wrote some information about it to XPage forum.
Instead of fighting with Axis based legacy stuff I'd like to use JAX WS which comes with Java 1.6. I decided to try this very simple example. I copy pasted the code to a Java project on my Designer Eclipse, run it and the Web Service was up and running on my local machine: it responded and returned the WSDL.
Next I copy pasted the code to an NSF on server as Code/Java elements and changed:
public static void main(String[] args)
to
public HelloWorldPublisher()
and called this constructor from SSJS in XPage. I got this error:
Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException : A @WebService.targetNamespace must be specified on classes with no package. Class: HelloWorldImpl
The classes were in packages. I run it also with command line on Domino server JVM and got the same error. After googling I added this
@WebService(targetNamespace="http://mycompany.net/dev/ph")
to HelloWorld and
@WebService(endpointInterface="com.mkyong.ws.HelloWorld", targetNamespace="http://mycompany.net/dev/ph", portName="HelloWorldPort", name="HelloWorld", serviceName="HelloWorldService")
to HelloWorldImpl in NSF and run it. After that the web service seemed to be up and running!
Next I booted the server because it was slow and after that I have not seen the WSDL! I've run the code many times, restarted HTTP and tried removing @WebService
attributes. I've also tried to run the code with command line on server again but that gives me always the above @WebService.targetNamespace error, I have no idea why.
Now I get always this to Domino console:
java.lang.NoClassDefFoundError: com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory (initialization failure) at java.lang.J9VMInternals.initialize(J9VMInternals.java:140) at com.sun.xml.internal.ws.server.SDDocumentImpl.writeTo(SDDocumentImpl.java:266) at com.sun.xml.internal.ws.transport.http.HttpAdapter.publishWSDL(HttpAdapter.java:538) at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:230) at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:107) at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:92) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77) at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:77) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80) at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:569) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77) at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:541) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) at java.lang.Thread.run(Thread.java:738)
when accessing this URL on server:
http://localhost:9999/ws/hello?wsdl
I'm a bit surprised I get anything to Domino log because I think this uses JVM http server. I don't understand why it worked first and now it cannot find this class.
How do I publish JAX WS endpoint to Domino Server?
EDIT
I downloaded the JAX WS jars from here:
and placed the them in \jvm\lib\ext folder. The WSDL URL started to work again! Also the endpoint URL has some information now. I don't know why I had to do this because the functionality should be included in JVM 1.6. Next I will try to use Domino objects in the endpoint code.
Is it possible to make JAX WS to use Domino http server?
thanks,
- Panu