File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes problem with deploying EJB project using Eclipse and JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "problem with deploying EJB project using Eclipse and JBOSS" Watch "problem with deploying EJB project using Eclipse and JBOSS" New topic
Author

problem with deploying EJB project using Eclipse and JBOSS

Steve Nelligan
Greenhorn

Joined: Nov 09, 2010
Posts: 10



I am trying to learn JavA EE and purchased a course "Java EE: EJB 3.0 and Java Persistence" from Learn NowJava.com.

I'm doing fine until the end of module 5, where I start getting an error when starting JBOSS:

10:52:03,113 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console
10:52:03,902 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJB_EAR_Project.ear/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error deploying Simple_EJB_Project.jar: Container jboss.j2ee:ear=EJB_EAR_Project.ear,jar=Simple_EJB_Project.jar,name=Teller,service=EJB3 failed to resolve persistence unit BankAccountJPA
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:201)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:103)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
at org.jboss.Main.boot(Main.java:209)
at org.jboss.Main$1.run(Main.java:547)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Container jboss.j2ee:ear=EJB_EAR_Project.ear,jar=Simple_EJB_Project.jar,name=Teller,service=EJB3 failed to resolve persistence unit BankAccountJPA
at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:135)
at org.jboss.injection.PersistenceContextHandler.loadXml(PersistenceContextHandler.java:76)
at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:588)
at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:415)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:523)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:194)
... 23 more
Caused by: java.lang.IllegalArgumentException: Can't find a persistence unit named 'BankAccountJPA' in AbstractVFSDeploymentContext@1649490869{vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJB_EAR_Project.ear/Simple_EJB_Project.jar/}
at org.jboss.jpa.resolvers.BasePersistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(BasePersistenceUnitDependencyResolver.java:107)
at org.jboss.ejb3.Ejb3Deployment.resolvePersistenceUnitSupplier(Ejb3Deployment.java:720)
at org.jboss.ejb3.EJBContainer.resolvePersistenceUnitSupplier(EJBContainer.java:1428)
at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:130)
... 28 more
10:52:03,921 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS IN ERROR:
Deployment "vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJB_EAR_Project.ear/" is in error due to the following reason(s): java.lang.IllegalArgumentException: Can't find a persistence unit named 'BankAccountJPA' in AbstractVFSDeploymentContext@1649490869{vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJB_EAR_Project.ear/Simple_EJB_Project.jar/}

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I am using Eclipse Indigo Service Release 2 Build id: 20120216-1857; which appears to be slightly different from the one in the course.
I have been able to translate the minor differences.

I believe that this is my problem:
Course:
Properties for Simple_EJB_Project
---> Java EE Module Dependencies
Click on "BankAccountJPA"
Shows only 1 warning on bottom of screen (no detail show in video)

My IDE:
Properties for simple_EJB_Project
(THERE IS NO "Java EE Module Dependencies")
---> Java Build Path
"Projects" Tab
Added "BankAccountJPA"


The Class "BankAccount" can now be imported in the source "Teller.java"

Shows 4 warning on bottom of screen

Description Resource Path Location Type
Classpath entry /BankAccountJPA will not be exported or published. Runtime ClassNotFoundExceptions may result. Simple_EJB_Project P/Simple_EJB_Project Classpath Dependency Validator Message
Classpath entry /Simple_EJB_ProjectClient will not be exported or published. Runtime ClassNotFoundExceptions may result. SimpleWebClient P/SimpleWebClient Classpath Dependency Validator Message
Classpath entry /Simple_EJB_ProjectClient will not be exported or published. Runtime ClassNotFoundExceptions may result. Simple_EJB_Project P/Simple_EJB_Project Classpath Dependency Validator Message
No connection specified for project. No database-specific validation will be performed. BankAccountJPA JPA Problem



I believe the problem is related to the warning messages above.

How to I correct the project so that the above warning are fixed and hopefully the starting of JBOSS?

Any direction would be appreciated.




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with deploying EJB project using Eclipse and JBOSS
 
Similar Threads
RuntimeException when calling the local interface of session bean from servlet code
RuntimeException while trying to call the local interface of session bean from servlet
Migrate deployment causing errors
RuntimeException when trying to deploy application using jboss
Problem of dependency injection in jboss