Java Client Problem

Oezcan Acar acar at unitedinter.net
Tue Apr 24 05:43:13 UTC 2007


It implements allready serializable, but I still have the same problem!

thanks.


-------- Original-Nachricht --------
Datum: Mon, 23 Apr 2007 12:09:13 -0700
Von: Randy Wigginton <krw at nobugz.com>
An: Oezcan Acar <acar at unitedinter.net>
Betreff: Re: Java Client Problem

> Make sure your class implements java.io.Serializable.
> 
> On Apr 23, 2007, at 11:45 AM, Oezcan Acar wrote:
> 
> > Hi,
> >
> > I am using memcached java client 1.5.1 (http://www.whalin.com/ 
> > memcached/).
> >
> > I am able to store object in memcached server via java client. If I  
> > try to retrieve an object from ths store, I always get  
> > ClassNotFoundException. I init the client as follows:
> >
> > 	static
> > 	{
> > 				//memcached
> > 		String[] serverlist = { "xxx.xxx.xxx.xxx:11211"};
> >
> >         SockIOPool pool = SockIOPool.getInstance();
> >         pool.setServers(serverlist);
> >         pool.initialize();
> >
> > 	}
> >
> > usage:
> >
> > MemCachedClient mc = new MemCachedClient();
> > mc.set("username",new CommunityAccountData());
> > 		
> > if(mc.get("username") != null)
> > {
> >
> > the line above throws the exception. Am I missing something in the  
> > config?
> > The object, which I put to the store implements Serializable.
> >
> > Thanks for your help.
> >
> >
> > 2007-04-23 20:27:00,421 DEBUG com.danga.MemCached.MemCachedClient: 
> > 1279  - ++++ line: VALUE username 8 4374
> > 2007-04-23 20:27:00,421 DEBUG com.danga.MemCached.MemCachedClient: 
> > 1287  - ++++ key: username
> > 2007-04-23 20:27:00,421 DEBUG com.danga.MemCached.MemCachedClient: 
> > 1288  - ++++ flags: 8
> > 2007-04-23 20:27:00,421 DEBUG com.danga.MemCached.MemCachedClient: 
> > 1289  - ++++ length: 4374
> > 2007-04-23 20:27:00,515 ERROR com.danga.MemCached.MemCachedClient: 
> > 1352  - ++++ ClassNotFoundException thrown while trying to  
> > deserialize for key: username
> > java.lang.ClassNotFoundException:  
> > smart.community.common.communityaccount.CommunityAccountData
> > 	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > 	at java.security.AccessController.doPrivileged(Native Method)
> > 	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> > 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
> > 	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 java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:585)
> > 	at com.danga.MemCached.ContextObjectInputStream.resolveClass 
> > (ContextObjectInputStream.java:47)
> > 	at java.io.ObjectInputStream.readNonProxyDesc 
> > (ObjectInputStream.java:1544)
> > 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java: 
> > 1466)
> > 	at java.io.ObjectInputStream.readOrdinaryObject 
> > (ObjectInputStream.java:1699)
> > 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> > 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
> > 	at com.danga.MemCached.MemCachedClient.loadItems 
> > (MemCachedClient.java:1348)
> > 	at com.danga.MemCached.MemCachedClient.get(MemCachedClient.java:1046)
> > 	at com.danga.MemCached.MemCachedClient.get(MemCachedClient.java:980)
> > 	at smart.community.ui.LoginController.loadUser 
> > (LoginController.java:202)
> > 	at smart.community.ui.LoginController.handle(LoginController.java: 
> > 123)
> > 	at smart.core.servlet.filter.SessionProtectionFilter.doFilter 
> > (SessionProtectionFilter.java:163)
> > 	at com.caucho.server.http.FilterChainFilter.doFilter 
> > (FilterChainFilter.java:88)
> > 	at com.caucho.server.http.Invocation.service(Invocation.java:315)
> > 	at com.caucho.server.http.CacheInvocation.service 
> > (CacheInvocation.java:135)
> > 	at com.caucho.server.http.HttpRequest.handleRequest 
> > (HttpRequest.java:253)
> > 	at com.caucho.server.http.HttpRequest.handleConnection 
> > (HttpRequest.java:170)
> > 	at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
> > 	at java.lang.Thread.run(Thread.java:595)
> > 2007-04-23 20:27:00,515 ERROR com.danga.MemCached.MemCachedClient: 
> > 1058  - ++++ exception thrown while trying to get object from cache  
> > for key: username
> > 2007-04-23 20:27:00,515 ERROR com.danga.MemCached.MemCachedClient: 
> > 1059  - +++ failed while trying to deserialize for key: username
> > com.danga.MemCached.NestedIOException: +++ failed while trying to  
> > deserialize for key: username
> > 	at com.danga.MemCached.MemCachedClient.loadItems 
> > (MemCachedClient.java:1353)
> > 	at com.danga.MemCached.MemCachedClient.get(MemCachedClient.java:1046)
> > 	at com.danga.MemCached.MemCachedClient.get(MemCachedClient.java:980)
> > 	at smart.community.ui.LoginController.loadUser 
> > (LoginController.java:202)
> > 	at smart.community.ui.LoginController.handle(LoginController.java: 
> > 123)
> > 	at smart.core.servlet.filter.SessionProtectionFilter.doFilter 
> > (SessionProtectionFilter.java:163)
> > 	at com.caucho.server.http.FilterChainFilter.doFilter 
> > (FilterChainFilter.java:88)
> > 	at com.caucho.server.http.Invocation.service(Invocation.java:315)
> > 	at com.caucho.server.http.CacheInvocation.service 
> > (CacheInvocation.java:135)
> > 	at com.caucho.server.http.HttpRequest.handleRequest 
> > (HttpRequest.java:253)
> > 	at com.caucho.server.http.HttpRequest.handleConnection 
> > (HttpRequest.java:170)
> > 	at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
> > 	at java.lang.Thread.run(Thread.java:595)
> > Caused by: java.lang.ClassNotFoundException:  
> > smart.community.common.communityaccount.CommunityAccountData
> > 	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > 	at java.security.AccessController.doPrivileged(Native Method)
> > 	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> > 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
> > 	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 java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:585)
> > 	at com.danga.MemCached.ContextObjectInputStream.resolveClass 
> > (ContextObjectInputStream.java:47)
> > 	at java.io.ObjectInputStream.readNonProxyDesc 
> > (ObjectInputStream.java:1544)
> > 	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java: 
> > 1466)
> > 	at java.io.ObjectInputStream.readOrdinaryObject 
> > (ObjectInputStream.java:1699)
> > 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> > 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
> > 	at com.danga.MemCached.MemCachedClient.loadItems 
> > (MemCachedClient.java:1348)
> > 	... 12 more
> > -- 
> > Mit freundlichen Grüßen
> >
> > ___________________________
> >
> > Özcan Acar, Dipl. Inf(FH)
> > Vorstand
> > Smart Web Business AG
> >
> > Im Niederfeld 8
> > 65462 Gustavsburg
> >
> > +49 171 57 33 66 5
> > acar at unitedinter.net
> >

-- 
Mit freundlichen Grüßen

___________________________

Özcan Acar, Dipl. Inf(FH)
Vorstand
Smart Web Business AG

Im Niederfeld 8
65462 Gustavsburg

+49 171 57 33 66 5
acar at unitedinter.net



More information about the memcached mailing list