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:
http://jax-ws.java.net/
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
JAX-WS is already included in Notes/Domino. I suspect there may have been some instability introduced within your server whilst you were round-tripping during development.
I've created custom providers and consumers within XPages applications c/w SSJS and Custom Java access without issue since 8.5.3 and in 9.0.
Are you past your issue now? (if so, can you close out this question accordingly please :-)
Related
my team is facing a SSLException when we try to hit a REST based webservice. We are adding all the headers required to call the webservice.
Right now we have got a temporary solution to the problem. We have added the security file from Java 8 folder to the Java 7 folder.
There is one more socket based solution which our team tried, but I don't know it on the larger context. But it has been refused to implement too by higher authorities.
We have found that the webservice is based on java 5. And in java 7 some of the security certificates were not available due to which we were getting an error. The first solution works for the testing phase but it's not good for production purposes.
The actual error we are facing is:
javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair
During our research we found this question too and tried to follow up every solution given for this question.
So is there anyone who has faced the similar issue before and provide us with a solution to apply, so that we can hit the webservice and add those certificates dynamically at runtime.
Please post the SSL debug logs?
I had this problem once and reason was that remote rest service were only supporting TLSv1.2 and we were on TLSv1.1
We called the rest service by mentioning TLSv1.1 protocol in System.setProperty() method.
The problem was with the Java version. The security files which were needed by the rest service to hit were not present in Java 1.7.51(our current java version). So instead of changing the security files we upgraded our java version from 1.7.51 to 1.7.80(This version of java contains those security files). Hence no compatibility was broken and the issue was fixed successfully without a workaround.
We got this solution's idea from this StackOverflow Question.
I am trying to setup a payment gateway. For which I have setup a java bridge as the portal is a java machine. My setup is following :
Apache server
Tomcat 7
Java-6-open jdk
following is error from catalina.out
PospostSSL><Exception in encrypting data. algorithm DES/ECB is
not available from provider Cryptix>
<PostLib><postSSL><SFAApplicationException. Error while encrypting
data. Transaction cannot be processed.>
I have placed the cryptix32.jar in shared folder of tomcat. Also adding or removing line from java.security for cryptix provider is also not having any effect.
Please can any one tell me what needs to be done to get this error out.
So you are trying to set up a payment portal using DES and Cryptix? Then you are proposing to use Apache - probably with OpenSSL - as proxy. A proxy to a Java version that is basically end of life. And you are using one without commercial support.
"DES/ECB" is part of the standard SunJCE provider as well. No need for Cryptix there.
Please stop resurrecting the dead and go do something else.
We are having a performance issue when loading our Swing application under an applet container.
The Swing client communicates with JBoss server using RMI protocol.
When comparing our webstart application VS the new Applet container , its seems that the
Object marshaling taking much more time in the applet.
The ObjectInputStream -> writeExternal (using the JBoss Client RMI infra ) taking too much time to complete , 3-5x times then the webstart
In our ENV we have full deployment that sync all JARS between the server and the client (applet or webstart) so we don't need to load them remotely
The applet tag look like this:
archive="[contain list of 100 JARS -> about 200 MB]"
codebase="http://[remoteApacheServer]/USERTEST:85600"
List item
List of params ...
When checked that on the applet bootstrap the Applet loaded all the JARS from the server
But checking with sniffer we saw that every time we marshaled a new Class the applet class loader didn't used the Local version and send another request to remoteApacheServer looking for the specific class.
We found out the solution for it: using applet parameter :
param name="codebase_lookup" value="false
also we saw that loading the JARS locally - setting local nodejs HTTP that will serve the JRAS and set the codebase to use this temp server also boostup the peformance .
even just create nodejs server that just proxying the request backto the original remoteApacheServer helped .
but still the performance is still not good :-(
we saw in the sniffer that the client sending a reqest every time with the applet codebase and the full list of archive (all 100 JARS) and we saw the RMI has a feature
(Dynamic code downloading using Java™ RMI) that the Server can Marshell an Object even if its not exists in its local CLASSPATH.
see RMI setttings here
Do you know any why to disable it - i think its can help use solving the performance issue.
maybe using the java.rmi.server.useCodebaseOnly ?
i am building a web service on eclipse using Apache AXIS 2 Webservice runtime using Apache Tomcat server (apache-tomcat-7.0.23) while running it on tomcat server it sucessfully shows that the web service is running...
But while creating Webservice client to test the web service and using the wsdl url in the server definition (http://localhost:9090/Axis2WSTest/services/Converter?wsdl), this gives below mentioned error and not letting me to create Webservice client:
The service definition selected is invalid
Can you please suggest me the error and possible solution for it?
The problem could be that your wsdl needs http authentication. I was getting the same error in eclipse, but it was because the server I was connecting to needed authentication and was returning a 401 error, so eclipse was saying it wasn't a wsdl. Eclipse doesn't seem to have the functionality to prompt for authentication, I was able to generate a client in netbeans using the same wsdl url because netbeans knows to ask for authentication.
Generate client from http authenticated wsdl
I was searching for the whole day for an answer for this,generally localhost will be added in your bypass proxy list and hence you will not encounter an error.
Go to windows--> preference-->general--> network-connection and see whether localhost is listed in your proxybypass list.If you are trying to access a external wsdl link and you under
some corporate network having proxy firewall you have to set http proxy/https proxy.
Is this how you are trying to generate client stub ?? If yes, just simply create a java project in eclipse, click on it, then press Ctrl+N, select web service client and enter your wsdl url. (make sure you have made sure you can access the wsdl url, by simply giving it in a browser).
Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way
I had exactly same situation. For me the following worked:
I got the lead from rdp's response - "Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way"
Using IP didn't work for me. What worked for me:
Instead of - http://servername/SomeWebService/Service.asmx?WSDL
putting FQDN for servername. For example -
http://servername.my.company.com/SomeWebService/Service.asmx?WSDL
I had the same issue and I was able to generate the stubs using soapUI. Please follow the this post. Which contains GENERATING CLIENT JAVA CODE FOR WSDL USING SOAP UI – AXIS2 WSDL2JAVA. Before that please download apache axis2 binary from here and extract it.
We had to downgrade our Jersey version from 1.7 to 1.0.3.1 due to the client using Java 5 (and 1.7 did not seem compatible). When using 1.7, we were able to happily connect to the server using the code snippet below. When we downgraded, we only get Error 500s (via a UniformInterfaceException) yet the URL in the error message still works within my browser.
This is our first time working with Jersey - were any major changes made to how URLs are called from 1.0.3.1 to 1.7? Should we change the way we make these types of calls?
WebResource service = client.resource(CPC_SECURE_BASE_URL); //base URL is the server's URL
System.out.println(service.path("customer").path("0007023210").accept(
MediaType.TEXT_XML).get(String.class));
Full stack trace:
com.sun.jersey.api.client.UniformInterfaceException: GET https://<address removed>/app/customer/0007023210 returned a response status of 500
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:563)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:179)
at com.jersey.client.RestClient.retrieveXMLResource(RestClient.java:66)
at com.jersey.client.RestClient.main(RestClient.java:91)
Update - I just tried running the code with Jersey 1.2 (as it is the last version that will run on Java 5) and I now get an Error 401 returned. I have confirmed that everything is still working with Java 6+Jersey 1.7.
Well you're using a different call than I've used before. I've had to downgrade before, and everything transferred a-okay, but my call looked more like my answer for this question.
Coding errors were entered into the application during the downgrade. Hopefully this question can be deleted.