Reputation: 1
I have trouble migrating an EJB with SOAP webservices and included JARS from Glassfish 2.1 to Glassfish 4.0. At the same time I changed my OS (XP->Windows 7) and netbeans version 7.3 to 7.4. The Glassfish 4.0 is a cluster with 2 instances.
I created new packages with the use of the sources. The used jars are included as libraries (like in GF 2.0). The EJB builds fine, but when I deploy I get these errors.
[2014-05-07T11:05:36.974+0200] [glassfish 4.0] [SEVERE] [] [global] [tid: _ThreadID=208 _ThreadName=admin-listener(13)] [timeMillis: 1399453536974] [levelValue: 1000] [[
Class [ nl/amnesty/sys/webform/entity/Form ] not found. Error while loading [ class nl.amnesty.webservice.form.FormExternal ]]]
[2014-05-07T11:05:36.975+0200] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=208 _ThreadName=admin-listener(13)] [timeMillis: 1399453536975] [levelValue: 1000] [[
Exception while deploying the app [CRMWebserviceForm]]]
[2014-05-07T11:05:36.976+0200] [glassfish 4.0] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=208 _ThreadName=admin-listener(13)] [timeMillis: 1399453536976] [levelValue: 1000] [[
Exception during lifecycle processing
java.lang.IllegalArgumentException: Invalid ejb jar CRMWebserviceForm: it contains zero ejb. A valid ejb jar requires at least one session/entity/message driven bean.
at org.glassfish.ejb.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:147)
at org.glassfish.ejb.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:112)
at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:621)
at org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl.visit(EjbBundleDescriptorImpl.java:757)
at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:116)
at com.sun.enterprise.deployment.BundleDescriptor.visit(BundleDescriptor.java:621)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:190)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:198)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:222)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:96)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:878)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:818)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:374)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:724)
]]
[2014-05-07T11:05:36.979+0200] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=208 _ThreadName=admin-listener(13)] [timeMillis: 1399453536979] [levelValue: 1000] [[
Exception while deploying the app [CRMWebserviceForm] : Invalid ejb jar CRMWebserviceForm: it contains zero ejb. A valid ejb jar requires at least one session/entity/message driven bean.]]
A part of the EJB:
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
@WebService
@Stateless
public class FormExternal {
@WebMethod(operationName = "submitform")
public long submitform(@WebParam(name = "form") Form form) {
CRMWebformController.processForm(form);
return form.getSubmissionid();
}
}
Here some information on how the jar libraries are included.
- CRMWebserviceForm
+ Source packages
+ Test packages
- Libraries
- NLAmestyCRM - dist/NLAmnestyCRM.jar
- ...
- NLAmnestyWEBFORM - dist/NLAmnestyWEBFORM.jar
+ JDK 1.7 (default)
+ Cluster (glassfish)
In the EJB properties (libraries) they are selected to be required at runtime. The libraries folder I added later and by "mistake". It is .\lib\nblibraries.properties and did not make any difference. To be more precise I added that value at EJB properties "Library folder" by hitting "browse" but did not add anything to that folder.
The packaging-option "Package required JARS in EJB jar" is selected.
Run: Java EE version is Java EE5. Is that compatible with platform JDK 1.7?
Any help is appreciated.
[Edit: some code added] [Edit: library information added]
Upvotes: 0
Views: 496
Reputation: 13857
The problems are related. Because the class nl.amnesty.sys.webform.entity.Form
can't be found, the EJB(s) which use(s) this class can't be loaded, therefore you get the message:
java.lang.IllegalArgumentException: Invalid ejb jar CRMWebserviceForm: it contains
zero ejb. A valid ejb jar requires at least one session/entity/message driven bean.
You have to make sure that the class is packaged with your web application or available in the lib
folder of your GlassFish installation so that it can be loaded by the server.
I don't know how you are packaging you application but if you can't get it to work, maybe some information about that is helpful.
Upvotes: 0