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.