4 Replies Latest reply on Nov 7, 2008 11:11 AM by Wolfgang Knauf

    Error message from WebServiceDeployerEJB for invalid ejb.jar

    Wolfgang Knauf Master

      I created an ejb-jar.xml, which should declare a session and a entity bean with annotations.

      Unfortunately, I added an "entity" element for my EJB3 entity bean (afterwards, I found out that this is only valid for EJB2.1 entities):

      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
       ...
       <enterprise-beans>
       ...
       <entity>
       <description>
       <![CDATA[Entity Bean für einen einzelnen Kuchen.]]>
       </description>
       <display-name>KuchenSimpleBean</display-name>
       <ejb-name>KuchenSimpleBean</ejb-name>
       <ejb-class>de.fhw.swtvertiefung.knauf.kuchen.KuchenSimpleBean</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>java.lang.Integer</prim-key-class>
       <reentrant>false</reentrant>
       </entity>
       </enterprise-beans>
      </ejb-jar>


      "orm.xml" contained a valid declaration.

      This resulted in a really strange exception in the "WebServiceDeployerEJB":
      21:54:06,312 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/temp/jboss-5.0.0.CR2/server/default/deploy/KuchenSimpleNoAnnotation.ear state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: java.lang.NullPointerException: name cannot be null
       at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:103)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1285)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1003)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1056)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:944)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:627)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
       at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
       at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException: name cannot be null
       at javax.management.ObjectName.construct(Unknown Source)
       at javax.management.ObjectName.(Unknown Source)
       at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:99)
       ... 26 more


      Shouldn't JBoss handle this error with a better message?
      I can provide you with a full broken sample EAR, if necessary.

      Thanks

      Wolfgang