Hi guys,
I'm trying to deploy a sample Java EE 6, multi-project application on GlassFish v3 using the Eclipse 3.6 plugin. Current workspace contains the following projects:
/core
/user
/web
where /core and /user are standard Java projects and /web is a web application project. /user depends on /core, /web depends on /core and /user.
/user contains @Local UserService and @Stateless UserServiceImpl implements UserService. /web contains @ManagedBean LoginController with a reference to @Inject UserService. /user and /web both contain the CDI-required beans.xml file.
Using m2eclipse 0.10.x to manage dependencies, this may be an issue.
When deploying to GlassFish, I receive the following stack trace:
[code]
GRAVE: Exception while loading the app
org.glassfish.deployment.common.DeploymentException: java.lang.NoClassDefFoundError: Lcom/gb1/x01/user/UserService;
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:167)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:125)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:224)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.google.common.collect.ComputationException: java.lang.NoClassDefFoundError: Lcom/gb1/x01/user/UserService;
at com.google.common.collect.MapMaker$StrategyImpl.compute(MapMaker.java:602)
at com.google.common.collect.MapMaker$StrategyImpl.compute(MapMaker.java:462)
at com.google.common.collect.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2045)
at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:164)
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:61)
at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:88)
at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:134)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:377)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:165)
... 30 more
Caused by: java.lang.NoClassDefFoundError: Lcom/gb1/x01/user/UserService;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:115)
at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:111)
at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:67)
at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:110)
at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:177)
at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:140)
at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:50)
at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:38)
at com.google.common.collect.MapMaker$StrategyImpl.compute(MapMaker.java:592)
... 38 more
Caused by: java.lang.ClassNotFoundException: com.gb1.x01.user.UserService
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 org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:959)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 51 more
[/code]
Any idea why at runtime /web cannot resolve this dependency to a /user class?
Thanks,
GB
[Message sent by forum member 'gbilodeau']
http://forums.java.net/jive/thread.jspa?messageID=477579