• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem using JCS, ClassNotFoundException  RSS feed

 
sruthi adhuri
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm new to JCS. I've a web application where objects will be cached offline(over night job). When i try access them online i'm getting java.lang.ClassNotFoundException.

I'm using Index Desk caching. One more observation, when use custom class(com.ebusiness.modules.reviewIndexes.valueObjects.ResultObject in this case) i used to get this exception. Please advise me on this.
Here is the complete Exception and my cache.ccf file.

java.lang.ClassNotFoundException: com.ebusiness.modules.reviewIndexes.valueObjects.ResultObject
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:558)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1835)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1759)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at org.apache.jcs.utils.serialization.StandardSerializer.deSerialize(StandardSerializer.java:73)
at org.apache.jcs.auxiliary.disk.indexed.IndexedDisk.readObject(IndexedDisk.java:115)
at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.readElement(IndexedDiskCache.java:584)
at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doGet(IndexedDiskCache.java:537)
at org.apache.jcs.auxiliary.disk.AbstractDiskCache.get(AbstractDiskCache.java:293)
at org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java:520)
at org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java:427)
at org.apache.jcs.access.CacheAccess.get(CacheAccess.java:192)
at com.ebusiness.modules.core.utils.cache.IxRevCacheManager.getCacheObject(IxRevCacheManager.java:179)
at com.ebusiness.modules.core.utils.cache.IxRevCacheManager.getCacheObject(IxRevCacheManager.java:135)
at com.ebusiness.modules.core.utils.cache.IxRevCacheManager.getCacheObject(IxRevCacheManager.java:127)
at com.ebusiness.modules.core.utils.cache.IxRevCacheLoader.getListing(IxRevCacheLoader.java:92)
at com.ebusiness.modules.reviewIndexes.controller.AggregateListingController.getAggregateListing(AggregateListingController.java:73)
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:324)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:137)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:115)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:548)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:302)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:93)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:156)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:46)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:130)
at flex.messaging.endpoints.AMFEndpoint.service(AMFEndpoint.java:164)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6985)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
<Jul 23, 2008 02:33:21> ERROR [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] (IndexedDiskCache.java:551) - Region [testCache1] Failure getting from disk, key = 484110AB4187Industry1000306251true
java.io.IOException: Region [testCache1] Problem reading object from disk. com.ebusiness.modules.reviewIndexes.valueObjects.ResultObject
at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.readElement(IndexedDiskCache.java:594)
at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doGet(IndexedDiskCache.java:537)
at org.apache.jcs.auxiliary.disk.AbstractDiskCache.get(AbstractDiskCache.java:293)
at org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java:520)
at org.apache.jcs.engine.control.CompositeCache.get(CompositeCache.java:427)
at org.apache.jcs.access.CacheAccess.get(CacheAccess.java:192)
at com.ebusiness.modules.core.utils.cache.IxRevCacheManager.getCacheObject(IxRevCacheManager.java:179)
at com.ebusiness.modules.core.utils.cache.IxRevCacheManager.getCacheObject(IxRevCacheManager.java:135)
at com.ebusiness.modules.core.utils.cache.IxRevCacheManager.getCacheObject(IxRevCacheManager.java:127)
at com.ebusiness.modules.core.utils.cache.IxRevCacheLoader.getListing(IxRevCacheLoader.java:92)
at com.ebusiness.modules.reviewIndexes.controller.AggregateListingController.getAggregateListing(AggregateListingController.java:73)
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:324)
at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:137)
at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:115)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:548)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:302)
at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:93)
at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:156)
at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:46)
at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:130)
at flex.messaging.endpoints.AMFEndpoint.service(AMFEndpoint.java:164)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:340)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6985)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

cache.ccf:
jcs.default=indexedDiskCache
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=0
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache

# #### CACHE REGIONS FOR TEST

jcs.region.testCache1=indexedDiskCache
jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=0
jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache

# #### AUXILIARY CACHES

# Indexed Disk Cache
jcs.auxiliary.indexedDiskCache=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.indexedDiskCache.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000000
jcs.auxiliary.DC.attributes.MaxKeySize=2147483647
jcs.auxiliary.indexedDiskCache.attributes.DiskPath=.

# #############################################################
# ################# THREAD POOL CONFIGURATION ###################
# Default thread pool config
thread_pool.default.boundarySize=2000
thread_pool.default.maximumPoolSize=150
thread_pool.default.minimumPoolSize=4
thread_pool.default.keepAliveTime=350000
# RUN ABORT WAIT BLOCK DISCARDOLDEST
thread_pool.default.whenBlockedPolicy=RUN
thread_pool.default.startUpSize=4

# Default Cache Event Queue thread pool config, used by auxiliaries
thread_pool.cache_event_queue.useBoundary=false
# thread_pool.cache_event_queue.boundarySize=2000
# thread_pool.cache_event_queue.maximumPoolSize=10
thread_pool.cache_event_queue.minimumPoolSize=5
thread_pool.cache_event_queue.keepAliveTime=3500
# thread_pool.cache_event_queue.whenBlockedPolicy=RUN
thread_pool.cache_event_queue.startUpSize=5

# Remote cache client thread pool config
thread_pool.remote_cache_client.boundarySize=75
thread_pool.remote_cache_client.maximumPoolSize=150
thread_pool.remote_cache_client.minimumPoolSize=4
thread_pool.remote_cache_client.keepAliveTime=350000
thread_pool.remote_cache_client.whenBlockedPolicy=RUN
thread_pool.remote_cache_client.startUpSize=4

Thanks in advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presumably com.ebusiness.modules.reviewIndexes.valueObjects.ResultObject is not in your application's classpath?
 
sruthi adhuri
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul, if i keep the com.ebusiness.modules.reviewIndexes.valueObjects.ResultObject class in application classpath it start working(kept all classes used by ResultObject). But keeping these files in classpath is a maintenance issue right? Is there any way using class loader to load the required classes?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!