Skip to content
This repository

NoClassDefFoundError #51

Closed
Averius opened this Issue · 6 comments

2 participants

Averius Dhanji R. Prasanna
Averius

I followed the Getting Started guide on your Website but I keep getting the following Error:

Jan 10, 2013 1:41:01 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
Jan 10, 2013 1:41:02 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Dimi\workspace\sitebricks\sitebricks\war\WEB-INF/appengine-web.xml
Jan 10, 2013 1:41:02 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:\Users\Dimi\workspace\sitebricks\sitebricks\war\WEB-INF/web.xml
Jan 10, 2013 1:41:02 PM com.google.appengine.tools.development.SystemPropertiesManager setSystemProperties
INFO: Overwriting system property key 'java.util.logging.config.file', value 'C:\Users\Dimi\Documents\Seminar\sitebricks\appengine-java-sdk-1.7.4\config\sdk\logging.properties' with value 'WEB-INF/logging.properties' from 'C:\Users\Dimi\workspace\sitebricks\sitebricks\war\WEB-INF\appengine-web.xml'
Jan 10, 2013 1:41:04 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: jetty-6.1.x
Jan 10, 2013 1:41:12 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed com.google.appengine.tools.development.DevAppEngineWebAppContext@194e059{/,C:\Users\Dimi\workspace\sitebricks\sitebricks\war}: java.lang.NoClassDefFoundError: [Lorg/aopalliance/intercept/MethodInterceptor;
Jan 10, 2013 1:41:12 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed JettyContainerService$ApiProxyHandler@1a83d23: java.lang.NoClassDefFoundError: [Lorg/aopalliance/intercept/MethodInterceptor;
Jan 10, 2013 1:41:12 PM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: Error starting handlers
java.lang.NoClassDefFoundError: [Lorg/aopalliance/intercept/MethodInterceptor;
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMethodsModule.java:81)
at com.google.inject.internal.ProviderMethodsModule.configure(ProviderMethodsModule.java:73)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:232)
at com.google.inject.AbstractModule.install(AbstractModule.java:118)
at com.google.inject.servlet.ServletModule.configure(ServletModule.java:50)
at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.AbstractModule.install(AbstractModule.java:118)
at com.google.sitebricks.SitebricksModule.configure(SitebricksModule.java:72)
at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements.getElements(Elements.java:101)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.sitebricks.example.AppConfig.getInjector(AppConfig.java:11)
at com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:45)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
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:205)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:232)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:157)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:333)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.(DevAppServerMain.java:269)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:245)
Caused by: java.lang.ClassNotFoundException: org.aopalliance.intercept.MethodInterceptor
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:213)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 41 more

Jan 10, 2013 1:41:12 PM com.google.apphosting.utils.jetty.JettyLogger info
INFO: Started SelectChannelConnector@127.0.0.1:8888
Jan 10, 2013 2:41:12 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The server is running at http://localhost:8888/
Jan 10, 2013 2:41:12 PM com.google.appengine.tools.development.DevAppServerImpl start
INFO: The admin console is running at http://localhost:8888/_ah/admin

Did I miss anything or could it be some kind of bug?

Dhanji R. Prasanna
Owner

Are you using maven? This looks like a missing Guice dependency. Also you are running via appengine so please follow the maven + appengine guide:
https://developers.google.com/appengine/docs/java/tools/maven

Averius

I'm using Eclipse with the Google Plugin and used maven only to generate the jars for Sitebricks. Here's a screenshot with all the jars I have in my war/WEB-INF/lib and my Classpath:

debs

I really can't figure out what I'm missing. Thank you for helping me out.

Dhanji R. Prasanna
Owner

You are missing aopalliance.jar from that list. Im not sure how you have generated these libraries in WEB-INF/lib

Try this instead:

git clone git@github.com:dhanji/sitebricks.git
cd sitebricks && mvn clean install && cd ..
cp sitebricks/sitebricks-cloud/src/main/resources/sitebricks.sh /usr/local/bin/sitebricks
mkdir myproject
cd myproject
sitebricks init com.example:myproject:1.0

Everything gets generated. Now run

mvn package
mvn eclipse:eclipse

You will have an eclipse project you can open up and play with. To run the app simply go:

sitebricks run

And visit http://localhost:8080

You can also run via eclipse--right click class com.example.myproject.Main and click Run >
When you add Google Appengine, make sure you add it to the maven pom.xml, the way they say in the appengine documentation.

Note: I am working on automating the google app engine part into pom.xml too (using the sitebricks configurator)

Let me know if these steps work for you.

Dhanji R. Prasanna
Owner

If you get an OutOfMemoryError during the maven build, rerun maven as follows:

MAVEN_OPTS=-XX:MaxPermSize=200m mvn install

This should not happen with newer JDKs.

Averius

Great, that worked! Thank you so much for helping me out and keeping this project alive!

Dhanji R. Prasanna
Owner

No worries! Glad it worked out.

Dhanji R. Prasanna dhanji closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.