5 Replies Latest reply on May 16, 2009 7:21 PM by Max Tomlinson

    No classes injected for EJBs

    Max Tomlinson Newbie

      I've created an ear project using a jar of components created by another project.
      These classes are instantiated and built on startup.
      The authenticator (pojo) sees the injected components but when I get into my ejb, none of the generated classes are instantiated - everything is null.
      any ideas?
      thanks
      Max

        • 1. Re: No classes injected for EJBs
          Bob Corcoran Newbie

          Could be that the EJB's in question are remote objects (not in your ear), and you haven't added references to them in jboss.xml.

          • 2. Re: No classes injected for EJBs
            Arbi Sookazian Master

            If you are deploying everything into one JBOss instance (i.e. one JVM or process), then there is no need for remote interfaces, local will be fine.


            How are you injecting the EJBs?


            @In(create=true) may be required if there is no @AutoCreate on the components being injected.


            try this:


            @In(create=true)
            FooLocal fooComponentName;



            I haven't actually encountered this scenario so there may be some additional config you must do in application.xml or jboss.xml, etc.

            • 3. Re: No classes injected for EJBs
              Max Tomlinson Newbie

              Hi -
              thanks for the replies-
              I am basically doing the above (@In (create-true) etc. where applicable) or just @in for application scope objects which are created on startup (and they are created). Several of the objects are pojos (application scope) and the rest are ejbs. In my authenticator class they are visible but in my ejb they don't inject and are null even if I try to create-true. The classes that won't inject are in a jar which I exported from another seam project. It has a seam.properties file in it so seam detects that it needs to be loaded and seems to do so fine. I put the jar in my ear and reference it in my application.xml. The components all generate (I can see this on server startup) but won't inject beyond my authenticator class. Weird. I used seam-gen 2.1 to create the project.
              thanks
              Max

              • 4. Re: No classes injected for EJBs
                Arbi Sookazian Master

                have you tried packaging the classes/EJBs in that other JAR into your own build for the EAR, just to trouble-shoot?


                so how is that other JAR deployed?  is everything deployed in server/xxx/deploy directory in JBoss?

                • 5. Re: No classes injected for EJBs
                  Max Tomlinson Newbie

                  The jar is deployed on jboss as:


                  /cps.ear/ myref.jar (the jar under the ear (not exploded) along with application.xml definition)
                            cps.war (exploded)
                            cps.jar (exploded)
                            meta-inf etc. 



                  So I was trying to get this to work with seam 2.1.1 with no luck.
                  I went back and recreated the project with seam 2.0.1 and it works.
                  So I guess I'm staying with 2.0.1 on this.


                  thanks for all the help! I'll post more if I can get it to work with 2.1.1
                  Max