3 Replies Latest reply on Sep 7, 2011 12:50 AM by mp911de

    [/]] Exception sending context initialized event to listener instance of class

    amoskanakam

      Hi All,

       

      I am using JBoss 4.2.2.GA, which starts successfully and runs smoothly when I run through the command prompt.

      Recently I made it as a service.  I am getting the following error when I start the service.

       

      [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/project.ear/project.war/

      INFO  | jvm 1    | 2011/09/06 04:45:06 | 04:45:06,281 ERROR [[/]] Exception sending context initialized event to listener instance of class com.project.common.ProjectStartup

      INFO  | jvm 1    | 2011/09/06 04:45:06 | java.lang.ExceptionInInitializerError

      java.lang.ExceptionInInitializerError

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at com.globex.common.ProjectStartup.init(GlobexStartup.java:89)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at com.globex.common.ProjectStartup.contextInitialized(GlobexStartup.java:109)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.reflect.Method.invoke(Method.java:597)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.reflect.Method.invoke(Method.java:597)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.web.WebModule.startModule(WebModule.java:83)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.web.WebModule.startService(WebModule.java:61)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.reflect.Method.invoke(Method.java:597)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at $Proxy0.start(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.ServiceController.start(ServiceController.java:417)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.reflect.Method.invoke(Method.java:597)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at $Proxy44.start(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.reflect.Method.invoke(Method.java:597)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at $Proxy45.start(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.reflect.Method.invoke(Method.java:597)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at $Proxy9.deploy(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.reflect.Method.invoke(Method.java:597)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)  

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)  

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)  

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

         at $Proxy0.start(Unknown Source)  

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

        at org.jboss.system.ServiceController.start(ServiceController.java:417)  

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)  

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

        at java.lang.reflect.Method.invoke(Method.java:597)  

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at $Proxy4.start(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at java.lang.reflect.Method.invoke(Method.java:597) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |

       

        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) 

       

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at $Proxy5.deploy(Unknown Source)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.Main.boot(Main.java:200)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at org.jboss.Main$1.run(Main.java:508)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.Thread.run(Thread.java:619)

      INFO  | jvm 1    | 2011/09/06 04:45:06 | Caused by: java.lang.NullPointerException

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.StringBuffer.<init>(StringBuffer.java:103)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  at com.globex.common.ApplicationDefs.<clinit>(ApplicationDefs.java:107)

      INFO  | jvm 1    | 2011/09/06 04:45:06 |  ... 135 more

      INFO  | jvm 1    | 2011/09/06 04:45:06 | 04:45:06,390 ERROR [StandardContext] Error listenerStart

      INFO  | jvm 1    | 2011/09/06 04:45:06 | 04:45:06,390 ERROR [StandardContext] Context [] startup failed due to previous errors

      INFO  | jvm 1    | 2011/09/06 04:45:06 | 04:45:06

       

      Any help Appreciated!!

       

      Thanks,

      Amos

        • 1. Re: [/]] Exception sending context initialized event to listener instance of class
          mp911de

          Hi Amos,

          that's the cause:

           

          Caused by: java.lang.NullPointerException

          INFO  | jvm 1    | 2011/09/06 04:45:06 |  at java.lang.StringBuffer.<init>(StringBuffer.java:103)

          INFO  | jvm 1    | 2011/09/06 04:45:06 |  at com.globex.common.ApplicationDefs.<clinit>(ApplicationDefs.java:107)

          INFO  | jvm 1    | 2011/09/06 04:45:06 |  ... 135 more

           

           

          and you should take a look at com.globex.common.ProjectStartup.init(GlobexStartup.java:89)

           

          Best regards,

          Mark

          • 2. Re: [/]] Exception sending context initialized event to listener instance of class
            amoskanakam

            Hi Mark,

             

            Thanks for responding to my question.

             

             

            I have noticed that before only... and here is the following code :

             

            StartUp Class Code :

             

            public static String PROPERTY_FILE = "ConfFile";

             

            fileContextPath = sctx.getInitParameter(PROPERTY_FILE);

            fileRealPath = sctx.getRealPath(fileContextPath);

                    try {

                        fileInputStream = new FileInputStream(fileRealPath);

                    } catch (FileNotFoundException e) {}

             

             

            Properties properties = new Properties();

            properties.load(fileInputStream);

            String earName = (String) properties.get("earName");

            depName = earName; ---- Line # 84  Here the NullPointerException is throwing

             

             

            Web.xml  entry:

             

            <context-param>

              <param-name>ConfFile</param-name>

              <param-value>/WEB-INF/project.properties</param-value>

            </context-param>

             

             

            Properties file content:

             

            earName=proj/

             

             

            It is unable to read the 'earName' value from the properties file. But  server starts fine when i run  from command prompt .

            • 3. Re: [/]] Exception sending context initialized event to listener instance of class
              mp911de

              Sometimes there are strange things when you try to access resources within your EAR/WAR's by FileInputStream. Try it with ServletContext.getResourceAsStream, so you do not need to resolve the real filename. But if you like you could create some logging for the real filename and the context war just to find out, which variable provides the wrong information and you can also take a look to the tmp dir, whether everything was unpacked correctly and you config file exists.

               

              Best regards,

              Mark