struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Cockrill" <James.cockr...@detica.com>
Subject RE: Noddy struts problem: java.lang.NullPointerException: Module 'null' not found
Date Fri, 25 Jan 2008 09:36:45 GMT
Apologies, reading my filestructure back, it looked a bit like
src/com/pdata lived within the ant folder, which it does not. I've tried
to make this a bit clearer below. Apologies for the spam.

-jamie


/ant
	/build.xml  (main build xml that I use to clean the project from
tomcat and copy files over to the webapps directory)


/src/com/pdata
	/PersonData.java
	/PersonDataAction.java
/Webroot
	/pages
		/error.jsp
		/personData.jsp
		/results.jsp
		/Welcome.jsp
	/WEB-INF
		/classes
			/com/pdata
				/PersonData.class
				/PersonDataAction$Forwards.class
				/PersonDataAction.class
			/MessageResources.properties


		/lib (bunch of library files, can define these if
needed?)


		/src
			/java/MessageResources.properties
			/build.xml (supplied by struts-blank and not
used)


			/README.txt
		/struts-config.xml
		/validation.xml
		/web.xml
	/index.jsp


If there's any other useful information I can provide, please let me
know. Thanks for the help so far

Thanks

Jamie


-----Original Message-----
From: Alexandru BARBAT [mailto:alexandrubarbat@ucs.ro] 
Sent: 24 January 2008 16:25
To: Struts Users Mailing List
Subject: Re: Noddy struts problem: java.lang.NullPointerException:
Module 'null' not found

hi,
You don't have to define properties form in struts-config when you use
classic ActionForm.

it will be enough :
...
<form-bean name="personDataForm" type="com.pdata.PersonData"/>
...

----- Original Message ----- 
From: "James Cockrill" <James.cockrill@detica.com>
To: <user@struts.apache.org>
Sent: Thursday, January 24, 2008 6:07 PM
Subject: Noddy struts problem: java.lang.NullPointerException: Module
'null'
not found


> Dear All,
>
> I've been trying to set up a little struts app to play with some
actions
> and whatnot and just as a little exercise and I seem to have rather
> stumped myself. Essentially I'm getting a
> java.lang.NullPointerException: Module 'null' not found. Exception
when
> I deploy to Tomcat.
>
> However as far as I've figured out, the problem is to do with my
struts
> config as a little further up the stacktrace there is:
>
> SEVERE: Servlet /Struts Taster threw load() exception
> javax.servlet.UnavailableException: Parsing error processing resource
> path jndi:/localhost/Struts Taster/WEB-INF/struts-config.xml
>
> I think I've narrowed it down to a form-bean definition. My
> spring-config for the form-bean is essentially:
>
>     <form-bean name="personDataForm" type="com.pdata.PersonData">
>     <form-property name="firstname" type="java.lang.String"
> />
>     <form-property name="lastname" type="java.lang.String"
> />
>     <form-property name="address" type="java.lang.String" />
>     <form-property name="telephoneNumber"
> type="java.lang.String" />
>     </form-bean>
>
> And 'PersonData' is defined as such...
>
> package com.pdata;
>
> import org.apache.struts.action.ActionForm;
>
> public class PersonData extends ActionForm {
> private String firstname = null;
> private String lastname = null;
> private String address = null;
> private String telephoneNumber = null;
>
> with getters and setters for each field.
>
> I'm fairly sure it's this formbean definition as when I comment it
out,
> I get through to the default welcome page just fine. Interestingly,
one
> of my action-mapping entries is:
>
> <action path="/PersonData" forward="/pages/personData.jsp" />
>
>     <action path="/Results" type="com.pdata.PersonDataAction"
>             name="personDataForm"
>             scope="request"
>             input="/pages/personData.jsp">
>             <forward name="success" path="/pages/results.jsp" />
>         <forward name="failed" path="/pages/error.jsp" />
>         </action>
>
> Now, if I change personDataForm's form-bean definition and remove the
> 'com.pdata.' part of it, then the app builds within tomcat and
deploys,
> however if I hit /PersonData.do in my browser, I get:
> javax.servlet.ServletException: Cannot retrieve definition for form
> bean: "personDataForm" on action: "/Results", which I guess it means
it
> can't compile the form bean definition as it can't find the bean.
>
> Commenting out the form-properties has no effect. I'm presuming that
> I've done something (fairly elementary) wrong. Hopefully this'll be
easy
> for someone to diagnose. Please let me know if you require more
> information
>
> Thanks,
>
> Jamie
>
> PS, I based most of what I've done on the tutorial at
> http://www.abqswt.com/tutorials/basicStruts/index.php
>
> However I have deviated in a few places as it seems to do a few
strange
> things unnecessarily (like manually copying files about willy nilly).
>
>
>
> This message should be regarded as confidential. If you have received
this
email in error please notify the sender and destroy it immediately.
> Statements of intent shall only become binding when confirmed in hard
copy
by an authorised signatory.  The contents of this email may relate to
dealings with other companies within the Detica Group plc group of
companies.
>
> Detica Limited is registered in England under No: 1337451.
>
> Registered offices: Surrey Research Park, Guildford, Surrey, GU2 7YP,
England.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message