This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes NullPointerException: Module 'null' not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "NullPointerException: Module Watch "NullPointerException: Module New topic
Author

NullPointerException: Module 'null' not found

Russell Ray
Ranch Hand

Joined: Apr 25, 2005
Posts: 116
Forgive me for posting a topic that seems to be answered already in this forum. I am not able to correct this fault using the information provided in this form and FAQ sections.

This is a basic tutorial example of a struts project I have created. It consist of one jsp, one Form and Action class. However, typing in the URL http://localhost:8080/strutsproject/addPerson.jsp I recieve the following fault:



What I have done to correct this problem myself:

1. Verify all the dependent jar files are in the lib directory within the war file.
2. I reviewed the struts-config.xml file.


Here is my struts 1.3.8 config file.



This is my JSP




This is my web.xml file.





Thank you in advance for taking the time in reading my post. Any comments would be greatly appreciated.


Russ
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
Check your logfiles to make sure that the struts servlet started correctly. There are some tags that won't work if the current request wasn't handled by the struts servlet (and going straight to a jsp will skip the servlet), but I used the form tag on my log in page so I'm pretty sure html:form doesn't need the request to have come through the servlet. However, I only specify an action attribute in the tag. Maybe try taking out your other 2 attributes to see if it will process better. The other attributes might require the request to have code through struts2.
Russell Ray
Ranch Hand

Joined: Apr 25, 2005
Posts: 116
First, thank you for offering some suggestions on where to look for this fault. I tried your recommendation and I still received an error. This time it's a little more descriptive. I started with just the action attribute and walked it through each attribute. The errors are the same.



This is the code for the JSP translation of the jsp on line 191





When the tomcat server lanuches I am seeing this:




Any suggestions would be greatly appreciated..........
Russell Ray
Ranch Hand

Joined: Apr 25, 2005
Posts: 116
Okay after some testing the blank struts project........ It appears the ActionServlet for my project is not loading......

Any suggestions?
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
Why don't you think its loading now? Do you have any more info? Like a stack trace.
Russell Ray
Ranch Hand

Joined: Apr 25, 2005
Posts: 116
I am getting the destinct impression that the ActionServlet is not loading. I do not see it in the Tomcat logs or within the console stating the ActionServlet init() has been called. I have used the blank Struts war file that comes with the distribution. I can get this project to work. I have compared the libraries and the two projects are the same. I have read the JavaRanch forum for suggestions and FAQ. I can not see where this error is coming from.....
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
If you go to this URL:

http://localhost:8080/strutsproject/addPerson.do

Does struts try to find the action or does your application server tell you it can't find the url?
Russell Ray
Ranch Hand

Joined: Apr 25, 2005
Posts: 116
The web server is telling me it can not find it.....HTTP 404
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
Ok, then it sounds like you are right that the server didn't start. There should be something in your server's log file saying what went wrong.
Joe White
Greenhorn

Joined: Dec 10, 2008
Posts: 5
I'm getting the same error.
I think my problem is that I compiled my WAR file to Java 6, but my app server is running Java 5. Do you think that the java version difference would case the same error?
Also, it only gives me these errors when I declare my form-beans.
When I run on tomcat 6 with Java 6, all is well.
Do you know if Struts tries to validate the form beans on start up?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It could cause an error--check your log files.

Not sure what you mean by "validate the form beans", it expects well-formed XML, and classloaders will expect compatible class files.
 
 
subject: NullPointerException: Module 'null' not found
 
Similar Threads
struts-html.tld not found help me please
LogonView.jsp Displays A Blank Page
Verification failed on Username existence check using AJAX
Need Java and Struts Help
using Multiple submit buttons.