Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: getting NPException while running my struts first application using tomcat

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    7
    My Mood
    Cool
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default getting NPException while running my struts first application using tomcat

    Hi,

    What are the possibilities of getting null-pointer exception in java?

    Please help me out from this NullPointerException for my application -
    When i send a string form my login page, it is unable to forward to the target page..I am using default struts-config.xml. able to identify ActionServlet also. please suggest me why iam geting this exception here?

    HTTP Status 500 -

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: java.lang.NullPointerException
    org.apache.struts.chain.ComposableRequestProcessor .process(ComposableRequestProcessor.java:286)
    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:449)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:722)

    root cause

    java.lang.NullPointerException
    org.apache.struts.config.FormBeanConfig.createActi onForm(FormBeanConfig.java:289)
    org.apache.struts.config.FormBeanConfig.createActi onForm(FormBeanConfig.java:357)
    org.apache.struts.chain.commands.CreateActionForm. execute(CreateActionForm.java:92)
    org.apache.struts.chain.commands.ActionCommandBase .execute(ActionCommandBase.java:51)
    org.apache.commons.chain.impl.ChainBase.execute(Ch ainBase.java:191)
    org.apache.commons.chain.generic.LookupCommand.exe cute(LookupCommand.java:305)
    org.apache.commons.chain.impl.ChainBase.execute(Ch ainBase.java:191)
    org.apache.struts.chain.ComposableRequestProcessor .process(ComposableRequestProcessor.java:283)
    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1913)
    org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:449)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    Thanks in advance
    Last edited by rafishaik999; September 11th, 2011 at 05:16 AM. Reason: want to be more specific...


  2. #2
    Member
    Join Date
    Sep 2011
    Posts
    32
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: getting NPException while running my struts first application using tomcat

    You are getting NullPointerException when trying to access properties/methods of an object which has not been initialized before.
    Please post your Action class code here.

    java memory
    Last edited by namhm; December 4th, 2011 at 06:50 PM.

Similar Threads

  1. struts 1.3.8
    By Ashwin K in forum Member Introductions
    Replies: 1
    Last Post: August 14th, 2011, 05:06 AM
  2. Shortcut executed or in-background running Java application
    By xixixao in forum Java Theory & Questions
    Replies: 2
    Last Post: April 22nd, 2011, 04:33 AM
  3. JAAS implementaion for web application with tomcat
    By singharun in forum Java Servlet
    Replies: 0
    Last Post: August 30th, 2010, 05:56 AM
  4. Struts Application, Complies perfectly but error at run time
    By Prarthana in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 18th, 2010, 01:49 AM
  5. Problem running Apache tomcat 6.0 using i.p. address
    By nakul in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: April 8th, 2010, 07:58 AM