4 Replies Latest reply on Mar 11, 2009 9:58 AM by Clebert Suconic

    Client Connection Delegate has Null state

    Michael Marcucilli Newbie

      I'm trying to start an application running in JBoss 4.0.5 that is to be a client to a JBoss Messaging server running JBoss 4.2.3, Messaging 1.4.0.SP3. I think I've worked out most of the classpath issues, and everything starts up without exception. I create the initial context with JNDI to connect to the messaging server, and have no problem coreating the connection factory. and connection. However, when I try to set an exception listener I get an NPE because the ClientConnectionDelegate has a null state. I've tried using the updated remoting jar, but that doesn't solve the problem. I have no problem running the messaging component of my application outside of the JBoss server, so I'm pretty sure the issue is somewhere either within my jboss config or with one of the client messaging jars I'm using. Anyone been able to resolve a similar issue? Thanks for any help.

      Details:

      Client Application: server running in JBoss 4.0.5

      Messaging Server: JBoss v 4.2.3.GA

      WARNING: Exception in constructor
      java.lang.NullPointerException
      at org.jboss.jms.client.container.ConnectionAspect.getConnectionState(ConnectionAspect.java:254)
      at org.jboss.jms.client.container.ConnectionAspect.handleSetExceptionListener(ConnectionAspect.java:118)
      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.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:130)
      at org.jboss.jms.client.delegate.ClientConnectionDelegate$setExceptionListener_8089029433030319178.invokeNext(ClientConnectionDelegate$setExceptionListener_8089029433030319178.java)
      at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:170)
      at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:117)
      at org.jboss.jms.client.delegate.ClientConnectionDelegate$setExceptionListener_8089029433030319178.invokeNext(ClientConnectionDelegate$setExceptionListener_8089029433030319178.java)
      at org.jboss.jms.client.delegate.ClientConnectionDelegate.setExceptionListener(ClientConnectionDelegate.java)
      at org.jboss.jms.client.JBossConnection.setExceptionListener(JBossConnection.java:117)

      Client Jars included in classpath:
      jboss-remoting.jar - version 2.2.2.SP4
      jboss-aop-jdk50.jar - version jboss-aop-1.5.2.GA
      jboss-messaging-client.jar - version 1.4.0.SP3
      jbossall-client.jar - version 4.2.3.GA, stripped of all but the following packages javax.jms.*, org.apache.log4j.*, org.jboss.aop.*, org.jboss.aspects.*, org.jboss.injection.*, org.jboss.logging.*, org.jboss.remoting.*, org.jboss.util.*
      trove.jar - version 4.2.3.GA

        • 1. Re: Client Connection Delegate has Null state
          Clebert Suconic Master

          We used AOP 1.5.5.GA on JBossMessaging 1.4.0.SP3.

          There's probably some inconsistency around AOP and JBAS 4.0.3?

          Look at the JBM Documentation at the specific version you are using, to verify about these dependencies.


          BTW: I believe JBM has been set to run on JBAS 4.2+. I know you're talking about the client, but maybe you will need to play with classLoader isolations to get that working.

          • 2. Re: Client Connection Delegate has Null state
            Michael Marcucilli Newbie

            I've updated the aop jar to the recommended version and now get this error

            Caused by: java.lang.AbstractMethodError: getLoaderRepository
            at org.jboss.aop.AspectManager.instance(AspectManager.java:340)
            at org.jboss.aop.AspectManager.instance(AspectManager.java:255)
            at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.(ClientConnectionFactoryDelegate.java)
            at sun.misc.Unsafe.ensureClassInitialized(Native Method)
            at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
            at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
            at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
            at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
            at java.lang.reflect.Field.getLong(Field.java:528)
            at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1614)
            at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
            at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:425)
            at java.io.ObjectStreamClass.(ObjectStreamClass.java:413)
            at java.io.ObjectStreamClass.lookup0(ObjectStreamClass.java:310)
            at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java)
            at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547)
            at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
            at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
            at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
            at java.rmi.MarshalledObject.get(MarshalledObject.java:142)
            at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)


            It looks as thought the implementation of AOPScopedClassLoaderHelper that is used within AspectManager does not implement this method. The only implementation in my classpath is JBossScopedClassLoaderHelper, and the class signature doesn't have this method. The class is defined in jboss-aspect-library-jdk50.jar, version jboss-aspect-library-1.5.

            • 3. Re: Client Connection Delegate has Null state
              Andy Taylor Master

              i would suggest migrating to jboss 4.2.3.

              • 4. Re: Client Connection Delegate has Null state
                Clebert Suconic Master

                 

                "ataylor" wrote:
                i would suggest migrating to jboss 4.2.3.


                +1

                If you really have to use JBAS 4.0.X at your client, you will have to play with classLoader isolations, and have all the JBAS 4.2 libraries on that isolated classLoader, in a way that your WEB/EAR application would behave as any other standalone application.

                That's a sour procedure and error prone... it's probably easier to migrate to 4.2.3.