• Post Reply Bookmark Topic Watch Topic
  • New Topic

SOAPException : Urgent help needed.

 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing one strange problem :
I have a import statement as :
import javax.xml.soap.SOAPConnectionFactory;

When I am trying to create a new instance of the SOAPConnectionFactory :
SOAPConnectionFactory.newInstance();

I am getting following exception :
javax.xml.soap.SOAPException: Unable to create SOAP connection factory: Provider com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory not found.

This code is part of a ejb method which is deployed under weblogic 9.2.
Strange part here is when I put a main method inside the ejb and executed the class as a standalone java-class in my weblogic-workshop, it worked fine w/o any exception. But when I am calling the same code as ejb-method, i am getting the exception.

I searched on net for this problem and tried with couple of ways as :
1] System.setProperty("javax.xml.soap.SOAPConnectionFactory","com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory");
-> Not worked. Got the same exception.
2] Passed the vm-args parameter while starting the weblogic server as : -Djavax.xml.soap.SOAPConnectionFactory=com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory
-> Not worked. Got the same exception.
3] Tried by altering the sequence of jars(webservices.jar , weblogic.jar)present in the CLASSPATH (in the setDomainEnv.cmd file).
-> Not worked. Got the same exception.
[ Also note that I have saxon8.jar and saxon8-dom.jar files in the classpath. I tried by changing the sequence of these files with the webservices.jar and weblogic.jar]
4]I downloaded the saaj-impl.jar and included in he classpath and restarted the server. -> worked but got another exception.SOAPConnectionFactory is created but when creating a connection from this factory I got the NullPointerException. The factory object created is null.

Strange thing is that - another developer working on the same project is not having problem. I compared all the jars and classpaths and did same changes on my machine to get this worked , but all in vain.

If anybody has clue please reply my ASAP. Thanks in advance.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd imagine that from within the WebLogic EJB container you should be using the container's SOAPFactory implementation, i.e. "weblogic.wsee.saaj.SOAPConnectionFactoryImpl".
See: http://forums.bea.com/thread.jspa?threadID=600007964
 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already watched that topic. However thanks for your help.
Issue is resolved now. Here is what I did -
I passed following lines as VM-arguments (Note that NO semicolon. Separated by SPACE-key and not even ENTER-key.) This is a single line and not 3 separate lines.

-Djavax.xml.soap.SOAPConnectionFactory=weblogic.wsee.saaj.SOAPConnectionFactoryImpl -Djavax.xml.soap.MessageFactory=weblogic.xml.saaj.MessageFactoryImpl -Djavax.xml.soap.SOAPFactory=weblogic.xml.saaj.SOAPFactoryImpl

Also add the weblogic.jar file at the end of classpath. (I tried to add this file at the start of classspath or in middle , but issue did not resolve, so added this jar file at the end of classpath and that worked.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!