4 Replies Latest reply on Jul 28, 2009 1:44 PM by loren_

    Unresolved references exist in JBossWebMetaData

    loren_

      I'm porting a working app from glassfish to jboss-5.1.0.GA, but I can't seem to get injection to work in my web application. I'm deploying the ejb separate from the war, and it deploys without error and tells that it's bound to the following names:

      2009-07-23 16:06:37,033 INFO [org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] (HDScanner) Binding the following Entries in Global JNDI:

      NewtDao/local - EJB3.x Default Local Business Interface
      NewtDao/local-com.corenap.newtDAO.NewtDaoLocal - EJB3.x Local Business Interface


      Then when I try to deploy my web app I get the following message:
      2009-07-23 16:06:52,906 WARN [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (HDScanner) Unresolved references exist in JBossWebMetaData:[#web-app:AnnotatedEJBReferenceMetaData{name=com.coren
      ap.newt.Application/facade,ejb-ref-type=null,link=null,ignore-dependecy=false,mapped/jndi-name=NewtDao,resolved-jndi-name=null,beanInterface=interface com.corenap.newtDAO.NewtDaoRemote}]
      2009-07-23 16:06:52,906 INFO [org.jboss.ejb3.deployers.Ejb3DependenciesDeployer] (HDScanner) Encountered deployment AbstractVFSDeploymentContext@18169044{vfszip:/usr/local/jboss-5.1.0.GA/server/default/depl
      oy/Newt_1.1.war/}

      everything goes to hell in a hand basket after that, which makes sense if it can't talk to the ejb.

      I'm injecting it like so:

      public class Application extends WebApplication {

      @EJB(mappedName = "NewtDao")
      public static NewtDaoRemote facade;
      ...

      and the bean itself is declared like so:
      @Stateless(name = "NewtDao")
      @Local(NewtDaoLocal.class)
      @TransactionManagement(TransactionManagementType.CONTAINER)
      @DeclareRoles({"BasicSuperUser", "Provisioner", "FacilityAdmin"})
      public class NewtDaoBean implements NewtDaoLocal{
      ....

      Any ideas as to what I'm doing wrong?

        • 1. Re: Unresolved references exist in JBossWebMetaData
          jaikiran

           

          @EJB(mappedName = "NewtDao")
          public static NewtDaoRemote facade;


          What is NewtDaoRemote? I don't see it being mapped as a remote interface for the bean and neither do i see the JNDI binding for that.

          If it was the local interface, here's what you would do to inject it:

          @EJB(mappedName = "NewtDao/local")
          public NewtDaoLocal facade;


          • 2. Re: Unresolved references exist in JBossWebMetaData
            loren_

             

            What is NewtDaoRemote? I don't see it being mapped as a remote interface for the bean and neither do i see the JNDI binding for that.

            If it was the local interface, here's what you would do to inject it:

            @EJB(mappedName = "NewtDao/local")
            public NewtDaoLocal facade;


            Doh! I've been trying this every which way and posted mismatched code. Unfortunately I get the same error when I use the correct interface:

            2009-07-24 14:12:45,403 WARN [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (HDScanner) Unresolved references exist in JBossWebMetaData:[#web-app:AnnotatedEJBReferenceMetaData{name=com.corenap.newt.Application/facade,ejb-ref-type=null,link=null,ignore-dependecy=false,mapped/jndi-name=NewtDao/local,resolved-jndi-name=null,beanInterface=interface com.corenap.newtDAO.NewtDaoLocal}]

            If I specify nothing at all in @EJB it spits out this:
            2009-07-24 13:43:07,609 WARN [org.jboss.deployment.MappedReferenceMetaDataResolverDeployer] (HDScanner) Unresolved references exist in JBossWebMetaData:[#web-app:AnnotatedEJBReferenceMetaData{name=com.coren
            ap.newt.Application/facade,ejb-ref-type=null,link=null,ignore-dependecy=false,mapped/jndi-name=null,resolved-jndi-name=null,beanInterface=interface com.corenap.newtDAO.NewtDaoLocal}]
            2009-07-24 13:43:07,651 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) deploy, ctxPath=/NewtJboss
            2009-07-24 13:43:07,663 WARN [org.jboss.web.tomcat.service.injection.WebEJBRemoteHandler] (HDScanner) EJBTHREE-1289: Using legacy EjbEncInjector, because mappedName for enc "env/com.corenap.newt.Application
            /facade", field "null" is null (container.environmentRefGroup.annotatedEjbReferences = [AnnotatedEJBReferenceMetaData{name=com.corenap.newt.Application/facade,ejb-ref-type=null,link=null,ignore-dependecy=fal
            se,mapped/jndi-name=null,resolved-jndi-name=null,beanInterface=interface com.corenap.newtDAO.NewtDaoLocal}])
            2009-07-24 13:43:07,670 ERROR [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) ENC setup failed
            java.lang.IllegalStateException: Resolution should not happen via injection container

            I am using Wicket, and their javaee library is a bit of a bastard child, but it works without a hitch in Glassfish (though gf certainly has other faults). I did need to copy their ioc jars to server/default/lib/ before JBoss would successfully deploy a wicket war with ejb3 annotations. But because of the unresolved reference it still throws exceptions as soon as it trys to invoke an EJB.

            I'm about ready to give up on JBoss all together, any help would be greatly appreciated.


            • 3. Re: Unresolved references exist in JBossWebMetaData
              jaikiran

               

              I'm deploying the ejb separate from the war, and it deploys without error
              ...

              Then when I try to deploy my web app I get the following message:


              I should have read this earlier. If the EJB jar and the WAR are not part of the same application then the injection is not supported https://jira.jboss.org/jira/browse/JBAS-6332

              • 4. Re: Unresolved references exist in JBossWebMetaData
                loren_

                doh. I had just assumed that was fixed in 5.1. Thanks for your time.

                And if anyone is wondering, injection works fine with wicket and jboss 5.1.