glassfish
  1. glassfish
  2. GLASSFISH-16192

lookup fails for JMS Connection factory from java web start client

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.1_b03 , 4.0_b01
    • Component/s: standalone_client
    • Labels:
      None
    • Environment:

      linux glassfish 3.1 java se 6u24

      Description

      I have a simple test client that I am trying to use to connect to JMS on glassfish 3.1. The application server has a simple connection factory created with:

      asadmin create-jms-resource --restype javax.jms.ConnectionFactory jms/TestConnectionFactory

      And the code I try to connect with is:

      InitialContext jndiContext = new InitialContext();

      jndiContext.lookup("jms/TestConnectionFactory");

      This fails with the craziest stack trace. If I run it as an appclient directly it works fine. But when I run it as a java web start it fails.

      I have attached the zip of setup of mvn projects that should be easy to build and deploy on glassfish 3.1. other than that I just ran the asadmin commands to create the connection

      The stack trace I get is:

      Mar 10, 2011 5:50:54 PM com.sun.enterprise.connectors.ActiveOutboundResourceAdapter init
      SEVERE: RAR6035 : Resource adapter start failed :

      {0}

      java.lang.NoClassDefFoundError: com/sun/messaging/jmq/jmsserver/util/BrokerException
      at com.sun.messaging.jms.ra.ResourceAdapter.start(ResourceAdapter.java:356)
      at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter$1.run(ActiveJmsResourceAdapter.java:360)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.startResourceAdapter(ActiveJmsResourceAdapter.java:353)
      at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:129)
      at com.sun.enterprise.connectors.inbound.ActiveInboundResourceAdapterImpl.init(ActiveInboundResourceAdapterImpl.java:90)
      at com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:135)
      at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:106)
      at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:212)
      at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:378)
      at com.sun.enterprise.resource.naming.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:108)
      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
      at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:556)
      at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:514)
      at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
      at javax.naming.InitialContext.lookup(InitialContext.java:392)
      at com.tester.client.Main.main(Main.java:35)
      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 org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:432)
      at org.glassfish.appclient.client.AppClientFacade.launch(AppClientFacade.java:182)
      at org.glassfish.appclient.client.JWSAppClientContainerMain$ClientRunner.run(JWSAppClientContainerMain.java:168)
      at org.glassfish.appclient.client.JWSAppClientContainerMain.main(JWSAppClientContainerMain.java:132)
      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.sun.javaws.Launcher.executeApplication(Launcher.java:1804)
      at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1750)
      at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1512)
      at com.sun.javaws.Launcher.run(Launcher.java:130)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.ClassNotFoundException: com.sun.messaging.jmq.jmsserver.util.BrokerException
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:332)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      ... 34 more
      Mar 10, 2011 5:50:54 PM com.tester.client.Main main
      SEVERE: Lookup failed for 'jms/TestConnectionFactory' in SerialContext[myEnv=

      {java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
      javax.naming.NamingException: Lookup failed for 'jms/TestConnectionFactory' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}

      [Root exception is javax.naming.NamingException: Failed to look up ConnectorDescriptor from JNDI [Root exception is com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to start resource adapter : com/sun/messaging/jmq/jmsserver/util/BrokerException]]
      at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
      at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
      at javax.naming.InitialContext.lookup(InitialContext.java:392)
      at com.tester.client.Main.main(Main.java:35)
      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 org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:432)
      at org.glassfish.appclient.client.AppClientFacade.launch(AppClientFacade.java:182)
      at org.glassfish.appclient.client.JWSAppClientContainerMain$ClientRunner.run(JWSAppClientContainerMain.java:168)
      at org.glassfish.appclient.client.JWSAppClientContainerMain.main(JWSAppClientContainerMain.java:132)
      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.sun.javaws.Launcher.executeApplication(Launcher.java:1804)
      at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1750)
      at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1512)
      at com.sun.javaws.Launcher.run(Launcher.java:130)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: javax.naming.NamingException: Failed to look up ConnectorDescriptor from JNDI [Root exception is com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to start resource adapter : com/sun/messaging/jmq/jmsserver/util/BrokerException]
      at com.sun.enterprise.resource.naming.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:115)
      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
      at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:556)
      at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:514)
      ... 20 more
      Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Failed to start resource adapter : com/sun/messaging/jmq/jmsserver/util/BrokerException
      at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:140)
      at com.sun.enterprise.connectors.inbound.ActiveInboundResourceAdapterImpl.init(ActiveInboundResourceAdapterImpl.java:90)
      at com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:135)
      at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:106)
      at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:212)
      at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:378)
      at com.sun.enterprise.resource.naming.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:108)
      ... 23 more
      Caused by: java.lang.ClassNotFoundException: com.sun.messaging.jmq.jmsserver.util.BrokerException
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:332)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at com.sun.messaging.jms.ra.ResourceAdapter.start(ResourceAdapter.java:356)
      at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter$1.run(ActiveJmsResourceAdapter.java:360)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.startResourceAdapter(ActiveJmsResourceAdapter.java:353)
      at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:129)
      ... 29 more

        Activity

        Hide
        Nigel Deakin added a comment -

        Since the target version has been changed from 3.2 to 3.1.1 this will require backporting the underlying MQ fix from MQ 4.6 (which goes into 3.2) to MQ 4.5.1 (which goes into 3.1.1). Since this requires action, I'll reopen the bug.

        Show
        Nigel Deakin added a comment - Since the target version has been changed from 3.2 to 3.1.1 this will require backporting the underlying MQ fix from MQ 4.6 (which goes into 3.2) to MQ 4.5.1 (which goes into 3.1.1). Since this requires action, I'll reopen the bug.
        Hide
        Nigel Deakin added a comment - - edited

        I believe that the Fix Version/s field was changed from 3.2 to 3.1.1 in the mistaken belief that the fix had already been ported to 3.1.1, rather than an explicit request to perform the backport. I have therefore corrected the Fix version/s field and marked the bug as resolved. If a backport is required, please add a comment stating exactly what is required and re-open the bug.

        Show
        Nigel Deakin added a comment - - edited I believe that the Fix Version/s field was changed from 3.2 to 3.1.1 in the mistaken belief that the fix had already been ported to 3.1.1, rather than an explicit request to perform the backport. I have therefore corrected the Fix version/s field and marked the bug as resolved. If a backport is required, please add a comment stating exactly what is required and re-open the bug.
        Hide
        Nigel Deakin added a comment -

        A fix to MQ-80 has now been ported to MQ 4.5.1_b01. This release will be included in GlassFish 3.1_b03. I am therefore recording this bug as being fixed in GlassFish 3.1.1_b03 as well as GlassFish 3.2_b01.

        Show
        Nigel Deakin added a comment - A fix to MQ-80 has now been ported to MQ 4.5.1_b01. This release will be included in GlassFish 3.1_b03. I am therefore recording this bug as being fixed in GlassFish 3.1.1_b03 as well as GlassFish 3.2_b01.
        Hide
        Nigel Deakin added a comment -

        Adding (retrospectively) the 3_1_1-review tag to ensure that this fix is properly reviewed as being suitable for 3.1.1.

        This bug was introduced in GlassFish 3.1 and affects all application clients run using Java Web Start which use MQ. Although the bug is caused by missing classes in the classpath, a user using JWS does not have direct control over the classpath and so cannot easily work around it.

        The targetted build for this fix is 3.1_b03 (as stated in the previous comment).

        There are no regression tests for this issue but it is very easy to reproduce using the steps above and verify.

        The fix itself is very simple and the risk of accidentally destabilising GlassFish is very low.

        Show
        Nigel Deakin added a comment - Adding (retrospectively) the 3_1_1-review tag to ensure that this fix is properly reviewed as being suitable for 3.1.1. This bug was introduced in GlassFish 3.1 and affects all application clients run using Java Web Start which use MQ. Although the bug is caused by missing classes in the classpath, a user using JWS does not have direct control over the classpath and so cannot easily work around it. The targetted build for this fix is 3.1_b03 (as stated in the previous comment). There are no regression tests for this issue but it is very easy to reproduce using the steps above and verify. The fix itself is very simple and the risk of accidentally destabilising GlassFish is very low.
        Hide
        Nigel Deakin added a comment -

        Closing this issue as it has now been resolved, and no additional testing is required.

        Show
        Nigel Deakin added a comment - Closing this issue as it has now been resolved, and no additional testing is required.

          People

          • Assignee:
            Nigel Deakin
            Reporter:
            gcruscoe
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: