Forum Discussion

schnizlein's avatar
schnizlein
Contributor
15 years ago

[SOLVED]Connecting to Weblogic JMS Endpoint

I'm able to successfully send JMS messages (thanks for the help regarding BytesMessage!) to WebSphere queues, however I'm unable to connect to Weblogic queues.

First I modified the classpath on the 1.14 Hermes installation that SoapUI uses, which, when I opened Hermes (through the SoapUI interface) let me browse queues.

However, I'm still getting errors in SoapUI when I send to a Weblogic Queue:

Wed Mar 17 07:45:55 CDT 2010:ERROR:javax.jms.JMSException: Could not create InitialContext: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
javax.jms.JMSException: Could not create InitialContext: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory
at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.(JMSConnectionHolder.java:77)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestSendReceiveTransport.execute(HermesJmsRequestSendReceiveTransport.java:36)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestTransport.sendRequest(HermesJmsRequestTransport.java:95)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:122)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

I had the bright idea of adding weblogic.jar to the External library folder for SoapUI, which got me this error (on sending):

Wed Mar 17 07:42:12 CDT 2010:ERROR:javax.jms.JMSException: weblogic/kernel/KernelStatus
javax.jms.JMSException: weblogic/kernel/KernelStatus
at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.(JMSConnectionHolder.java:77)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestSendReceiveTransport.execute(HermesJmsRequestSendReceiveTransport.java:36)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestTransport.sendRequest(HermesJmsRequestTransport.java:95)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:122)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

Any ideas?
  • FYI I updated to a 'nightly build' per a previous issue, I'm currently on:

    Build soapui-core-daily-2010-03-16-[5], Build Date 2010/03/16 06:12
  • Yup, I've been using Weblogic with Hermes (normally 1.13, but I have executed successfully in 1.14 against Weblogic, I had to modify the classpath in hermes.bat to include weblogic.jar)

    I also tried to add weblogic.jar to the SoapUI classpath (%SOAPUI_HOME%..\lib\* aka C:\Program Files\eviware\soapUI-3.5\lib)

    That causes this 'Startup Error':

    java.lang.NoClassDefFoundError: weblogic/utils/NestedException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    at java.lang.Class.getConstructor0(Class.java:2699)
    at java.lang.Class.newInstance0(Class.java:326)
    at java.lang.Class.newInstance(Class.java:308)
    at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:147)
    at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:298)
    at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:223)
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:123)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:694)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:604)
    at org.apache.log4j.xml.XMLWatchdog.doOnChange(DOMConfigurator.java:861)
    at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:88)
    at org.apache.log4j.helpers.FileWatchdog.(FileWatchdog.java:57)
    at org.apache.log4j.xml.XMLWatchdog.(DOMConfigurator.java:853)
    at org.apache.log4j.xml.DOMConfigurator.configureAndWatch(DOMConfigurator.java:584)
    at com.eviware.soapui.DefaultSoapUICore.initLog(DefaultSoapUICore.java:430)
    at com.eviware.soapui.DefaultSoapUICore.init(DefaultSoapUICore.java:121)
    at com.eviware.soapui.StandaloneSoapUICore.(StandaloneSoapUICore.java:37)
    at com.eviware.soapui.SoapUI$SoapUIRunner.run(SoapUI.java:605)
    at com.eviware.soapui.SoapUI.main(SoapUI.java:700)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.exe4j.runtime.WinLauncher.main(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: weblogic.utils.NestedException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 39 more
  • Have you had a chance to follow-up on this?

    I'd be more than happy to set up a session and set aside time to explain more details, or provide further information.
  • So I took a bigger stab in the dark, and added ALL of the JAR files from weblogic to the ext folder.  They all loaded properly, but failed at connection again.  However it failed differently.

    Mon Mar 22 17:35:49 CDT 2010:ERROR:javax.jms.JMSException
      javax.jms.JMSException
      at hermes.JNDIConnectionFactory.createConnection(JNDIConnectionFactory.java:85)
      at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.createConnection(JMSConnectionHolder.java:85)
      at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.(JMSConnectionHolder.java:65)
      at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestSendReceiveTransport.execute(HermesJmsRequestSendReceiveTransport.java:36)
      at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestTransport.sendRequest(HermesJmsRequestTransport.java:96)
      at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:122)
      at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:75)
      at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:235)
      at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:324)
      at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStep(WsdlTestCaseRunner.java:206)
      at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:137)
      at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:39)
      at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
    Mon Mar 22 17:35:49 CDT 2010:ERROR:javax.jms.JMSException
      javax.jms.JMSException
      at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.(JMSConnectionHolder.java:77)
      at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestSendReceiveTransport.execute(HermesJmsRequestSendReceiveTransport.java:36)
      at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestTransport.sendRequest(HermesJmsRequestTransport.java:96)
      at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:122)
      at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:75)
      at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:235)
      at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:324)
      at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStep(WsdlTestCaseRunner.java:206)
      at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:137)
      at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:39)
      at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    sorry for this late response.
    I have installed latest WebLogic server and tested HermesJMS and SoapUI against it.
    For HermesJMS I followed instructions on this blog http://blogs.oracle.com/jamesbayer/2008 ... s_con.html

    It works fine on both application ( i.e. I can send and receive jms messages )
    I only add weblogic.jar in hermes.bat file and not added anything in soapUI.

    Which version of weblogic you are using ?

    regards
    nebojsa
    eviware.com
  • Weblogic 10. 
    I have already followed direction almost exactly in the link (although they were written by our Java Dev team). 

    I am able to connect in Hermes (and perform a number of actions in Jython scripting).  but sending a message via SoapUI results in the Could not create InitialContext: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory error seen above.

    When you say 'I only add weblogic.jar in hermes.bat file and not added anything in soapUI.' do you mean adding it to the classpath in hermes.bat?

    I've attached my hermes config and my hermes.bat
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    yes , I meant adding  weblogic.jar to classpath in hermes.bat
    Can you try to use the same weblogic.jar in both hermes-config.xml and hermes.bat , I'm just guessing .


    Regards
    nebojsa
    eviware.com
  • It looks like the hermes config XML was not configured properly (pointing to a wrong folder).  Hermes itself wasn't having a problem because weblogic.jar was in its classpath.

    The reason it was misconfigured was I had to change the folder Weblogic was installed to.  I attempted to update the configuration in the Hermes GUI, but it didn't 'stick'.  I've had this problem before, I wonder if Hermes will ever fix it.  I had to modify the XML by hand.  After doing so, it worked!!

    Thanks so much!