ClassNotFoundException: ObjectifyFilter when testing GAE Project locally

103 views
Skip to first unread message

xgeoff

unread,
Sep 28, 2016, 12:46:38 PM9/28/16
to objectify-appengine

I keep getting a ClassNotFoundException when running my GAE project locally. I've seen people on StackOverflow with the same issue and the recommendation is to manually put the Objectify .jar file in the /lib folder underneath /web-inf but it doesn't make sense to me that this should be necessary.


I am trying to start the server from the command line and the terminal output is below. My project doesn't even have a /lib folder under /web-inf but the project correctly identifies all of the dependencies, including Objectify, when I look at the project in Netbeans.


If anyone has any suggestions on how to troubleshoot this or if someone can explain why I should have to manually copy dependencies, I'd appreciate it.


dev_appserver.sh ./src/main/webapp

Executing [/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/bin/java, -XstartOnFirstThread, -javaagent:/Users/gporemba/GoogleDev/appengine-java-sdk-1.9.42/lib/agent/appengine-agent.jar, -Xbootclasspath/p:/Users/gporemba/GoogleDev/appengine-java-sdk-1.9.42/lib/override/appengine-dev-jdk-overrides.jar, -classpath, /Users/gporemba/GoogleDev/appengine-java-sdk-1.9.42/lib/appengine-tools-api.jar, com.google.appengine.tools.development.DevAppServerMain, --property=kickstart.user.dir=/Users/gporemba/Documents/workspace/draft-players-api-new, /Users/gporemba/Documents/workspace/draft-players-api-new/./src/main/webapp]

objc
[2526]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.

Sep 28, 2016 7:39:56 AM com.google.apphosting.utils.jetty.JettyLogger info

INFO
: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger

Sep 28, 2016 2:39:56 PM com.google.apphosting.utils.jetty.JettyLogger info

INFO
: jetty-6.1.x

Sep 28, 2016 2:39:56 PM com.google.apphosting.utils.jetty.JettyLogger warn

WARNING
: EXCEPTION  

java
.lang.ClassNotFoundException: com.googlecode.objectify.ObjectifyFilter

 at java
.net.URLClassLoader$1.run(URLClassLoader.java:366)

 at java
.net.URLClassLoader$1.run(URLClassLoader.java:355)

 at java
.security.AccessController.doPrivileged(Native Method)

 at java
.net.URLClassLoader.findClass(URLClassLoader.java:354)

 at java
.lang.ClassLoader.loadClass(ClassLoader.java:425)

 at com
.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:198)

 at java
.lang.ClassLoader.loadClass(ClassLoader.java:358)

 at org
.mortbay.util.Loader.loadClass(Loader.java:91)

 at org
.mortbay.util.Loader.loadClass(Loader.java:71)

 at org
.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)

 at org
.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:81)

 at org
.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

 at org
.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)

 at org
.mortbay.jetty.servlet.Context.startContext(Context.java:140)

 at org
.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)

 at org
.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)

 at org
.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)

 at org
.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

 at org
.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

 at org
.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

 at org
.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)

 at org
.mortbay.jetty.Server.doStart(Server.java:224)

 at org
.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

 at com
.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:271)

 at com
.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:284)

 at com
.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)

 at com
.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:87)

 at com
.google.appengine.tools.development.Modules.startup(Modules.java:105)

 at com
.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:262)

 at com
.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:45)

 at com
.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:217)

 at com
.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:215)

 at java
.security.AccessController.doPrivileged(Native Method)

 at com
.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:215)

 at com
.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:277)

 at com
.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)

 at com
.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:225)

 at com
.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:216)

Sep 28, 2016 2:39:56 PM com.google.apphosting.utils.jetty.JettyLogger warn

WARNING
: failed ObjectifyFilter: javax.servlet.UnavailableException: com.googlecode.objectify.ObjectifyFilter

Sep 28, 2016 2:39:56 PM com.google.apphosting.utils.jetty.JettyLogger warn

WARNING
: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@4bf42872{/,/Users/gporemba/Documents/workspace/draft-players-api-new/src/main/webapp}


Jeff Schnitzer

unread,
Oct 9, 2016, 7:01:11 PM10/9/16
to objectify-appengine
How do you expect the objectify jar to get on the classpath with your code?

Generally I use maven to manage dependencies, so ‘mvn appengine:run’ takes care of making sure everything is on the path that should be. If you want to run dev_appserver.sh then it needs access to all of the jars and class files that you use. That probably means copying the files into your WEB-INF/lib.

I would recommend using maven to manage dependencies for your project, then using your IDE to run the dev server. That way you can run it in debug mode if you want.

Jeff

--
You received this message because you are subscribed to the Google Groups "objectify-appengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appengine+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages