Rosanero4Ever (3) [Avatar] Offline
#1
Hi all,

I'm bought the EJB 3 in Action book and I'm reading the second chapter. I'm using, for my exercises, Netbeans 7 and JBoss 6. Source code for JBoss 4 provided by the authors doesn't work in JBoss6. So I'm reengineering the code for Jboss6.
But the following error occurs using @Resource annotation smilie

16:03:23,296 ERROR org.jboss.kernel.plugins.dependency.AbstractKernelController Error


installing to Real: name=vfs:///D:/jboss6/server/default/deploy/prova2.ear state=PreReal mode=Manual requiredState=Real: org.jboss.deployers.spi.DeploymentException: Error during deploy: org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.PlaceOrderBean
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:185) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) :2.2.0.GA
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) jboss-dependency.jar:2.2.0.GA
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) jboss-dependency.jar:2.2.0.GA
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) jboss-dependency.jar:2.2.0.GA
at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) jboss-dependency.jar:2.2.0.GA
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) jboss-dependency.jar:2.2.0.GA
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) jboss-dependency.jar:2.2.0.GA
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) jboss-dependency.jar:2.2.0.GA
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) jboss-dependency.jar:2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) :2.2.0.GA
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) :2.2.0.GA
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) :6.0.0.Final
at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:17smilie Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:17smilie Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.lang.Thread.run(Thread.java:722) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
Caused by: java.lang.RuntimeException: Neither any mapped-name/lookup/jndi-name specified nor any ResourceProvider could process resource-ref named env/jms/QueueConnectionFactory of type javax.jms.ConnectionFactory
at org.jboss.switchboard.mc.resource.provider.ResourceRefResourceProviderDelegator.provide(ResourceRefResourceProviderDelegator.java:125) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.switchboard.mc.resource.provider.ResourceRefResourceProviderDelegator.provide(ResourceRefResourceProviderDelegator.java:44) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.switchboard.mc.JndiEnvironmentProcessor.process(JndiEnvironmentProcessor.java:6smilie Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.switchboard.mc.deployer.AbstractSwitchBoardDeployer.process(AbstractSwitchBoardDeployer.java:119) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.switchboard.mc.deployer.EJBEnvironmentSwitchBoardDeployer.internalDeploy(EJBEnvironmentSwitchBoardDeployer.java:87) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) :2.2.0.GA
... 38 more

16:03:23,484 WARN org.jboss.profileservice.deployment.hotdeploy.HDScanner Scan failed: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):


DEPLOYMENTS IN ERROR: Name -> Error

vfs:///D:/jboss6/server/default/deploy/prova2.ear -> org.jboss.deployers.spi.DeploymentException: Error during deploy: org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData.PlaceOrderBean


DEPLOYMENTS IN ERROR:
Deployment "vfs:///D:/jboss6/server/default/deploy/prova2.ear" is in error due to the following reason(s): java.lang.RuntimeException: Neither any mapped-name/lookup/jndi-name specified nor any ResourceProvider could process resource-ref named env/jms/QueueConnectionFactory of type javax.jms.ConnectionFactory

at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) :2.2.0.GA
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) :2.2.0.GA
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:96smilie :2.2.0.GA
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) :6.0.0.Final
at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:13smilie Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:246) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:17smilie Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:17smilie Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
at java.lang.Thread.run(Thread.java:722) Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties

Shall I edit or add some xml file? It seems a problem caused by the bad position of the kndi file, but I put it in the classpath of the application (i.e. the src folder)
I hope somebody can help me!
Thanks in advance