0 Replies Latest reply: Aug 13, 2012 12:53 AM by Jervis Liu RSS

Failed to lunch mvn gwt:run. NoClassDefFoundError: com/sun/codemodel/CodeWriter

Jervis Liu Apprentice

Hi, I got a java.lang.NoClassDefFoundError: com/sun/codemodel/CodeWriter when I tried to lunch my project using mvn gwt:run. The project worked last Friday. I checked Errai commit log, didnt find any suspicious commit since last Friday, nor did I find errai is using jaxb-xjc directly anywhere. At this moment I am not quite sure yet if this problem is caused by Errai. Anyway, does this "NoClassDefFoundError: com/sun/codemodel/CodeWriter" error ring a bell to anyone?

 

Thanks,

Jervis

 

The full stack trace:

00:00:04.588 [WARN] failed org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload@74b072ac{/,d:\svn\drools\guvnorng\guvnorng-showcase\src\main\webapp} 

java.lang.NoClassDefFoundError: com/sun/codemodel/CodeWriter
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:390)
     at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
     at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
     at java.lang.Class.getEnclosingMethod0(Native Method)
     at java.lang.Class.getEnclosingMethodInfo(Class.java:929)
     at java.lang.Class.getEnclosingClass(Class.java:1081)
     at java.lang.Class.getSimpleBinaryName(Class.java:1220)
     at java.lang.Class.isMemberClass(Class.java:1210)
     at org.jboss.weld.util.reflection.Reflections.isNonStaticInnerClass(Reflections.java:141)
     at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:78)
     at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:123)
     at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184)
     at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349)
     at org.jboss.errai.container.CDIServletStateListener.contextInitialized(CDIServletStateListener.java:170)
     at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
     at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
     at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
     at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
     at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
     at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:486)
     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
     at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
     at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
     at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
     at org.mortbay.jetty.Server.doStart(Server.java:222)
     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
     at org.jboss.errai.cdi.server.gwt.JettyLauncher.start(JettyLauncher.java:692)
     at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
     at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
     at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
     at com.google.gwt.dev.DevMode.main(DevMode.java:311)
Caused by: java.lang.ClassNotFoundException: com.sun.codemodel.CodeWriter
     at java.lang.ClassLoader.findClass(ClassLoader.java:358)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:352)
     at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:390)
     at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
     at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
     at java.lang.Class.getEnclosingMethod0(Native Method)
     at java.lang.Class.getEnclosingMethodInfo(Class.java:929)
     at java.lang.Class.getEnclosingClass(Class.java:1081)
     at java.lang.Class.getSimpleBinaryName(Class.java:1220)
     at java.lang.Class.isMemberClass(Class.java:1210)
     at org.jboss.weld.util.reflection.Reflections.isNonStaticInnerClass(Reflections.java:141)
     at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:78)
     at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:123)
     at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184)
     at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349)
     at org.jboss.errai.container.CDIServletStateListener.contextInitialized(CDIServletStateListener.java:170)
     at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:543)
     at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
     at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
     at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
     at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
     at org.jboss.errai.cdi.server.gwt.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:486)
     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
     at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
     at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
     at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
     at org.mortbay.jetty.Server.doStart(Server.java:222)
     at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
     at org.jboss.errai.cdi.server.gwt.JettyLauncher.start(JettyLauncher.java:692)
     at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
     at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
     at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
     at com.google.gwt.dev.DevMode.main(DevMode.java:311)