1 2 Previous Next 17 Replies Latest reply on Apr 19, 2011 11:06 AM by wolfgangknauf

    AS7: "IllegalArgumentException: key is null"

    wolfgangknauf

      Hi to the JBoss gurus!

       

      I don't know whether this is the right place, but I did not want to spam the AS7 devel forum, so I try it here ;-):

       

      I picked AS7 from git today and tried to deploy a simple JavaEE5 EAR with one stateless bean and web and app client.

       

      Using the version which uses only annotations, I found that injection of an EJB will not work in a JSP (worked in AS5). Is this a "work to be done" feature or is it worth a bug report?

       

      Second problem: I have the same sample without annotations, just deployment descriptors. Here I saw this error on deploy:

       

      23:12:28,258 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."Stateless.ear"."StatelessWeb.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."Stateless.ear"."StatelessWeb.war".INSTALL: Failed to process phase INSTALL of subdeployment "StatelessWeb.war" of deployment "Stateless.ear"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:108)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1344)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

      Caused by: java.lang.IllegalArgumentException: key is null

          at org.jboss.msc.service.UnlockedReadHashMap.put(UnlockedReadHashMap.java:230)

          at org.jboss.msc.service.ServiceContainerImpl.getOrCreateRegistration(ServiceContainerImpl.java:431)

          at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:499)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:188)

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:1808)

          at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:310)

          at org.jboss.as.ee.component.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:83)

          at org.jboss.as.ee.component.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:51)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:102)

          ... 4 more

       

      How shall I continue with such problems ;-)?

       

      The samples can be found here:

      -sample with annotations: http://www.cs.hs-rm.de/~knauf/KomponentenArchitekturen2008/stateless/Stateless.ear

      -sample without annotations, but deployment descriptors: http://www.cs.hs-rm.de/~knauf/KomponentenArchitekturen2008/stateless/StatelessNoAnnotation.ear

       

      Best regards

       

      Wolfgang

        • 1. AS7: "IllegalArgumentException: key is null"
          jaikiran

          This appears to be a bug. Can you file a JBAS JIRA please?

           

           

          Wolfgang Knauf wrote:

           

          Hi to the JBoss gurus!

           

          I don't know whether this is the right place, but I did not want to spam the AS7 devel forum, so I try it here ;-):

           

          You can even try the as7-dev mailing list https://lists.jboss.org/mailman/listinfo/jboss-as7-dev (since it's in development stages, I believe it's OK to post these issues in that list for now).

           

           

          Wolfgang Knauf wrote:

           

          How shall I continue with such problems ;-)?

           

          Either the mailing list or even the #jboss-as7 IRC channel (irc.freenode.net server) is where you can ping us with such issues.

          • 2. AS7: "IllegalArgumentException: key is null"
            wolfgangknauf

            Thanks!

             

            Issue filed: https://issues.jboss.org/browse/JBAS-9261

             

            I will try to find more useful information in the server.log for the EJB injection problem and will come back with it later.

             

            Best regards

             

            Wolfgang

            • 3. Re: AS7: "IllegalArgumentException: key is null"
              shelly.mcgowan

              I encounter the same issue deploying my .war.  In my case, I have a datasource defined in my web.xml

               

              <resource-ref>

                  <res-ref-name>jdbc/MyDB</res-ref-name>

                  <res-type>javax.sql.DataSource</res-type>

                  <res-auth>Container</res-auth>

                  <res-sharing-scope>Shareable</res-sharing-scope>

                </resource-ref>

               

               

              in my jboss-web.xml, this:

              <resource-ref>

                  <res-ref-name>jdbc/MyDB</res-ref-name>

                  <jndi-name>jdbc/MyDB</jndi-name>

              </resource-ref>

               

              If I change the jndi-name in jboss-web.xml to java:/MyDB (along with the datasource configuration in standalone.xml) deploys and runs fine.

               

              <resource-ref>

                  <res-ref-name>jdbc/MyDB</res-ref-name>

                  <jndi-name>java:/MyDB</jndi-name>

              </resource-ref>

               

              To give you an indication of where you might start looking (e.g., @EJB beanName, lookup definitions).   Note also JBAS-9224 , targeted for Beta3 is intended to address issues such as these.    

              • 4. AS7: "IllegalArgumentException: key is null"
                wolfgangknauf

                Now I took a look at my other deployment problem: I see a "Stateless.ear.failed" file with this content:

                 

                "Failed to execute deployment operation in allowed timeout [60]"

                 

                The server.log contains only success messages:

                21:58:09,578 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "Stateless.ear"

                21:58:09,609 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "StatelessEJB.jar"

                21:58:09,609 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "StatelessWeb.war"

                21:58:10,078 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Completed deployment of "StatelessEJB.jar" in 464 ms

                21:58:10,281 INFO  [org.jboss.web] (MSC service thread 1-1) registering web context: /StatelessWeb

                 

                But at least the JSP page of the web project is working - just EJB injection did not happen...

                 

                One more JIRA ;-)?

                • 5. AS7: "IllegalArgumentException: key is null"
                  wolfgangknauf

                  Shelly, my sample has a stateless bean bound to a different JNDI name:

                   

                  jboss.xml of ejb jar:

                      <enterprise-beans>

                          <session>

                              <ejb-name>GeometricModelBean</ejb-name>

                              <jndi-name>Keks</jndi-name>

                              <local-jndi-name>KeksLocal</local-jndi-name>

                          </session>

                      </enterprise-beans>

                   

                  and the web project references it:

                  <jboss-web>

                      ...

                      <ejb-ref>

                          <ejb-ref-name>ejb/GeometricModel</ejb-ref-name>

                          <jndi-name>Keks</jndi-name>

                      </ejb-ref>

                   

                      <ejb-local-ref>

                          <ejb-ref-name>ejb/GeometricModelLocal</ejb-ref-name>

                          <local-jndi-name>KeksLocal</local-jndi-name>

                      </ejb-local-ref>

                  </jboss-web>

                   

                  my web.xml:

                   

                      <ejb-ref>

                          <ejb-ref-name>ejb/GeometricModel</ejb-ref-name>

                          <ejb-ref-type>Session</ejb-ref-type>

                          <remote>de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelRemote</remote>

                          <injection-target>

                              <injection-target-class>de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelServlet</injection-target-class>

                              <injection-target-name>geometricModel</injection-target-name>

                          </injection-target>

                      </ejb-ref>

                      <ejb-local-ref>

                          <ejb-ref-name>ejb/GeometricModelLocal</ejb-ref-name>

                          <ejb-ref-type>Session</ejb-ref-type>

                          <local>de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelLocal</local>

                          <injection-target>

                              <injection-target-class>de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelServlet</injection-target-class>

                              <injection-target-name>geometricModelLocal</injection-target-name>

                          </injection-target>

                   

                  Is this related to your situation?

                   

                  So I removed jboss.xml and jboss-web.xml, and now I see the same timeout as seen above with my first sample ;-)

                   

                  Best regards

                   

                  Wolfgang

                  • 6. AS7: "IllegalArgumentException: key is null"
                    shelly.mcgowan

                    Can't say for sure.  I've downloaded the sample apps from the JBAS-9261 and will test them later on to see what's going on.

                    • 7. AS7: "IllegalArgumentException: key is null"
                      shelly.mcgowan

                      Deploying StatelessNoAnnotation.ear results in missing dependencies for the ejb-refs.  So does seem similar to my issue with resource ref and variant of JBAS-9224.  

                      22:20:06,861 ERROR [org.jboss.as] (MSC service thread 1-6) JBoss AS 7.0.0.Beta3-SNAPSHOT "TBD" started (with errors) in 2400ms - Started 550 of 584 services (2 services failed or missing dependencies, 32 services are passive or on-demand)

                          Services missing dependencies:

                              service jboss.naming.context.java.module.Stateless.StatelessWeb."env/de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelServlet/geometricModel"

                              service jboss.naming.context.java.module.Stateless.StatelessWeb."env/de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelServlet/geometricModelLocal"

                      • 8. AS7: "IllegalArgumentException: key is null"
                        jaikiran

                        I'll take a look at this one, tonight.

                        • 9. AS7: "IllegalArgumentException: key is null"
                          jaikiran

                          I've updated the JIRA with the details https://issues.jboss.org/browse/JBAS-9261

                          • 10. AS7: "IllegalArgumentException: key is null"
                            wolfgangknauf

                            Thanks for your efforts, Jaikiran!

                             

                            I don't have the need to find workarounds for my app - if is is broken because a JBoss feature is not finished or a bug is under work, I will wait ;-).

                             

                            Best regards

                             

                            Wolfgang

                            • 12. AS7: "IllegalArgumentException: key is null"
                              wolfgangknauf

                              Thanks. I tried to follow this thread, but it is a bit too deep in the AS internals for me ;-). Anyway, I subscribed to the devel list.

                               

                              One question: in my sample, I tried to change the global JNDI name of the EJB (same as a "@RemoteBinding" annotation would do):

                               

                              jboss.xml:

                              <jboss>

                                  <enterprise-beans>

                                      <session>

                                          <ejb-name>GeometricModelBean</ejb-name>

                                          <jndi-name>Keks</jndi-name>

                                          <local-jndi-name>KeksLocal</local-jndi-name>

                                      </session>

                                  </enterprise-beans>

                              </jboss>

                               

                              And in "jboss-web.xml", I tried to bind my EJB to this global name:

                              <jboss-web>

                                  ...

                                  <ejb-ref>

                                      <ejb-ref-name>ejb/GeometricModel</ejb-ref-name>

                                      <jndi-name>Keks</jndi-name>

                                  </ejb-ref>

                               

                              As far as I can follow the mailing list discussion, this global binding is invalid. But how correct JNDI names look like? I tried to use "<jndi-name>java:Keks</jndi-name>" (and also "java:/Keks"), and didn't see an error message, but the app did not deploy either because of the "timeout" problem (see above)...  So I don't know whether I am on the right track...

                               

                              Your workaround in JBAS-9261 does not seem to handle the "@RemoteBinding" step as far as I see?

                               

                              Best regards

                               

                              Wolfgang

                              • 13. Re: AS7: "IllegalArgumentException: key is null"
                                jaikiran

                                Right now, in AS7 we don't yet have support for jboss.xml deployment descriptor and also no support for JBoss EJB3 specific annotations. So even @RemoteBinding won't work. In AS7, we currently only support the EJB3.1 mandated jndi names for EJBs. So in your case, in the jboss-web.xml you can point to the EJB3.1 portable jndi name:

                                 

                                 

                                <jboss-web>
                                    ...
                                    <ejb-ref>
                                        <ejb-ref-name>ejb/GeometricModel</ejb-ref-name>
                                        <jndi-name>java:module/GeometricModelBean!de.fhw.komponentenarchitekturen.knauf.stateless.GeometricModelRemote</jndi-name>
                                    </ejb-ref>
                                
                                • 14. Re: AS7: "IllegalArgumentException: key is null"
                                  wolfgangknauf

                                  The "@RemoteBinding" will come back I assume ;-)?

                                  1 2 Previous Next