2 Replies Latest reply on Feb 26, 2007 6:13 AM by Bharath VN

    java.lang.IllegalAccessError in 1.2.0.CR1

    Bharath VN Newbie

      Hi,

      I have been trying to setup 1.2.0.CR1.
      While deploying the my MDBs i am getting the following exception

      15:23:26,554 WARN [JMSContainerInvoker] JMS provider failure detected for MyMDB
      java.lang.IllegalAccessError: tried to access class org.jboss.aop.ClassAdvisor$1 from class org.jboss.aop.ClassAdvisor
       at org.jboss.aop.ClassAdvisor.attachClass(ClassAdvisor.java:271)
       at org.jboss.aop.AspectManager.initialiseClassAdvisor(AspectManager.java:587)
       at org.jboss.aop.AspectManager.getAdvisor(AspectManager.java:575)
       at org.jboss.jms.client.delegate.ClientClusteredConnectionFactoryDelegate.<clinit>(ClientClu
      steredConnectionFactoryDelegate.java)
       at sun.misc.Unsafe.ensureClassInitialized(Native Method)
       at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:2
      5)
       at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
       at java.lang.reflect.Field.acquireFieldAccessor(Field.java:917)
       at java.lang.reflect.Field.getFieldAccessor(Field.java:898)
       at java.lang.reflect.Field.getLong(Field.java:527)
       at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1559)
       at java.io.ObjectStreamClass.access$600(ObjectStreamClass.java:47)
       at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:381)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:373)
       at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:268)
       at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:504)
       at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
       at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
      


      Not able to figure why i am getting this.
      Any pointers are appreciated

      Thanks,
      Bharath

        • 1. Re: java.lang.IllegalAccessError in 1.2.0.CR1
          Ovidiu Feodorov Master

          Can you send me an example that would help me reproduce the problem? All our MDB tests passed ...

          • 2. Re: java.lang.IllegalAccessError in 1.2.0.CR1
            Bharath VN Newbie

            Below is a sample MDB that i use

            import javax.ejb.EJBException;
            import javax.ejb.MessageDrivenBean;
            import javax.ejb.MessageDrivenContext;
            import javax.jms.Message;
            import javax.jms.MessageListener;
            import javax.jms.TextMessage;
            
            
            
            
            public class MyMDB implements MessageDrivenBean, MessageListener
            {
             private static final String COB_ID = "COB_ID";
             private static final String CONTAINER = "CONTAINER";
             private static final String ITEM_ID = "ITEM_ID";
             private static final String INFO_ID = "INFO_ID";
             private static final String LAST_UPDATED = "LAST_UPDATED";
             private static final String MEM_ID = "MEM_ID";
            
             private MessageDrivenContext mdbContext = null;
            
             public void onMessage(Message message)
             {
             try
             {
             TextMessage textMessage = (TextMessage) message;
             System.out.println("My MDB get called");
             String cobrandId = message.getStringProperty(COB_ID);
             String container = message.getStringProperty(CONTAINER);
             String cacheItemId = message.getStringProperty(ITEM_ID);
             String sumInfoId = message.getStringProperty(INFO_ID);
             String lastUpdated = message.getStringProperty(LAST_UPDATED);
             String memId = message.getStringProperty(MEM_ID);
            
             System.out.println("message contains :" );
             System.out.println("cobId : " + cobId);
             System.out.println("container : " + container);
             System.out.println("ItemId : " + ItemId);
             System.out.println("InfoId : " + InfoId);
             System.out.println("lastUpdated : " + lastUpdated);
             System.out.println("mem id: " + memId);
             //Calling functions to process the message
             }
             catch(Exception e)
             {
             e.printStackTrace();
             }
             }
            
             public void setMessageDrivenContext(MessageDrivenContext context)
             throws EJBException {
             this.mdbContext = context;
             }
            
             public void ejbCreate() {
             }
            
             public void ejbRemove() {
             }
            }
            


            jms-ds.xml

            <?xml version="1.0" encoding="UTF-8"?>
            
            <connection-factories>
            
             <!-- ==================================================================== -->
             <!-- WSMQ connection factories -->
             <!-- ==================================================================== -->
            
             <!-- non XA provider loader and connection factory -->
             <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
             name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
             <attribute name="ProviderName">DefaultJMSProvider</attribute>
             <attribute name="ProviderAdapterClass">
             org.jboss.jms.jndi.JNDIProviderAdapter
             </attribute>
             <attribute name="QueueFactoryRef">MDBDLQCF</attribute>
             <attribute name="TopicFactoryRef">MDBTestQueueCF</attribute>
             <attribute name="Properties">java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory</attribute>
             <attribute name="Properties">java.naming.provider.url=localhost:1099</attribute>
             <attribute name="Properties">java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces</attribute>
             </mbean>
            
            </connection-factories>
            
            


            Entries of the above mentioned CFs in connection-factories-service.xml

            <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
             name="jboss.messaging.connectionfactory:service=MDBDLQCF"
             xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
             <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
             <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=socket</depends>
             <depends>jboss.messaging:service=PostOffice</depends>
            
             <attribute name="JNDIBindings">
             <bindings>
             <binding>/MDBDLQCF</binding>
             </bindings>
             </attribute>
            
             <attribute name="Clustered">true</attribute>
             <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>
             </mbean>
            
             <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
             name="jboss.messaging.connectionfactory:service=MDBTestQueueCF"
             xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
             <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
             <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=socket</depends>
             <depends>jboss.messaging:service=PostOffice</depends>
            
             <attribute name="JNDIBindings">
             <bindings>
             <binding>/MDBTestQueueCF</binding>
             </bindings>
             </attribute>
            
             <attribute name="Clustered">true</attribute>
             <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>
             </mbean>