Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointer Exception when reading property file

 
Praveen Katti
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am running my application in WebSphere 3.5. I am loading one of my servlet called "NotifierServlet" at the startup.. its throwing following exception. I am attaching my code of the servlet also.

[04.08.20 08:22:59:218 EDT] 5cb5da4d WebGroup X Root Cause
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:68)
at java.io.InputStreamReader.<init>(InputStreamReader.java:88)
at java.io.InputStreamReader.<init>(InputStreamReader.java:77)
at java.util.Properties.load(Properties.java:179)
at com.alliedholdings.dashboard.notifier.NotifierServlet.init(Unknown Source)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doInit(ServletManager.java:622)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._init(StrictLifecycleServlet.java:136)
at com.ibm.servlet.engine.webapp.PreInitializedServletState.init(StrictLifecycleServlet.java:244)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.init(StrictLifecycleServlet.java:102)
at com.ibm.servlet.engine.webapp.ServletInstance.init(ServletManager.java:295)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.servlet.engine.webapp.ServletManager.addServlet(ServletManager.java:76)
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:115)
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:196)
at com.ibm.servlet.engine.webapp.WebApp.loadServletManager(WebApp.java:919)
at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:93)
at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:142)
at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:103)
at com.ibm.servlet.engine.ServletHost.addWebGroup(ServletHost.java:117)
at com.ibm.servlet.engine.ServletEngineDynamicUpdateSupport.addWebGroup(ServletEngineDynamicUpdateSupport.java:126)
at com.ibm.ejs.sm.active.ActiveServletGroup.startAction(ActiveServletGroup.java:76)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:686)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:117)
at com.ibm.ejs.sm.active.ActiveObject.operateOnContainedObjects(ActiveObject.java:588)
at com.ibm.ejs.sm.active.ActiveServletEngine.startAction(ActiveServletEngine.java:60)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:686)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:117)
at com.ibm.ejs.sm.active.ActiveObject.operateOnContainedObjects(ActiveObject.java:588)
at com.ibm.ejs.sm.active.ActiveEJBServer.startAction(ActiveEJBServer.java:99)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:686)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:93)
at com.ibm.ejs.sm.agent.AdminAgentImpl.invokeActiveObject(AdminAgentImpl.java:62)
at com.ibm.ejs.sm.agent._AdminAgentImpl_Tie._invoke(_AdminAgentImpl_Tie.java:73)
at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(ExtendedServerDelegate.java:506)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:2381)
at com.ibm.CORBA.iiop.WorkerThread.run(WorkerThread.java:195)
at com.ibm.ejs.oa.pool.ThreadPool$PooledThread.run(ThreadPool.java:535)

[04.08.20 08:22:59:312 EDT] 5cb5da4d WebApp X Failed.to.initialize.webapp.{0}
"dashboard"
javax.servlet.ServletException
at com.ibm.servlet.engine.webapp.StrictServletInstance.doInit(ServletManager.java:635)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._init(StrictLifecycleServlet.java:136)
at com.ibm.servlet.engine.webapp.PreInitializedServletState.init(StrictLifecycleServlet.java:244)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.init(StrictLifecycleServlet.java:102)
at com.ibm.servlet.engine.webapp.ServletInstance.init(ServletManager.java:295)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.servlet.engine.webapp.ServletManager.addServlet(ServletManager.java:76)
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:115)
at com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:196)
at com.ibm.servlet.engine.webapp.WebApp.loadServletManager(WebApp.java:919)
at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:93)
at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:142)
at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:103)
at com.ibm.servlet.engine.ServletHost.addWebGroup(ServletHost.java:117)
at com.ibm.servlet.engine.ServletEngineDynamicUpdateSupport.addWebGroup(ServletEngineDynamicUpdateSupport.java:126)
at com.ibm.ejs.sm.active.ActiveServletGroup.startAction(ActiveServletGroup.java:76)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:686)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:117)
at com.ibm.ejs.sm.active.ActiveObject.operateOnContainedObjects(ActiveObject.java:588)
at com.ibm.ejs.sm.active.ActiveServletEngine.startAction(ActiveServletEngine.java:60)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:686)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:117)
at com.ibm.ejs.sm.active.ActiveObject.operateOnContainedObjects(ActiveObject.java:588)
at com.ibm.ejs.sm.active.ActiveEJBServer.startAction(ActiveEJBServer.java:99)
at com.ibm.ejs.sm.active.ActiveObject.startObject(ActiveObject.java:686)
at com.ibm.ejs.sm.active.ActiveObject.start(ActiveObject.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:93)
at com.ibm.ejs.sm.agent.AdminAgentImpl.invokeActiveObject(AdminAgentImpl.java:62)
at com.ibm.ejs.sm.agent._AdminAgentImpl_Tie._invoke(_AdminAgentImpl_Tie.java:73)
at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(ExtendedServerDelegate.java:506)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:2381)
at com.ibm.CORBA.iiop.WorkerThread.run(WorkerThread.java:195)
at com.ibm.ejs.oa.pool.ThreadPool$PooledThread.run(ThreadPool.java:535)

Following is my Servlet code..

I have placed the property file in the proper directory.
I am trying to resolve this issue from last 2 days, but was not able to get through.. . Help is needed..
Thanks in advance..
Praveen.
[ August 23, 2004: Message edited by: Praveen Katti ]
 
Steve Grant
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Can u show me dir structure. its seems to be classpath problem.


thx,
steve
 
Praveen Katti
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve,
Thanks for the reply. Following is my directory where my servlet is there.

D:\WebSphere\AppServer\hosts\default_host\dashboard\servlets\com\alliedholdings\dashboard\notifier

I have my property file in following directory
D:\WebSphere\AppServer\hosts\default_host\dashboard\servlets

Following is my commande line arguments in WebSphere 3.5.6

-Xms512M -Xmx1024M -Djava.compiler=NONE -classpath D:\dashboard\lib\xalan.jar;D:\dashboard\lib\xercesImpl.jar;D:\dashboard\lib\xml-apis.jar;D:\orajdbc\classes12.zip;D:\dashboard\lib\jfreechart-0.9.8.jar;D:\dashboard\lib\jcommon-0.8.0.jar;D:\dashboard\lib\activation.jar;D:\dashboard\lib\mail.jar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic