jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smuts, Aaron" <Aaron.Sm...@travelocity.com>
Subject RE: ClassNotFoundException on value object when MemoryShrinker is enabled
Date Mon, 24 Apr 2006 14:03:25 GMT
Put the jcs jar in the same place as the jars that contain your code.
This will solve the problem.  

> -----Original Message-----
> From: Eddie Liu [mailto:eidde.com@gmail.com]
> Sent: Monday, April 24, 2006 8:34 AM
> To: JCS Users List
> Subject: Re: ClassNotFoundException on value object when
MemoryShrinker is
> enabled
> 
> Hi,
> 
> I had trouble compiling my codes after I moved the jar files to the
same
> directory.  The following is the full stacktrace.  The value object
class
> is
> now ListHashMap, but the issue is the same.
> 
> I will keep trying different things.
> 
> Thanks for your help!  Any other suggestions are welcome!
> 
> -------------------------------------------------
> [4/24/06 8:21:17:594 EDT] 00000054 IndexedDisk   E   TRAS0014I: The
> following exception was logged java.lang.ClassNotFoundException:
> mypackage.util.ListHashMap
>  at com.ibm.ws.classloader.CompoundClassLoader.findClass(
> CompoundClassLoader.java(Compiled Code))
>  at com.ibm.ws.classloader.CompoundClassLoader.loadClass(
> CompoundClassLoader.java:414)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
>  at java.lang.Class.forName0(Native Method)
>  at java.lang.Class.forName(Class.java:260)
>  at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:591)
>  at
>
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
>  at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1468)
>  at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java
> :1659)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1307)
>  at
>
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1877)
>  at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1801)
>  at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java
> :1679)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1307)
>  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:357)
>  at org.apache.jcs.auxiliary.disk.indexed.IndexedDisk.readObject(
> IndexedDisk.java:114)
>  at
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.readElement(
> IndexedDiskCache.java:526)
>  at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doGet(
> IndexedDiskCache.java:484)
>  at org.apache.jcs.auxiliary.disk.AbstractDiskCache.get(
> AbstractDiskCache.java:298)
>  at
org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java
> :488)
>  at
org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java
> :391)
>  at org.apache.jcs.access.CacheAccess.get(CacheAccess.java:201)
>  at mypackage.data.ListDSManager.getCachedObj(ListDSManager.java:81)
>  at
mypackage.actions.EventUpdateAction.execute(EventUpdateAction.java:48)
>  at org.apache.struts.action.RequestProcessor.processActionPerform(
> RequestProcessor.java:484)
>  at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java
> :274)
>  at
>
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>  at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(
> ServletWrapper.java:1212)
>  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(
> ServletWrapper.java:1173)
>  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(
> WebAppFilterChain.java:92)
>  at
>
mypackage.application.BemsServletFilter.doFilter(BemsServletFilter.java
> :29)
>  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(
> FilterInstanceWrapper.java:142)
>  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(
> WebAppFilterChain.java:77)
>  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(
> ServletWrapper.java:626)
>  at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(
> CacheServletWrapper.java:80)
>  at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java
> :1657)
>  at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java
> :77)
>  at
>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio
n(
> HttpInboundLink.java:421)
>  at
>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio
n(
> HttpInboundLink.java:367)
>  at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(
> HttpICLReadCallback.java:94)
>  at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(
> WorkQueueManager.java:548)
>  at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(
> WorkQueueManager.java:601)
>  at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(
> WorkQueueManager.java:934)
>  at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(
> WorkQueueManager.java:1021)
>  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
> .
>                                  java.lang.ClassNotFoundException:
> mypackage.util.ListHashMap
>  at com.ibm.ws.classloader.CompoundClassLoader.findClass(
> CompoundClassLoader.java(Compiled Code))
>  at com.ibm.ws.classloader.CompoundClassLoader.loadClass(
> CompoundClassLoader.java:414)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
>  at java.lang.Class.forName0(Native Method)
>  at java.lang.Class.forName(Class.java:260)
>  at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:591)
>  at
>
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
>  at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1468)
>  at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java
> :1659)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1307)
>  at
>
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1877)
>  at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1801)
>  at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java
> :1679)
>  at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1307)
>  at java.io.ObjectInputStream.readObject(ObjectInputStream.java:357)
>  at org.apache.jcs.auxiliary.disk.indexed.IndexedDisk.readObject(
> IndexedDisk.java:114)
>  at
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.readElement(
> IndexedDiskCache.java:526)
>  at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doGet(
> IndexedDiskCache.java:484)
>  at org.apache.jcs.auxiliary.disk.AbstractDiskCache.get(
> AbstractDiskCache.java:298)
>  at
org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java
> :488)
>  at
org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java
> :391)
>  at org.apache.jcs.access.CacheAccess.get(CacheAccess.java:201)
>  at mypackage.data.ListDSManager.getCachedObj(ListDSManager.java:81)
>  at
mypackage.actions.EventUpdateAction.execute(EventUpdateAction.java:48)
>  at org.apache.struts.action.RequestProcessor.processActionPerform(
> RequestProcessor.java:484)
>  at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java
> :274)
>  at
>
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
>  at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(
> ServletWrapper.java:1212)
>  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(
> ServletWrapper.java:1173)
>  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(
> WebAppFilterChain.java:92)
>  at
>
mypackage.application.BemsServletFilter.doFilter(BemsServletFilter.java
> :29)
>  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(
> FilterInstanceWrapper.java:142)
>  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(
> WebAppFilterChain.java:77)
>  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(
> ServletWrapper.java:626)
>  at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(
> CacheServletWrapper.java:80)
>  at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java
> :1657)
>  at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java
> :77)
>  at
>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscriminatio
n(
> HttpInboundLink.java:421)
>  at
>
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformatio
n(
> HttpInboundLink.java:367)
>  at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(
> HttpICLReadCallback.java:94)
>  at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(
> WorkQueueManager.java:548)
>  at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(
> WorkQueueManager.java:601)
>  at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(
> WorkQueueManager.java:934)
>  at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(
> WorkQueueManager.java:1021)
>  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
> 
> On 4/22/06, Aaron Smuts <asmuts@yahoo.com> wrote:
> >
> > It looks like your class files are not available to
> > the classloader that loaded JCS.  Put the jars in the
> > same directory and see if it helps.  Also, can you
> > send the full stack trace of the error if it is in the
> > logs.
> >
> > Aaron
> >
> > --- Eddie Liu <eidde.com@gmail.com> wrote:
> >
> > > Yes, I am running under IBM Websphere application
> > > server.  Can you further
> > > explain what you mean by "same place as my code"?
> > > Now the jcs jar is in a
> > > different directory and I have set up the
> > > dependencies (class-path in the
> > > MANIFEST.MF) so that my application can find the jar
> > > files.  I can move them
> > > to /WEB-INF/lib and see if that makes a difference,
> > > is that what you
> > > suggest?
> > >
> > > Thank you for your help!
> > >
> > > On 4/21/06, Smuts, Aaron
> > > <Aaron.Smuts@travelocity.com> wrote:
> > > >
> > > > Looks like a classloader issue.  Are you running
> > > inside of some evil
> > > > application server that never did a nice thing for
> > > anyone?  . . .  Is
> > > > the jcs jar in the same place as your code?
> > > >
> > > > > -----Original Message-----
> > > > > From: Eddie Liu [mailto:eidde.com@gmail.com]
> > > > > Sent: Friday, April 21, 2006 12:03 PM
> > > > > To: jcs-users@jakarta.apache.org
> > > > > Subject: ClassNotFoundException on value object
> > > when MemoryShrinker is
> > > > > enabled
> > > > >
> > > > > Hi,
> > > > >
> > > > > I have set up a cache region using DC, with
> > > MemoryShrinker enabled
> > > > (true).
> > > > > I still receive the NoClassDefFoundError each
> > > time when restarting the
> > > > web
> > > > > server, that issue was discussed under a
> > > different threat.
> > > > >
> > > > > This time, with MemoryShrinker on, when the
> > > memory cache expired, I
> > > > could
> > > > > see the listDS.data file got populated and the
> > > file size went from 0k
> > > > to
> > > > > 1k.  But after it wrote to the file in disk,
> > > i.e., after I saw in the
> > > > log:
> > > > >
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > >
> > ------------------------------------------------------
> > > > > [4/21/06 11:56:51:375 EDT] 0000003e
> > > CacheEventQue I   Cache event
> > > > queue
> > > > > created: CacheEventQueue
> > > [listenerId=-1121403549, cacheName=listDS]
> > > > > [4/21/06 11:57:01:391 EDT] 00000041
> > > CacheEventQue I   QProcessor
> > > > exiting
> > > > > for
> > > > > CacheEventQueue [listenerId=-1121403549,
> > > cacheName=listDS]
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > > > > if I tried to access the cache again, I got the
> > > following exception:
> > > > >
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > >
> > ------------------------------------------------------
> > > > > [4/21/06 11:58:52:406 EDT] 00000035 IndexedDisk
> > >  E   TRAS0014I: The
> > > > > following exception was logged
> > > java.lang.ClassNotFoundException:
> > > > > mypackage.BookVObj
> > > > >  at
> > >
> > com.ibm.ws.classloader.CompoundClassLoader.findClass(
> > > > > CompoundClassLoader.java(Compiled Code))
> > > > >  at
> > >
> > com.ibm.ws.classloader.CompoundClassLoader.loadClass(
> > > > > CompoundClassLoader.java:414)
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > > > > where BookVObj is my value object for the cache.
> > >  But again, in the
> > > > > BookVObjManager, since it could not find the
> > > value object from cache,
> > > > it
> > > > > was
> > > > > loaded from database and things seems to be
> > > working fine.
> > > > >
> > > > > So what do I need to do to get rid of that
> > > exception?
> > > > >
> > > > > The following is my cache.ccf setup for the
> > > region.
> > > > >
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > >
> > ------------------------------------------------------
> > > > > jcs.region.listDS=DC
> > > > >
> > > >
> > >
> >
jcs.region.listDS.cacheattributes=org.apache.jcs.engine.CompositeCacheAt
> > > > tr
> > > > > ibutes
> > > > >
> > > jcs.region.listDS.cacheattributes.MaxObjects=1200
> > > > >
> > > >
> > >
> >
jcs.region.listDS.cacheattributes.MemoryCacheName=org.apache.jcs.engine.
> > > > me
> > > > > mory.lru.LRUMemoryCache
> > > > >
> > > jcs.region.listDS.elementattributes.IsEternal=false
> > > > >
> > >
> > jcs.region.listDS.elementattributes.MaxLifeSeconds=10
> > > > >
> > > jcs.region.listDS.elementattributes.IdleTime=1800
> > > > > jcs.region.listDS.elementattributes.IsSpool=true
> > > > >
> > > jcs.region.listDS.elementattributes.IsRemote=true
> > > > >
> > > jcs.region.listDS.elementattributes.IsLateral=true
> > > > >
> > > > >
> > >
> > jcs.region.listDS.cacheattributes.UseMemoryShrinker=true
> > > > >
> > >
> > jcs.region.listDS.cacheattributes.MaxMemoryIdleTimeSeconds=5
> > > > >
> > >
> > jcs.region.listDS.cacheattributes.ShrinkerIntervalSeconds=5
> > > > >
> > > jcs.region.listDS.cacheattributes.MaxSpoolPerRun=500
> > > > >
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > >
> > ------------------------------------------------------
> > > > >
> > > > > Thank you for all of you help!!
> > > > >
> > > > > Eddie
> > > >
> > > >
> > >
> >
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > jcs-users-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > > jcs-users-help@jakarta.apache.org
> > > >
> > > >
> > >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message