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]]

Java.net JIRA | gcruscoe | 6 years ago
  1. 0

    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

    Java.net JIRA | 6 years ago | gcruscoe
    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]]
  2. 0

    is it possible to load jars-in-jars in JWS?

    Stack Overflow | 6 years ago | posdef
    java.lang.reflect.InvocationTargetException
  3. 0

    How to read excel file on a Java-Web Start Application

    Stack Overflow | 3 years ago | Bimbz
    java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.WorkbookFactory
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    HSSFWorkbook Error

    Stack Overflow | 3 years ago | Bimbz
    java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook
  6. 0

    Webstart and JavaCompiler API restrictions

    Stack Overflow | 5 years ago | RobotRock
    java.lang.NoClassDefFoundError: com/sun/tools/javac/api/JavacTool

  1. treefolk 4 times, last 2 weeks ago
  2. jstrayer 1 times, last 4 months ago
  3. Justin 1 times, last 5 months ago
84 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    com.sun.messaging.jmq.jmsserver.util.BrokerException

    at java.net.URLClassLoader$1.run()
  2. Java RT
    URLClassLoader.findClass
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    2. java.security.AccessController.doPrivileged(Native Method)
    3. java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    3 frames
  3. com.sun.jnlp
    JNLPClassLoader.findClass
    1. com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:332)
    1 frame
  4. Java RT
    ClassLoader.loadClass
    1. java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    2. java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    2 frames
  5. com.sun.messaging
    ResourceAdapter.start
    1. com.sun.messaging.jms.ra.ResourceAdapter.start(ResourceAdapter.java:356)
    1 frame
  6. JMS Module
    ActiveJmsResourceAdapter$1.run
    1. com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter$1.run(ActiveJmsResourceAdapter.java:360)
    1 frame
  7. Java RT
    AccessController.doPrivileged
    1. java.security.AccessController.doPrivileged(Native Method)
    1 frame
  8. JMS Module
    ActiveJmsResourceAdapter.startResourceAdapter
    1. com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.startResourceAdapter(ActiveJmsResourceAdapter.java:353)
    1 frame
  9. Connectors Runtime
    ActiveOutboundResourceAdapter.init
    1. com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:129)
    1 frame
  10. Connectors Inbound Support
    ActiveInboundResourceAdapterImpl.init
    1. com.sun.enterprise.connectors.inbound.ActiveInboundResourceAdapterImpl.init(ActiveInboundResourceAdapterImpl.java:90)
    1 frame
  11. Connectors Runtime
    ConnectorObjectFactory.getObjectInstance
    1. com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:135)
    2. com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:106)
    3. com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:212)
    4. com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:378)
    5. com.sun.enterprise.resource.naming.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:108)
    5 frames
  12. Java RT
    NamingManager.getObjectInstance
    1. javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    1 frame
  13. Glassfish Naming
    SerialContext.lookup
    1. com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:556)
    2. com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:514)
    3. com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
    3 frames
  14. Java RT
    InitialContext.lookup
    1. javax.naming.InitialContext.lookup(InitialContext.java:392)
    1 frame
  15. com.tester.client
    Main.main
    1. com.tester.client.Main.main(Main.java:35)
    1 frame
  16. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  17. org.glassfish.appclient
    JWSAppClientContainerMain.main
    1. org.glassfish.appclient.client.acc.AppClientContainer.launch(AppClientContainer.java:432)
    2. org.glassfish.appclient.client.AppClientFacade.launch(AppClientFacade.java:182)
    3. org.glassfish.appclient.client.JWSAppClientContainerMain$ClientRunner.run(JWSAppClientContainerMain.java:168)
    4. org.glassfish.appclient.client.JWSAppClientContainerMain.main(JWSAppClientContainerMain.java:132)
    4 frames
  18. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  19. com.sun.javaws
    Launcher.run
    1. com.sun.javaws.Launcher.executeApplication(Launcher.java:1804)
    2. com.sun.javaws.Launcher.executeMainClass(Launcher.java:1750)
    3. com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1512)
    4. com.sun.javaws.Launcher.run(Launcher.java:130)
    4 frames
  20. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:662)
    1 frame