[jboss-user] [EJB3] - Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties

rosanero4ever do-not-reply at jboss.com
Fri Dec 2 11:30:26 EST 2011


rosanero4ever [http://community.jboss.org/people/rosanero4ever] created the discussion

"Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties"

To view the discussion, visit: http://community.jboss.org/message/639581#639581

--------------------------------------------------------------
I'm using netbeans 7 and JBoss 6 and I'm looking for a solution in these days about the error pasted below when I deploy mi EJB 3 bean using @Resource annotation.
It seems an error caused by a bad position of the jndi.properties in the ear structure. I put this file in the classpath of the project, i.e. the src folder. I also used the conf folder of the ear but the problem still occurs.
I hope anyone can help me to understand the right way.
Thanks in advance


The EJB code (taken from the book "EJB in Action") and the error are the following:



  @Stateless public class PlaceOrderBean implements PlaceOrderBeanLocal
    {


    @Resource(name = "jms/QueueConnectionFactory")
    private ConnectionFactory connectionFactory;  



    private Long bidderId;
    private List();
    }




    private void billOrder(Order order) {
        try {
            Connection connection = connectionFactory.createConnection();
            Session session = connection.createSession(false,
                    Session.AUTO_ACKNOWLEDGE);
            MessageProducer producer = session.createProducer(billingQueue);
            ObjectMessage message = session.createObjectMessage();
            message.setObject(order);
            producer.send(message);
            producer.close();
            session.close();
            connection.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }




    @Remove
    public Long confirmOrder() {
        Order order = new Order();
        order.setBidderId(bidderId);
        order.setItems(items);
        order.setShippingInfo(shippingInfo);
        order.setBillingInfo(billingInfo);
        saveOrder(order);
        billOrder(order);
        return order.getOrderId();
    }



    /* OTHER METHODS */


    }




The error is :



16:03:23,296 ERROR  org.jboss.kernel.plugins.dependency.AbstractKernelController 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)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.lang.Thread.run(Thread.java:722)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 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)  http://community.jboss.org/message/639581#639581#639581/:1.0.0-alpha-15 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.switchboard.mc.resource.provider.ResourceRefResourceProviderDelegator.provide(ResourceRefResourceProviderDelegator.java:44)  http://community.jboss.org/message/639581#639581#639581/:1.0.0-alpha-15 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.switchboard.mc.JndiEnvironmentProcessor.process(JndiEnvironmentProcessor.java:68)  http://community.jboss.org/message/639581#639581#639581/:1.0.0-alpha-15 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.switchboard.mc.deployer.AbstractSwitchBoardDeployer.process(AbstractSwitchBoardDeployer.java:119)  http://community.jboss.org/message/639581#639581#639581/:1.0.0-alpha-15 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.switchboard.mc.deployer.EJBEnvironmentSwitchBoardDeployer.internalDeploy(EJBEnvironmentSwitchBoardDeployer.java:87)  http://community.jboss.org/message/639581#639581#639581/:1.0.0-alpha-15 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 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:968) :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:138)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:246)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90)  http://community.jboss.org/message/639581#639581#639581/:0.2.2 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
              at java.lang.Thread.run(Thread.java:722)  http://community.jboss.org/message/639581#639581#639581/:1.7.0 Error deploying EJB on JBoss 6 using @Resource annotation and jndi.properties
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/639581#639581]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111202/23629e44/attachment-0001.html 


More information about the jboss-user mailing list