tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (Closed) (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (OPENEJB-1523) TomEE 6.0.26 / 3.1.4: NPE in org.apache.catalina.startup.HostConfig.manageApp
Date Wed, 19 Oct 2011 10:40:10 GMT

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

Romain Manni-Bucau closed OPENEJB-1523.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0-beta-2
         Assignee: Romain Manni-Bucau
    
> TomEE 6.0.26 / 3.1.4: NPE in org.apache.catalina.startup.HostConfig.manageApp
> -----------------------------------------------------------------------------
>
>                 Key: OPENEJB-1523
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1523
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: tomee
>    Affects Versions: 3.1.4
>         Environment: - Apache TomEE (Tomcat 6.0.29 / OpenEJB 3.1.4)
> - Snapshot apache-tomee-4.0.0-20110825.075723-21
>            Reporter: Werner Froidevaux
>            Assignee: Romain Manni-Bucau
>             Fix For: 4.0-beta-2
>
>         Attachments: opencrx-core-CRX.ear
>
>
> When deploying an EAR (containing web modules) I get the following Exception:
> {code}
> org.apache.openejb.OpenEJBException: Creating application failed: /home/wfro/temp/apache-tomcat-6.0.29/apps/opencrx-core-CRX:
null
> 	at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:679)
> 	at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:450)
> 	at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:368)
> 	at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:280)
> 	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:125)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:271)
> 	at org.apache.openejb.tomcat.catalina.TomcatLoader.init(TomcatLoader.java:161)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.openejb.loader.Embedder.init(Embedder.java:75)
> 	at org.apache.openejb.tomcat.loader.TomcatHook.hook(TomcatHook.java:137)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.openejb.tomcat.loader.TomcatEmbedder.embed(TomcatEmbedder.java:92)
> 	at org.apache.openejb.tomcat.loader.OpenEJBListener.lifecycleEvent(OpenEJBListener.java:64)
> 	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> 	at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:770)
> 	at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
> 	at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
> 	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> Caused by: java.lang.NullPointerException
> 	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1389)
> 	at org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:188)
> 	at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:658)
> 	... 28 more
> {code}
> Debugging shows that the reason is in the constructor of TomcatWebAppBuilder. I can fix
the NullPointer if I patch the constructor as follows:
> OLD:
> {code}
> for (LifecycleListener listener : host.findLifecycleListeners()) {
>     if (listener instanceof HostConfig) {
> 	HostConfig hostConfig = (HostConfig) listener;
> 	deployers.put(host.getName(), hostConfig);
>     }
> }
> {code}
> NEW:
> {code}
> if (listener instanceof HostConfig) {
>     HostConfig hostConfig = (HostConfig) listener;
>     if(hostConfig.getConfigBaseName() != null) { 
> 	    deployers.put(host.getName(), hostConfig);
>     }
> }
> {code}
> In some cases the method getConfigBaseName() returns null (I suppose in the cases when
the context.xml is put in the web module META-INF and not in conf/Catalina/localhost). 
> Adding a hostConfig to the deployers map with hostConfig.getConfigBaseName() == null
results in the reported NPE in org.apache.catalina.startup.HostConfig.manageApp. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message