Hi,
Can someone please shed some light on a problem I am having.
Environment:
Eclipse 3.4.1 Java EE
GlassFish v3 (build 47.4)
Glassfish v3 Java EE 6 eclipse plugin
Java jdk 1.6.0_10
These are the steps:
- create a Enterprise application in eclipse calling it whatever you want.
- create an EJB project with corresponding EJB Client JAR module ensuring
you add it to the previously created EAR.
- Add the EJB Client module to the EJB modules projects on the Build Path
- create the following interface class in the src folder of the EJB Client
module
package test;
public interface Test {
void test();
}
- create the following implementation of the interface in the src folder of
the EJB module
package test.impl;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import test.Test;
@Local(Test.class)
@Remote(Test.class)
@Stateless
public class TestBean implements Test {
@Override
public void test() {
}
}
When I deploy the EAR to GF 3 I get the following stack trace:
WARNING: Cannot load test.impl.TestBean reason : test.impl.TestBean
java.lang.ClassNotFoundException: test.impl.TestBean
at
org.glassfish.javaee.full.deployment.EarClassLoader.findClass(EarClassLoader.java:155)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at
com.sun.enterprise.deployment.annotation.impl.ModuleScanner.getElements(ModuleScanner.java:229)
at
com.sun.enterprise.deployment.archivist.Archivist.processAnnotations(Archivist.java:489)
at
com.sun.enterprise.deployment.archivist.Archivist.processAnnotations(Archivist.java:456)
at
com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:382)
at
com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:341)
at
com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:215)
at
com.sun.enterprise.deployment.archivist.ApplicationArchivist.readModulesDescriptors(ApplicationArchivist.java:604)
at
com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:243)
at
org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:106)
at
org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:36)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:547)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:489)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:223)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:172)
at
org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:247)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$4.execute(CommandRunnerImpl.java:419)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:434)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:521)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:137)
at
com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:313)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:180)
at
com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:165)
at
com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:208)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:655)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:905)
at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:161)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
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
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
SEVERE: Exception while deploying the app
java.lang.IllegalArgumentException: Invalid ejb jar [test-EJB.jar]: it
contains zero ejb.
Note:
1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or
message driven bean.
2. EJB3+ entity beans (@Entity) are POJOs and please package them as library
jar.
3. If the jar file contains valid EJBs which are annotated with EJB
component level annotations (@Stateless, @Stateful, @MessageDriven), please
check server.log to see whether the annotations were processed properly.
at
com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:69)
at
com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:77)
at
com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:695)
at com.sun.enterprise.deployment.Application.visit(Application.java:1406)
at
com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:753)
at
com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:252)
at
org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:106)
at
org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:36)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:547)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:489)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:223)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:172)
at
org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:247)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$4.execute(CommandRunnerImpl.java:419)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:434)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:521)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:137)
at
com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:313)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:180)
at
com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:165)
at
com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:208)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:655)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:905)
at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:161)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
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
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Why do I get this ClassNotFoundException?? I get this exception no matter
how I setup the dependencies, checking the box to deploy to lib directory or
not. Am I missing something? Is this how you are supposed to share EJB
client jars in GF with other modules?
Thanks for your help.
--
View this message in context: http://www.nabble.com/Glassfish-v3-preview-deployment-problem-with-Eclipse-3.4-tp25530588p25530588.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.