Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.1.x
-
None
-
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)
}