You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "karan singh malhi (JIRA)" <ji...@apache.org> on 2010/08/03 17:27:22 UTC

[jira] Resolved: (OPENEJB-1315) NPE when deploying EJB modules.

     [ https://issues.apache.org/jira/browse/OPENEJB-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

karan singh malhi resolved OPENEJB-1315.
----------------------------------------

    Resolution: Fixed

> NPE when deploying EJB modules.
> -------------------------------
>
>                 Key: OPENEJB-1315
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1315
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: container system
>    Affects Versions: 3.1.x
>         Environment: Openejb 3.1.3-SNAPSHOT + geronimo 2.2.2-SNPASHOT
>            Reporter: Shawn Jiang
>         Attachments: OPENEJB-1315.patch
>
>
> 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);
>                 }
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.