You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by beyaRecords - The home Urban music <uz...@beya-records.com> on 2004/01/08 19:58:47 UTC

null pointer error

hi,

i am getting a null pointer error when trying to validate a form. I 
have 2 definition files 1 to validate a login form and the other to 
validate the user input.

1 My map actions is as follows:

		<map:actions>
			<map:action name="char-counter" src="test.CharCounterAction"/>
			<map:action name="session-validator" 
src="org.apache.cocoon.acting.SessionValidatorAction" />
			<map:action name="session-invalidator" 
src="org.apache.cocoon.acting.SessionInvalidatorAction" />
			<map:action name="authenticator" 
src="org.apache.cocoon.acting.DatabaseAuthenticatorAction" />
			<map:action name="validator" logger="sitemap.Action.validator" 
src="org.apache.cocoon.acting.FormValidatorAction" />
			<map:action name="request" logger="sitemap.Action.request" 
src="org.apache.cocoon.acting.RequestParamAction" />
		</map:actions>

2. My login definition file is:

<root>
	<parameter name="user" typr="string" max-len="20" nullable="no" />
	<parameter name="pass" typr="string" max-len="20" nullable="no" />
	
	<constraint-set name="add">
		<validate name="user" />
		<validate name="pass" />
	</constraint-set>
</root>

3. My database definition file is:

<auth-descriptor>
	<connection>postgresql</connection>
	<table name="usertbl">
		<select dbcol="username" request-param="user" to-session="user" />
		<select dbcol="userpassword" request-param="pass" 
to-session="password" />
	</table>
</auth-descriptor>

4. My pipe is:

			<map:match pattern="login">
				<map:act type="validator">
				<map:parameter name="descriptor" 
value="context://beyarecords/content/def/login-def.xml"/>
				<map:parameter name="validate-set" value="add" />
				
					<map:act type="authenticator">
					<!-- Ok, login details are being checked. If they exist we get 
logged into system -->
						<map:parameter name="descriptor" 
value="context://beyarecords/content/def/auth-def.xml"/>
						<map:redirect-to uri="support/home"/>
					</map:act>
					
				</map:act>
				
				<!-- if not we get redirected back to the login page -->
				<map:redirect-to uri="login.html" />
			</map:match>

5. And my html form is:

		<form action="login" method="post">
		
			<table>
			<tr>
				<td align="right">User:</td>
				<td align="left"><input type="text" name="user" /></td>
			</tr>
			<tr>
				<td align="right">Password:</td>
				<td align="left"><input type="text" name="pass" /></td>
			</tr>
			<tr>
				<td colspan="2" align="center"><input type="submit" value="login" 
/></td>
			</tr>
			</table>
		</form>

What am I doing wrong here?

regards


Uzo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: null pointer error

Posted by beyaRecords - The home Urban music <uz...@beya-records.com>.
sorted. thanks again for your help on this issue.
On 8 Jan 2004, at 19:34, beyaRecords - The home Urban music wrote:

> Any takers for this question?
> On 8 Jan 2004, at 18:58, beyaRecords - The home Urban music wrote:
>
>> hi,
>>
>> i am getting a null pointer error when trying to validate a form. I 
>> have 2 definition files 1 to validate a login form and the other to 
>> validate the user input.
>>
>> 1 My map actions is as follows:
>>
>> 		<map:actions>
>> 			<map:action name="char-counter" src="test.CharCounterAction"/>
>> 			<map:action name="session-validator" 
>> src="org.apache.cocoon.acting.SessionValidatorAction" />
>> 			<map:action name="session-invalidator" 
>> src="org.apache.cocoon.acting.SessionInvalidatorAction" />
>> 			<map:action name="authenticator" 
>> src="org.apache.cocoon.acting.DatabaseAuthenticatorAction" />
>> 			<map:action name="validator" logger="sitemap.Action.validator" 
>> src="org.apache.cocoon.acting.FormValidatorAction" />
>> 			<map:action name="request" logger="sitemap.Action.request" 
>> src="org.apache.cocoon.acting.RequestParamAction" />
>> 		</map:actions>
>>
>> 2. My login definition file is:
>>
>> <root>
>> 	<parameter name="user" typr="string" max-len="20" nullable="no" />
>> 	<parameter name="pass" typr="string" max-len="20" nullable="no" />
>> 	
>> 	<constraint-set name="add">
>> 		<validate name="user" />
>> 		<validate name="pass" />
>> 	</constraint-set>
>> </root>
>>
>> 3. My database definition file is:
>>
>> <auth-descriptor>
>> 	<connection>postgresql</connection>
>> 	<table name="usertbl">
>> 		<select dbcol="username" request-param="user" to-session="user" />
>> 		<select dbcol="userpassword" request-param="pass" 
>> to-session="password" />
>> 	</table>
>> </auth-descriptor>
>>
>> 4. My pipe is:
>>
>> 			<map:match pattern="login">
>> 				<map:act type="validator">
>> 				<map:parameter name="descriptor" 
>> value="context://beyarecords/content/def/login-def.xml"/>
>> 				<map:parameter name="validate-set" value="add" />
>> 				
>> 					<map:act type="authenticator">
>> 					<!-- Ok, login details are being checked. If they exist we get 
>> logged into system -->
>> 						<map:parameter name="descriptor" 
>> value="context://beyarecords/content/def/auth-def.xml"/>
>> 						<map:redirect-to uri="support/home"/>
>> 					</map:act>
>> 					
>> 				</map:act>
>> 				
>> 				<!-- if not we get redirected back to the login page -->
>> 				<map:redirect-to uri="login.html" />
>> 			</map:match>
>>
>> 5. And my html form is:
>>
>> 		<form action="login" method="post">
>> 		
>> 			<table>
>> 			<tr>
>> 				<td align="right">User:</td>
>> 				<td align="left"><input type="text" name="user" /></td>
>> 			</tr>
>> 			<tr>
>> 				<td align="right">Password:</td>
>> 				<td align="left"><input type="text" name="pass" /></td>
>> 			</tr>
>> 			<tr>
>> 				<td colspan="2" align="center"><input type="submit" value="login" 
>> /></td>
>> 			</tr>
>> 			</table>
>> 		</form>
>>
>> What am I doing wrong here?
>>
>> regards
>>
>>
>> Uzo
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: null pointer error

Posted by Tim Larson <ti...@yahoo.com>.
--- beyaRecords - The home Urban music <uz...@beya-records.com> wrote:
> Any takers for this question?

No time to look into it now, but posting the exception and stack
traces would likely help in diagnosing this problem.

> On 8 Jan 2004, at 18:58, beyaRecords - The home Urban music wrote:
> 
> > hi,
> >
> > i am getting a null pointer error when trying to validate a form. I 
> > have 2 definition files 1 to validate a login form and the other to 
> > validate the user input.
<snip details/>

--Tim Larson


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: null pointer error

Posted by beyaRecords - The home Urban music <uz...@beya-records.com>.
Any takers for this question?
On 8 Jan 2004, at 18:58, beyaRecords - The home Urban music wrote:

> hi,
>
> i am getting a null pointer error when trying to validate a form. I 
> have 2 definition files 1 to validate a login form and the other to 
> validate the user input.
>
> 1 My map actions is as follows:
>
> 		<map:actions>
> 			<map:action name="char-counter" src="test.CharCounterAction"/>
> 			<map:action name="session-validator" 
> src="org.apache.cocoon.acting.SessionValidatorAction" />
> 			<map:action name="session-invalidator" 
> src="org.apache.cocoon.acting.SessionInvalidatorAction" />
> 			<map:action name="authenticator" 
> src="org.apache.cocoon.acting.DatabaseAuthenticatorAction" />
> 			<map:action name="validator" logger="sitemap.Action.validator" 
> src="org.apache.cocoon.acting.FormValidatorAction" />
> 			<map:action name="request" logger="sitemap.Action.request" 
> src="org.apache.cocoon.acting.RequestParamAction" />
> 		</map:actions>
>
> 2. My login definition file is:
>
> <root>
> 	<parameter name="user" typr="string" max-len="20" nullable="no" />
> 	<parameter name="pass" typr="string" max-len="20" nullable="no" />
> 	
> 	<constraint-set name="add">
> 		<validate name="user" />
> 		<validate name="pass" />
> 	</constraint-set>
> </root>
>
> 3. My database definition file is:
>
> <auth-descriptor>
> 	<connection>postgresql</connection>
> 	<table name="usertbl">
> 		<select dbcol="username" request-param="user" to-session="user" />
> 		<select dbcol="userpassword" request-param="pass" 
> to-session="password" />
> 	</table>
> </auth-descriptor>
>
> 4. My pipe is:
>
> 			<map:match pattern="login">
> 				<map:act type="validator">
> 				<map:parameter name="descriptor" 
> value="context://beyarecords/content/def/login-def.xml"/>
> 				<map:parameter name="validate-set" value="add" />
> 				
> 					<map:act type="authenticator">
> 					<!-- Ok, login details are being checked. If they exist we get 
> logged into system -->
> 						<map:parameter name="descriptor" 
> value="context://beyarecords/content/def/auth-def.xml"/>
> 						<map:redirect-to uri="support/home"/>
> 					</map:act>
> 					
> 				</map:act>
> 				
> 				<!-- if not we get redirected back to the login page -->
> 				<map:redirect-to uri="login.html" />
> 			</map:match>
>
> 5. And my html form is:
>
> 		<form action="login" method="post">
> 		
> 			<table>
> 			<tr>
> 				<td align="right">User:</td>
> 				<td align="left"><input type="text" name="user" /></td>
> 			</tr>
> 			<tr>
> 				<td align="right">Password:</td>
> 				<td align="left"><input type="text" name="pass" /></td>
> 			</tr>
> 			<tr>
> 				<td colspan="2" align="center"><input type="submit" value="login" 
> /></td>
> 			</tr>
> 			</table>
> 		</form>
>
> What am I doing wrong here?
>
> regards
>
>
> Uzo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: null pointer error

Posted by beyaRecords - The home Urban music <uz...@beya-records.com>.
As requested, here is the relevant stack trace:


java.lang.NullPointerException
         at  
org.apache.cocoon.acting.AbstractValidatorAction.validateSetOfParameters 
(AbstractValidatorAction.java:1022)
         at  
org.apache.cocoon.acting.AbstractValidatorAction.act(AbstractValidatorAc 
tion.java:285)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(Ac 
tTypeNode.java:152)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:84)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:164)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:108)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:163)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:108)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:152)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:354)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:307)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(Moun 
tNode.java:133)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:84)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.i 
nvoke(PreparableMatchNode.java:164)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:108)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P 
ipelineNode.java:163)
         at  
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode. 
invokeNodes(AbstractParentProcessingNode.java:108)
         at  
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke( 
PipelinesNode.java:152)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:354)
         at  
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro 
cessor.java:307)
         at org.apache.cocoon.Cocoon.process(Cocoon.java:656)
         at  
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java: 
1112)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica 
tionFilterChain.java:247)
         at  
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt 
erChain.java:193)
         at  
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv 
e.java:256)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
480)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv 
e.java:191)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
480)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardContext.invoke(StandardContext.java: 
2415)
         at  
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java 
:180)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa 
lve.java:171)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:641)
         at  
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java 
:172)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:641)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
480)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. 
java:174)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 
480)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at  
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
         at  
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
         at  
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
         at  
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java: 
562)
         at  
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
         at  
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool 
.java:619)
         at java.lang.Thread.run(Thread.java:554)
On 8 Jan 2004, at 19:44, Geoff Howard wrote:

> beyaRecords - The home Urban music wrote:
>
>> The exact error I am getting is: java.lang.NullPointerException
>
> There are precisely 1.54 gazillion ways you can get a  
> NullPointerException.  Get full long stack trace (the at... at....  
> stuff that follows the java.lang.NullPointerException) from the error  
> page in your browser, or the log or whatever and send it here or no  
> one will be able to guess.
>
> Geoff
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

Re: null pointer error

Posted by Geoff Howard <co...@leverageweb.com>.
beyaRecords - The home Urban music wrote:

> The exact error I am getting is: java.lang.NullPointerException

There are precisely 1.54 gazillion ways you can get a 
NullPointerException.  Get full long stack trace (the at... at.... stuff 
that follows the java.lang.NullPointerException) from the error page in 
your browser, or the log or whatever and send it here or no one will be 
able to guess.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: null pointer error

Posted by beyaRecords - The home Urban music <uz...@beya-records.com>.
The exact error I am getting is: java.lang.NullPointerException

On 8 Jan 2004, at 18:58, beyaRecords - The home Urban music wrote:

> hi,
>
> i am getting a null pointer error when trying to validate a form. I 
> have 2 definition files 1 to validate a login form and the other to 
> validate the user input.
>
> 1 My map actions is as follows:
>
> 		<map:actions>
> 			<map:action name="char-counter" src="test.CharCounterAction"/>
> 			<map:action name="session-validator" 
> src="org.apache.cocoon.acting.SessionValidatorAction" />
> 			<map:action name="session-invalidator" 
> src="org.apache.cocoon.acting.SessionInvalidatorAction" />
> 			<map:action name="authenticator" 
> src="org.apache.cocoon.acting.DatabaseAuthenticatorAction" />
> 			<map:action name="validator" logger="sitemap.Action.validator" 
> src="org.apache.cocoon.acting.FormValidatorAction" />
> 			<map:action name="request" logger="sitemap.Action.request" 
> src="org.apache.cocoon.acting.RequestParamAction" />
> 		</map:actions>
>
> 2. My login definition file is:
>
> <root>
> 	<parameter name="user" typr="string" max-len="20" nullable="no" />
> 	<parameter name="pass" typr="string" max-len="20" nullable="no" />
> 	
> 	<constraint-set name="add">
> 		<validate name="user" />
> 		<validate name="pass" />
> 	</constraint-set>
> </root>
>
> 3. My database definition file is:
>
> <auth-descriptor>
> 	<connection>postgresql</connection>
> 	<table name="usertbl">
> 		<select dbcol="username" request-param="user" to-session="user" />
> 		<select dbcol="userpassword" request-param="pass" 
> to-session="password" />
> 	</table>
> </auth-descriptor>
>
> 4. My pipe is:
>
> 			<map:match pattern="login">
> 				<map:act type="validator">
> 				<map:parameter name="descriptor" 
> value="context://beyarecords/content/def/login-def.xml"/>
> 				<map:parameter name="validate-set" value="add" />
> 				
> 					<map:act type="authenticator">
> 					<!-- Ok, login details are being checked. If they exist we get 
> logged into system -->
> 						<map:parameter name="descriptor" 
> value="context://beyarecords/content/def/auth-def.xml"/>
> 						<map:redirect-to uri="support/home"/>
> 					</map:act>
> 					
> 				</map:act>
> 				
> 				<!-- if not we get redirected back to the login page -->
> 				<map:redirect-to uri="login.html" />
> 			</map:match>
>
> 5. And my html form is:
>
> 		<form action="login" method="post">
> 		
> 			<table>
> 			<tr>
> 				<td align="right">User:</td>
> 				<td align="left"><input type="text" name="user" /></td>
> 			</tr>
> 			<tr>
> 				<td align="right">Password:</td>
> 				<td align="left"><input type="text" name="pass" /></td>
> 			</tr>
> 			<tr>
> 				<td colspan="2" align="center"><input type="submit" value="login" 
> /></td>
> 			</tr>
> 			</table>
> 		</form>
>
> What am I doing wrong here?
>
> regards
>
>
> Uzo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org