What additional JARs do I need to use the Memcache Java API?

149 views
Skip to first unread message

Charles

unread,
Feb 12, 2010, 11:42:31 PM2/12/10
to Google App Engine
Hi all,

I've tried adding caching functionality to my app using the Memcache
Java API but I'm hitting a wall here. I've followed the "Using
JCache" instructions on the GAE docs page (http://code.google.com/
appengine/docs/java/memcache/usingjcache.html). I've downloaded the
jsr107cache-1.1.jar and added it to my build path, as recommended. I
run the example locally and I get an exception...

"Could not find class: 'ri.cache.BasicCacheFactory'"

I did some searching and downloaded a jcache-1.0-dev-3.jar file
(http://www.findjar.com/class/ri/cache/BasicCacheFactory.html) and
also added that to my build path. The "Could not find class" error
disappeared and I got a new error...

"Class: 'ri.cache.BasicCacheFactory' does not implement CacheFactory"

I must be missing something. If anyone is using Memcache, can you let
me know if I need to add any other JARs besides the
jsr107cache-1.1.jar that App Engine provides? Or maybe I'm just doing
something stupid in my app and missed something in the instructions.

Thanks in advance


Charles

Charles

unread,
Feb 16, 2010, 4:28:31 PM2/16/10
to Google App Engine
Bump!

Anyone have any suggestions?


Charles

Nick Johnson (Google)

unread,
Feb 17, 2010, 9:52:59 AM2/17/10
to google-a...@googlegroups.com
Hi Charles,

You shouldn't need any additional JARs - everything should be included in the SDK.

-Nick Johnson

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.




--
Nick Johnson, Developer Programs Engineer, App Engine
Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047

Charles

unread,
Feb 23, 2010, 11:35:29 AM2/23/10
to Google App Engine
Hi Nick,

Thanks for the reply. As an update to anyone else that hits this,
I've tried this same project on my Mac which has a fresh install of
Eclipse and GAE and it worked as expected, no errors. So, as a
result, I've done a complete re-install of my development environment
(i.e. re-downloaded Eclipse, re-installed GAE plug-in, and even re-
installed JDK) on my Windows machine and it seemed to fix things.
Unfortunately, I still couldn't pinpoint what was causing it, but
refreshing my dev environment worked for me.


Charles


On Feb 17, 6:52 am, "Nick Johnson (Google)" <nick.john...@google.com>
wrote:

> > google-appengi...@googlegroups.com<google-appengine%2Bunsu...@googlegroups.com>

julio.macavilca

unread,
Feb 27, 2010, 10:33:51 PM2/27/10
to Google App Engine
Hi Charles,
I just had the same problem. Having a closer look I noticed that the
problem was the GAE SDK version. To fi the problem install SDK 1.3.1,
It includes a couple of new jars that you may need to add manually
( or regenerate the project ). I did not need to upgrade the pluging.

The new jars are appengine-jsr107cache-1.3.1.jar and
jsr107cache-1.1.jar
More details on http://www.agile-works.com/blog/?p=159

Cheers

Julio C. Macavilca

Paul

unread,
Mar 15, 2010, 3:23:04 PM3/15/10
to Google App Engine
Hi,

I'm getting this error too. I am using 1.3.1 SDK and can see appengine-
jsr107cache-1.3.1.jar and jsr107cache-1.1.jar in the App Engine
classpath container for eclipse, but when I start the test server I
get the following error:

Caused by: net.sf.jsr107cache.CacheException: Could not find class:
'ri.cache.BasicCacheFactory'
at net.sf.jsr107cache.CacheManager.getCacheFactory(CacheManager.java:
46)
...
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:597)
at
com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:
100)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
$7.run(AbstractAutowireCapableBeanFactory.java:1514)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:
1512)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
1468)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1400)
... 30 more

When I try and change the factory class lookup in appengine-web.xml to
the following:

<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/
logging.properties" />
<property name="net.sf.jsr107cache.CacheFactory"
value="com.google.appengine.api.memcache.jsr107cache.GCacheFactory" />
</system-properties>

I get a ClassNotFoundException for GCacheFactory as well.

Does anyone know how to fix this or might it be a case of rebuilding
the workspace like a previous poster has?

Thanks,

Paul.

Niraj Juneja

unread,
Apr 1, 2010, 11:39:24 PM4/1/10
to Google App Engine
+ 1 I am also getting the same problem.

On an existing application with 1.3.2 it works fine. but when I create
a new application on GAE I get this probelem

Reply all
Reply to author
Forward
0 new messages