10 Replies Latest reply on Mar 11, 2007 7:27 PM by Chip Schoch

    PojoCache can't find classloader

    Chip Schoch Novice

      I have a two server cluster and am trying to cache a sessionData object using PojoCache. When I initially start the app and try it I see the exception listed at the bottom.

      I am kind of confused about what I am supposed to do. I am using jdk5.0, Cache 1.4.1 SP2. I don't get any exception when I put the object in a single server cache, but when it goes into the cluster it throws. I have read and tries to follow all the instructions I could find but none seems to go flawlessly. For instance, it is not clear that to me that if I am annotating my classes that I still need to use the aopc precompiler to make this work, or is it just supposed to work?


      java.io.StreamCorruptedException: invalid stream header
      at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:763)
      at java.io.ObjectInputStream.(ObjectInputStream.java:278)
      at org.jboss.invocation.MarshalledValueInputStream.(MarshalledValueInputStream.java:74)
      at org.jboss.cache.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:186)
      at org.jgroups.blocks.RpcDispatcher.handle(RpcDispatcher.java:254)
      at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:650)
      at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:535)
      at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:358)
      at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:775)
      at org.jgroups.JChannel.up(JChannel.java:1091)
      at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:377)
      at org.jgroups.stack.ProtocolStack.receiveUpEvent(ProtocolStack.java:393)
      at org.jgroups.stack.Protocol.passUp(Protocol.java:538)
      at org.jgroups.protocols.pbcast.STATE_TRANSFER.up(STATE_TRANSFER.java:158)
      at org.jgroups.stack.Protocol.receiveUpEvent(Protocol.java:488)
      at org.jgroups.stack.Protocol.passUp(Protocol.java:538)
      at org.jgroups.protocols.pbcast.GMS.up(GMS.java:771)
      at org.jgroups.stack.UpHandler.run(Protocol.java:60)
      2007-03-06 20:45:59,638 ERROR [org.jgroups.blocks.RpcDispatcher] exception marshalling object
      java.io.IOException: No ClassLoaders found for: com.eLynx.Dispatch.SessionData
      at org.jboss.serial.classmetamodel.ClassMetamodelFactory.getClassMetaData(ClassMetamodelFactory.java:332)
      at org.jboss.serial.classmetamodel.StreamingClass.readStream(StreamingClass.java:72)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:381)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:643)
      at org.jboss.serial.io.JBossObjectInputStreamSharedTree.readObjectOverride(JBossObjectInputStreamSharedTree.java:61)
      at org.jboss.cache.marshall.JBossObjectStreamFactory$JBossObjectInputStreamOverride.readObjectOverride(JBossObjectStreamFactory.java:33)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:343)
      at org.jboss.cache.marshall.TreeCacheMarshaller140.unmarshallObject(TreeCacheMarshaller140.java:432)
      at org.jboss.cache.marshall.TreeCacheMarshaller140.unmarshallHashMap(TreeCacheMarshaller140.java:566)
      at org.jboss.cache.marshall.TreeCacheMarshaller140.unmarshallObject(TreeCacheMarshaller140.java:456)
      at org.jboss.cache.marshall.TreeCacheMarshaller140.unmarshallMethodCall(TreeCacheMarshaller140.java:493)
      at org.jboss.cache.marshall.TreeCacheMarshaller140.unmarshallObject(TreeCacheMarshaller140.java:436)
      at org.jboss.cache.marshall.TreeCacheMarshaller140.unmarshallMethodCall(TreeCacheMarshaller140.java:493)
      at org.jboss.cache.marshall.TreeCacheMarshaller140.unmarshallObject(TreeCacheMarshaller140.java:436)
      at org.jboss.cache.marshall.TreeCacheMarshaller140.objectFromStream(TreeCacheMarshaller140.java:148)
      at org.jboss.cache.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:167)
      at org.jgroups.blocks.RpcDispatcher.handle(RpcDispatcher.java:254)
      at org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:650)
      at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:535)
      at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:358)
      at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:775)
      at org.jgroups.JChannel.up(JChannel.java:1091)
      at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:377)
      at org.jgroups.stack.ProtocolStack.receiveUpEvent(ProtocolStack.java:393)
      at org.jgroups.stack.Protocol.passUp(Protocol.java:538)
      at org.jgroups.protocols.pbcast.STATE_TRANSFER.up(STATE_TRANSFER.java:158)
      at org.jgroups.stack.Protocol.receiveUpEvent(Protocol.java:488)
      at org.jgroups.stack.Protocol.passUp(Protocol.java:538)
      at org.jgroups.protocols.pbcast.GMS.up(GMS.java:771)
      at org.jgroups.stack.UpHandler.run(Protocol.java:60)
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: com.eLynx.Dispatch.SessionData
      at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:242)
      at org.jboss.serial.classmetamodel.ClassMetamodelFactory.resolveClassByName(ClassMetamodelFactory.java:269)
      at org.jboss.serial.classmetamodel.ClassMetamodelFactory.getClassMetaData(ClassMetamodelFactory.java:289)

        • 1. Re: PojoCache can't find classloader
          Manik Surtani Master

          This is a context class loader issue. Are you running this from within an app server, perhaps as a part of a WAR or EAR? Also, have you set UseRegionBasedMarshalling to true?

          • 2. Re: PojoCache can't find classloader
            Chip Schoch Novice

            Yes. It is a webapp running under JBossAS 4.0.5, deployed in an EAR. Does not use EJB.

            Where do I set UseRegionBasedMarshalling to true?

            • 3. Re: PojoCache can't find classloader
              Chip Schoch Novice

              I see in chpater 8 of the docus is says set

              true in cache xml. Would that be my PojoCache-service.xml?

              • 4. Re: PojoCache can't find classloader
                Chip Schoch Novice

                One other puzzling thing. I initially deployed PojoCache-service.xml with the ClusterName as the default, Sample-Cluster. I subsequently changed the name to eLynxCluster in both the servers in my cluster and restarted everything. Now I get a warning message that says:

                2007-03-06 21:38:26,980 WARN [org.jgroups.protocols.UDP] discarded message from different group "Sample-Cluster" (our group is "eLynxCluster"). Sender was 172.17.20.122:61905


                I am curious how it could even be cognizant of the name 'Sample-Cluster' after I changed all references to it and restarted? Go figure.

                • 5. Re: PojoCache can't find classloader
                  Manik Surtani Master

                   


                  Would that be my PojoCache-service.xml?
                  Yes, if that is what you've called it. :-)

                  Regarding seeing the old cluster name, are you sure you've changed this on all servers, and have restarted all of them?

                  • 6. Re: PojoCache can't find classloader
                    Chip Schoch Novice

                    Thanks for you help. As far as the Sample-Cluster message, we have two Jboss clusters here, qa and dev, and each has two jboss servers. I had not changed the name in the qa cluster and I was getting the message on the dev cluster. Changing it in qa fixed that.

                    As for the class loader problem, I still am not having any luck . My service xml is below. I have set ?UseRegionBasedMarshalling? to true in all servers but still get the classloader exception.

                    Any ideas where to go from here?


                    <?xml version="1.0" encoding="UTF-8"?>
                    
                    <server>
                    
                     <!-- Used inside JBoss AS -->
                     <classpath codebase="./lib" archives="jboss-cache-jdk50.jar, jgroups.jar"/>
                    
                     <mbean code="org.jboss.cache.aop.PojoCache"
                     name="jboss.cache:service=eLynxPojoCache">
                    
                     <!-- Used inside JBoss AS -->
                     <depends>jboss:service=Naming</depends>
                     <depends>jboss:service=TransactionManager</depends>
                    
                     <attribute name="UseRegionBasedMarshalling">true</attribute>
                     <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
                     <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
                     <attribute name="CacheMode">REPL_ASYNC</attribute>
                    
                     <!-- Name of cluster. Needs to be the same for all clusters, in order
                     to find each other
                     -->
                     <attribute name="ClusterName">eLynxCluster</attribute>
                    
                     <!-- JGroups protocol stack properties. Can also be a URL,
                     e.g. file:/home/bela/default.xml
                     <attribute name="ClusterProperties"></attribute>
                     -->
                    
                     <attribute name="ClusterConfig">
                     <config>
                     <!-- UDP: if you have a multihomed machine,
                     set the bind_addr attribute to the appropriate NIC IP address -->
                     <!-- UDP: On Windows machines, because of the media sense feature
                     being broken with multicast (even after disabling media sense)
                     set the loopback attribute to true -->
                     <UDP mcast_addr="228.1.2.5" mcast_port="45577"
                     ip_ttl="64" ip_mcast="true"
                     mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
                     ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
                     loopback="false"/>
                     <PING timeout="2000" num_initial_members="3"
                     up_thread="false" down_thread="false"/>
                     <MERGE2 min_interval="10000" max_interval="20000"/>
                     <FD shun="true" up_thread="true" down_thread="true"/>
                     <VERIFY_SUSPECT timeout="1500"
                     up_thread="false" down_thread="false"/>
                     <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
                     up_thread="false" down_thread="false"/>
                     <pbcast.STABLE desired_avg_gossip="20000"
                     up_thread="false" down_thread="false"/>
                     <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
                     down_thread="false"/>
                     <FRAG frag_size="8192"
                     down_thread="false" up_thread="false"/>
                     <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
                     shun="true" print_local_addr="true"/>
                     <pbcast.STATE_TRANSFER up_thread="false" down_thread="false"/>
                     </config>
                     </attribute>
                    
                    
                     <!--
                     The max amount of time (in milliseconds) we wait until the
                     initial state (ie. the contents of the cache) are retrieved from
                     existing members in a clustered environment
                     -->
                     <attribute name="InitialStateRetrievalTimeout">20000</attribute>
                    
                     <!--
                     Number of milliseconds to wait until all responses for a
                     synchronous call have been received.
                     -->
                     <attribute name="SyncReplTimeout">15000</attribute>
                    
                     <!-- Max number of milliseconds to wait for a lock acquisition -->
                     <attribute name="LockAcquisitionTimeout">10000</attribute>
                    
                     <!--
                     <attribute name="EvictionPolicyClass"></attribute>
                     -->
                    
                     <!-- Name of the eviction policy class. We have commented it off to disable eviction.
                     -->
                     <attribute name="EvictionPolicyClass">org.jboss.cache.aop.eviction.AopLRUPolicy</attribute>
                    
                     <!-- Specific eviction policy configurations. This is LRU -->
                     <attribute name="EvictionPolicyConfig">
                     <config>
                     <attribute name="wakeUpIntervalSeconds">5</attribute>
                     <!-- Cache wide default -->
                     <region name="/_default_">
                     <attribute name="maxNodes">5000</attribute>
                     <attribute name="timeToLiveSeconds">1000</attribute>
                     </region>
                     <region name="/aop">
                     <attribute name="maxNodes">5</attribute>
                     <attribute name="timeToLiveSeconds">4</attribute>
                     </region>
                     <region name="/pojo">
                     <attribute name="maxNodes">100</attribute>
                     <attribute name="timeToLiveSeconds">4</attribute>
                     </region>
                     <region name="/testMaxNode">
                     <attribute name="maxNodes">4</attribute>
                     <attribute name="timeToLiveSeconds">100</attribute>
                     </region>
                     </config>
                     </attribute>
                     </mbean>
                    
                    </server>
                    


                    • 7. Re: PojoCache can't find classloader
                      Manik Surtani Master

                       


                      Thanks for you help. As far as the Sample-Cluster message, we have two Jboss clusters here, qa and dev, and each has two jboss servers. I had not changed the name in the qa cluster and I was getting the message on the dev cluster. Changing it in qa fixed that.


                      Wow, you don't really want QA and dev talking to each other, do you? Should run them on different mcast addresses/ports if they're on the same LAN.

                      Re classloaders, you then need to register a context class loader for the specific region so that the unmarshalling layer knows which class loader to use when unmarshalling objects.

                      See the chapter on the TreeCacheMarshaller in the user guide.


                      • 8. Re: PojoCache can't find classloader
                        Chip Schoch Novice

                        Thanks for all your help. After multiple readings of the docs I am starting to get it. I now have the pojo caching somewhat working, however it appears only to serialize my object rather than pojo cache it.

                        I verified that the object inserted in one instance of JBoss is retrieved by the other but no field level changes are propagated.

                        When I removed the implements Serializable from the PojoCacheable object I got an exception:

                        2007-03-10 17:28:13,876 WARN [org.jboss.cache.TreeCache] putObject(): exception occurred: java.lang.IllegalArgumentException: PojoCache.putObject(): Object type is neither aspectized nor Serializable nor an array of primitives. Object class name is com.eLynx.Dispatch.SessionData

                        According to the documentation I should not have to aopc the objects when using jdk 5.0? Is that correct? I should just annotate it and get the aspectization at loadtime?

                        The code for the object is:

                        package com.eLynx.Dispatch;
                        
                        import java.io.Serializable;
                        
                        import com.eLynx.Database.ConnectionManager;
                        import com.eLynx.Database.Entity.Customer;
                        import com.eLynx.Database.Entity.UserInstance;
                        
                        import com.eLynx.Definition.CriteriaConstants;
                        import com.eLynx.Definition.ParameterConstants;
                        
                        import com.eLynx.logging.Loggable;
                        
                        import org.hibernate.Criteria;
                        import org.hibernate.Session;
                        
                        import org.hibernate.criterion.Expression;
                        
                        /**
                         * Class SessionData
                         */
                        
                        @org.jboss.cache.aop.annotation.PojoCacheable
                        public class SessionData extends SessionDataInterface implements Loggable, Serializable
                        {
                         @org.jboss.cache.aop.annotation.Serializable
                         UserInstance m_user = null;
                         @org.jboss.cache.aop.annotation.Serializable
                         Customer m_customer = null;
                         String m_customerId = "1"; // default to system id
                        
                         /**
                         * Constructor: SessionData
                         *
                         */
                        
                         public SessionData ()
                         {
                         }
                        
                         /**
                         * Method: getCustomer<BR>
                         * Return the current customer. If it is null try to look it up through the user.
                         *
                         *
                         * @return
                         *
                         * @throws Exception
                         */
                        
                         public Customer getCustomer () throws Exception
                         {
                         if (m_customer == null)
                         {
                         if (m_user != null)
                         {
                         Session session = ConnectionManager.getSession ();
                         Criteria crit =
                         session.createCriteria (Customer.class).add (Expression.eq (CriteriaConstants.COL_OBJECTID,
                         m_user.getCustomerId ()));
                         setCustomer ((Customer) crit.uniqueResult ());
                         }
                         }
                         return m_customer;
                         }
                        
                         /**
                         * Method: getCustomerId
                         *
                         *
                         * @return
                         *
                         * @throws Exception
                         */
                        
                         public String getCustomerId () throws Exception
                         {
                         return m_customerId;
                         }
                        
                         /**
                         * Method: getOfficeId
                         *
                         *
                         * @return
                         */
                        
                         String getOfficeId ()
                         {
                         if (m_user == null)
                         return "0"; // Default office
                         else return Integer.toString (getUser ().getOfficeId ());
                         }
                        
                         /**
                         * Method: getUser
                         *
                         *
                         * @return
                         */
                        
                         public UserInstance getUser ()
                         {
                         return m_user;
                         }
                        
                         /**
                         * Method: initialize
                         *
                         *
                         * @param arg
                         */
                        
                         @Override public void initialize (String... arg)
                         {
                         }
                        
                         /**
                         * Method: isActive
                         *
                         *
                         * @return
                         */
                        
                         public boolean isActive ()
                         {
                         boolean result = false;
                         if (m_user != null)
                         result = m_user.getActiveFlag () == ParameterConstants.YES_C;
                         return result;
                         }
                        
                         /**
                         * Method: render
                         *
                         *
                         * @return
                         */
                        
                         public String render ()
                         {
                         StringBuffer buffer = new StringBuffer (256);
                         buffer.append (super.render ());
                         buffer.append (String.format (" %20s = %d\n", "User Id:",
                         (m_user == null) ? 0 : m_user.getObjectId ()));
                         buffer.append (String.format (" %20s = %s\n", "Customerer Id:", m_customerId));
                         return buffer.toString ();
                         }
                        
                         /**
                         * Method: setCustomer
                         *
                         *
                         * @param customer
                         */
                        
                         public void setCustomer (Customer customer)
                         {
                         if (customer != null)
                         setCustomerId (customer.getObjectId ());
                        
                         m_customer = customer;
                         }
                        
                         /**
                         * Method: setCustomerId
                         *
                         *
                         * @param customerId
                         */
                        
                         public void setCustomerId (int customerId)
                         {
                         m_customerId = Integer.toString (customerId);
                         }
                        
                         /**
                         * Method: setCustomerId
                         *
                         *
                         * @param customerId
                         */
                        
                         public void setCustomerId (String customerId)
                         {
                         m_customerId = customerId;
                         }
                        
                         /**
                         * Method: setUser
                         *
                         *
                         * @param user
                         */
                        
                         public void setUser (UserInstance user)
                         {
                         m_user = user;
                         }
                        }
                        


                        The super class code is:

                        package com.eLynx.Dispatch;
                        
                        
                        
                        import com.eLynx.Context.RequestContext;
                        import com.eLynx.Database.ConnectionManager;
                        
                        import com.eLynx.Definition.ParameterConstants;
                        import com.eLynx.Exception.ErrorMessage;
                        
                        import com.eLynx.logging.Loggable;
                        
                        import java.io.Serializable;
                        import java.net.InetAddress;
                        
                        import java.util.HashMap;
                        import java.util.Iterator;
                        
                        import java.util.Map.Entry;
                        
                        import org.apache.log4j.Logger;
                        
                        import org.hibernate.Session;
                        
                        /**
                         * Interface SessionDataInterface
                         */
                        
                        @org.jboss.cache.aop.annotation.InstanceOfPojoCacheable
                        public abstract class SessionDataInterface implements Loggable, Serializable
                        {
                         static Logger logger = Logger.getLogger (SessionDataInterface.class);
                         //
                         boolean m_loggedIn = false;
                         boolean m_active = false;
                         String m_requestURL = "";
                         HashMap<String, String> m_sessionValues = new HashMap<String, String> ();
                        
                         /**
                         * Method: isAuthenticated<BR>
                         * Checks the session for a session data and if one is found checks if the session is logged in.
                         * If there is no current session data then it returns false.
                         *
                         *
                         * @param request
                         *
                         * @return
                         */
                        
                         public static boolean isAuthenticated (RequestContext context)
                         {
                         boolean result = false;
                        
                         SessionDataInterface obj = (SessionDataInterface) context.getSessionData ();
                        
                         if (obj != null)
                         result = obj.getLoggedIn ();
                         else
                         logger.debug ("No session data object found");
                        
                         logger.debug ("isAuthenticated: " + result);
                        
                         return result;
                         }
                        
                         /**
                         * Method: getCustomerId
                         *
                         *
                         * @return
                         *
                         * @throws Exception
                         */
                        
                         public String getCustomerId () throws Exception
                         {
                         return getSessionValue (ParameterConstants.CUSTOMERID_PARM);
                         }
                        
                         /**
                         * Method: getDBSession
                         *
                         *
                         * @return
                         *
                         * @throws Exception
                         */
                        
                         public Session getDBSession () throws Exception
                         {
                         return ConnectionManager.getSession ();
                         }
                        
                         /**
                         * Method: getRequestURL
                         *
                         *
                         * @return
                         */
                        
                         public String getRequestURL ()
                         {
                         return m_requestURL;
                         }
                        
                         /**
                         * Method: getSessionValue
                         *
                         *
                         * @param key
                         *
                         * @return
                         */
                        
                         public String getSessionValue (String key)
                         {
                         String result = "";
                         if (m_sessionValues.containsKey (key))
                         result = m_sessionValues.get (key);
                         return result;
                         }
                        
                         /**
                         * Method: getUserId
                         *
                         *
                         * @return
                         *
                         * @throws Exception
                         */
                        
                         public String getUserId () throws Exception
                         {
                         return getSessionValue (ParameterConstants.USERID_PARM);
                         }
                        
                         /**
                         * Method: initialize
                         *
                         *
                         * @param arg
                         *
                         * @throws ErrorMessage
                         * @throws Exception
                         */
                        
                         public abstract void initialize (String... arg) throws Exception, ErrorMessage;
                        
                         /**
                         * Method: isActive
                         *
                         *
                         * @return
                         */
                        
                         public boolean getActive ()
                         {
                         return m_active;
                         }
                        
                        
                         public boolean getLoggedIn ()
                         {
                         return m_loggedIn;
                         }
                        
                         /**
                         * Method: putSessionValue
                         *
                         *
                         * @param key
                         * @param value
                         *
                         * @return
                         */
                        
                         public String putSessionValue (String key,
                         String value)
                         {
                         return m_sessionValues.put (key, value);
                         }
                        
                         /**
                         * Method: render<br>
                         * Dump the contents of the sessiondata map.
                         *
                         *
                         * @return
                         */
                        
                         public String render ()
                         {
                         StringBuffer buffer = new StringBuffer (256);
                        
                         try
                         {
                         InetAddress inetAddress = InetAddress.getLocalHost ();
                         String hostName = inetAddress.getHostName ();
                         buffer.append ("\n\n ************** Dumping SessionData contents *************\n");
                         buffer.append (String.format (" %20s = %s\n", "hostname", hostName));
                         buffer.append (String.format (" %20s = %s\n", "Logged In:", m_loggedIn ? "yes" : "no"));
                         Iterator<Entry<String, String>> i = m_sessionValues.entrySet ().iterator ();
                        
                         while (i.hasNext ())
                         {
                         Entry<String, String> e = i.next ();
                         buffer.append (String.format (" %20s = %s\n", e.getKey (), e.getValue ()));
                         }
                         }
                         catch (Exception e)
                         {
                         buffer.append (e.getMessage ());
                         }
                        
                         return buffer.toString ();
                         }
                        
                         /**
                         * Method: setActive
                         *
                         *
                         * @param flag
                         */
                        
                         public void setActive (boolean flag)
                         {
                         m_active = flag;
                         }
                        
                         /**
                         * Method: setCustomerId
                         *
                         *
                         * @param id
                         */
                        
                         public void setCustomerId (int id)
                         {
                         putSessionValue (ParameterConstants.CUSTOMERID_PARM, Integer.toString (id));
                         }
                        
                         /**
                         * Method: setCustomerId
                         *
                         *
                         * @param id
                         */
                        
                         public void setCustomerId (String id)
                         {
                         putSessionValue (ParameterConstants.CUSTOMERID_PARM, id);
                         }
                        
                         /**
                         * Method: setLoggedIn
                         *
                         *
                         * @param flag
                         */
                        
                         public void setLoggedIn (boolean flag)
                         {
                         logger.debug("Setting logged in: " + flag);
                         m_loggedIn = flag;
                         }
                        
                         /**
                         * Method: setUserId
                         *
                         *
                         * @param id
                         */
                        
                         public void setUserId (int id)
                         {
                         putSessionValue (ParameterConstants.USERID_PARM, Integer.toString (id));
                         }
                        
                         /**
                         * Method: setCustomerId
                         *
                         *
                         * @param id
                         */
                        
                         public void setUserId (String id)
                         {
                         putSessionValue (ParameterConstants.USERID_PARM, id);
                         }
                        }
                        
                        




                        • 9. Re: PojoCache can't find classloader
                          Ben Wang Master

                          If you are running Pojocache inside JBoss AS, I'd recommend to do "aopc" first so that you don't need to worry about load-time instrumentation. The reason is JBoss AS doesn't turn on load-time instrumentation mode by default.

                          • 10. Re: PojoCache can't find classloader
                            Chip Schoch Novice

                            Thanks alot for all your help. I was able to get it to work by using aopc first. I came across the enable loadtime weaving stuff in the docs and made one attempt to turn it on, but I got some class not found exception so I just backed off that. I must say it was difficult sifting through all the documentation to finally get it. Maybe I am just getting too old. Anyway, thanks again.

                            For anyone else that comes across this thread, the main lesson here is:

                            If you are running in JBossAS, loadtime instrumenting is off by default so you will have to run aopc, even if your code is jdk 5.0 annotated. If your cache object is serializable then you may not recognize right off that it is not getting field level replication, therefore, remove the serializable interface so if it is not aspectized you will get an exception.

                            I hope this is a correct summation.