Skip to main content

(GF3) app client + ejb (1 remote + 1 local ) bean throws SEVERE at deploy

3 replies [Last post]
pablopina
Offline
Joined: 2008-07-13
Points: 0

We are running GF v3.1 b13

In NetBeans 6.9

Create New EAR app
-1 ejb module
-1 app client module

Create a persistence unit
add entities from database jdbc/sample

Create one LocalSessionBean
-@Local interface called LocalSessionLocal
-@PersistenceContext EntityManager em

create one RemoteSessionBean with
-@Remote interface called RemoteSessionRemote
-@PersistenceContext EntityManager em
-@EJB LocalSessionLocal refToLocalBean

Clean and build -> copy the ear and drop it onto the autodeploy directory: DOESN'T WORK, neither does doing it through the web console or through "asadmin deploy"

Now, if you remove the app client module from the ear it does work

INFO: [AutoDeploy] Selecting file D:\gfbuilds\glassfish-3.1-b11-07_18_2010\glassfish\domains\domain1\autodeploy\EnterpriseApplication2.ear for autodeployment.
WARNING: Invalid annotation symbol found for this type of class.
symbol: FIELD
location: javax.persistence.EntityManager sample.ejbs.NewSessionBean.em

WARNING: Invalid annotation symbol found for this type of class.
symbol: FIELD
location: javax.persistence.EntityManager sample.ejbs.OtherSessionBean.em

SEVERE: Exception while deploying the app
java.lang.RuntimeException: Target ejb OtherSessionBean for remote ejb 3.0 reference sample.ejbs.NewSessionBean/other does not expose a remote business interface of type sample.ejbs.OtherSessionBeanLocal

at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:733)
at com.sun.enterprise.deployment.ApplicationClientDescriptor.visit(ApplicationClientDescriptor.java:663)
at com.sun.enterprise.deployment.Application.visit(Application.java:1780)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:790)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:269)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:235)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:152)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:79)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:635)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:577)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:281)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:202)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:332)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:368)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:378)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1070)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:98)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1185)
at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:141)
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:573)
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:459)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:391)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:376)
at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:209)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)

WARNING: [AutoDeploy] Autodeploy failed : D:\gfbuilds\glassfish-3.1-b11-07_18_2010\glassfish\domains\domain1\autodeploy\EnterpriseApplication2.ear.
INFO: [AutoDeploy] Selecting file D:\gfbuilds\glassfish-3.1-b11-07_18_2010\glassfish\domains\domain1\autodeploy\EnterpriseApplication2.ear for autodeployment.
WARNING: Invalid annotation symbol found for this type of class.
symbol: FIELD
location: javax.persistence.EntityManager sample.ejbs.OtherSessionBean.em

WARNING: Invalid annotation symbol found for this type of class.
symbol: FIELD
location: javax.persistence.EntityManager sample.ejbs.NewSessionBean.em

SEVERE: Exception while deploying the app
java.lang.RuntimeException: Target ejb OtherSessionBean for remote ejb 3.0 reference sample.ejbs.NewSessionBean/other does not expose a remote business interface of type sample.ejbs.OtherSessionBeanLocal
at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:733)
at com.sun.enterprise.deployment.ApplicationClientDescriptor.visit(ApplicationClientDescriptor.java:663)
at com.sun.enterprise.deployment.Application.visit(Application.java:1780)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:790)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:269)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:235)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:152)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:79)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:635)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:577)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:281)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:202)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:332)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:368)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:378)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1070)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:98)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1185)
at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:141)
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:573)
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:459)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:391)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:376)
at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:209)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)

WARNING: [AutoDeploy] Autodeploy failed : D:\gfbuilds\glassfish-3.1-b11-07_18_2010\glassfish\domains\domain1\autodeploy\EnterpriseApplication2.ear.

From netbeans does deploy fine

Message was edited by: pablopina

The warnings comes from processing @PersistenceContext EntityManager. The other weired SEVERE error is like if GF thought that just because an EJB has a remote interface, any subsequent call to other ejbs have to be through their respective remote interfaces....

But this abnormal behaviour, does not happen at all while deploying from netbeans...

I find out the problematic file is:
EjbBundleValidator.java

Apparently while processing the EJB annotations in the ejb with remote interface it somehow believes that this @EJB annotation is either on an app client or a santdalone web module

http://fisheye5.atlassian.com/browse/~raw,r=1.26/glassfish/appserv-commo...

Message was edited by: pablopina

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hzhang_jn
Offline
Joined: 2005-07-22
Points: 0

Thanks for attaching the application!

I looked at the packaging and noticed in appclient jar, the manifest has this:
Class-Path: EnterpriseApplication2-ejb.jar

This means the ejb jar is included inside this appclient jar. So when processing the appclient jar, the annotations on the EJB were being processed with the appclient context, therefore causing the validation error.

If the appclient needs to reference the EJB, only the ejb interfaces should be packaged and not the bean class. From the description, the packaging seems to be done by the NB, so this might be a NB packaging issue depending on how you tell the NB to package the app.

Try to correct the packaging of the appclient jar manually and see how things are.

hjcorzoc
Offline
Joined: 2014-02-19
Points: 0

Thanks for the tip, it help me 4 years later!

mich_barsinai
Offline
Joined: 2007-05-07
Points: 0

Thanks for the hint.

I had the exact same problem, and removing the application client form the ear file solved it.

-- Michael