Fail on deploy project with persistence unit
jotremar Aug 5, 2010 11:25 AMWhen i try to deploy my project i have this error:
16:48:58,194 INFO [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/admin-console'
16:49:01,447 INFO [TomcatDeployment] deploy, ctxPath=/
16:49:01,509 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console
16:49:01,605 ERROR [Ejb3Deployment] Exception while processing container metadata for EJB: prueba in unit: pruebajpa-ejb.jar
16:49:01,606 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/E:/jboss/server/default/deploy/pruebajpa.ear/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error deploying pruebajpa-ejb.jar: Exception while processing container metadata for EJB: prueba in unit: pruebajpa-ejb.jar
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:99)
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:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
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:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
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.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.Exception: Exception while processing container metadata for EJB: prueba in unit: pruebajpa-ejb.jar
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:549)
at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:189)
... 34 more
Caused by: java.lang.RuntimeException: <injection-target> could not be found: ejb.prueba.pruebajpa-ejbPU
at org.jboss.injection.InjectionUtil.findInjectionTarget(InjectionUtil.java:223)
at org.jboss.injection.InjectionUtil.injectionTarget(InjectionUtil.java:299)
at org.jboss.injection.PersistenceContextHandler.loadXml(PersistenceContextHandler.java:64)
at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:588)
at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:418)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:527)
... 35 more
16:49:01,940 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):DEPLOYMENTS IN ERROR:
Deployment "vfszip:/E:/jboss/server/default/deploy/pruebajpa.ear/" is in error due to the following reason(s): java.lang.RuntimeException: <injection-target> could not be found: ejb.prueba.pruebajpa-ejbPU16:49:01,954 INFO [Http11Protocol] Arrancando Coyote HTTP/1.1 en puerto http-127.0.0.1-8080
16:49:01,979 INFO [AjpProtocol] Arrancando Coyote AJP/1.3 en ajp-127.0.0.1-8009
16:49:02,404 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 46s:293ms
Files of this project:
jboss-ds.xml
<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>pruebaDB</jndi-name> <connection-url>jdbc:mysql://localhost:3306/test</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>root</user-name> <password>root</password> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>5</idle-timeout-minutes> </local-tx-datasource> </datasources>
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="pruebajpa-ejbPU" transaction-type="JTA"> <jta-data-source>java:/pruebaDB</jta-data-source> </persistence-unit> </persistence>
EM-EJB:
@Stateful public class prueba implements pruebaLocal { @PersistenceContext(name="pruebajpa-ejbPU") private EntityManager em; public int fila() { Query consulta = em.createNamedQuery("Zona.findAll"); return ((Zona)(consulta.getResultList().get(1))).getPresupuestoMes(); //return 0; } // Add business logic below. (Right-click in editor and choose // "Insert Code > Add Business Method") }
In rar file: DB backup and project by Netbeans.
I need more config files for it work?
-
pruebajpa.rar.zip 47.1 KB