Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1315

NPE when deploying EJB modules.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.x
    • Fix Version/s: 3.1.3, 4.0
    • Component/s: container system
    • Labels:
      None
    • Environment:
      Openejb 3.1.3-SNAPSHOT + geronimo 2.2.2-SNPASHOT

      Description

      Caused by: java.lang.NullPointerException
      at org.apache.openejb.config.JndiEncInfoBuilder.buildDependsOnRefs(JndiEncInfoBuilder.java:413)
      at org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:177)
      at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:615)
      at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.configureApplication(EjbModuleBuilder.java:635)
      at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.getEjbJarInfo(EjbModuleBuilder.java:568)
      at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.initContext(EjbModuleBuilder.java:493)
      at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:592)
      at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:257)

      --------------------------------------------------------
      I looked into the code and found the root cause, In the beginning of "org.apache.openejb.config.AnnotationDeployer.ProcessAnnotatedBeans.deploy(EjbModule)" , If "isMetadataComplete" is true. this method will return directly. So that the following snippet in the method does not get a chance to be executed.

      if (dependsOn != null)

      { sessionBean.setDependsOn(dependsOn.value()); }

      else

      { sessionBean.setDependsOn(Collections.EMPTY_LIST); }

      Which means that the dependsOn field of sessionBean have chance to be null. Therefore, following snippet in method "org.apache.openejb.config.JndiEncInfoBuilder.buildDependsOnRefs(EjbModule, EnterpriseBean, EnterpriseBeanInfo, String)" have the chance to throw NPE.

      for (String ejbName : sessionBean.getDependsOn()) {
      String deploymentId = ejbResolver.resolve(new SimpleRef(ejbName), moduleUri);
      if (deploymentId != null)

      { beanInfo.dependsOn.add(deploymentId); }

      }

        Attachments

        1. OPENEJB-1315.patch
          1 kB
          Shawn Jiang

          Activity

            People

            • Assignee:
              kevan Kevan Miller
              Reporter:
              genspring Shawn Jiang
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: