You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by radha devi <ka...@yahoo.com> on 2004/07/19 13:28:08 UTC

Null Pointer exception in retrieving value from web.xml

Hi,
 
I am using Cactus 1.6.1 to test Servlet class. I am testing in weblogic6.1 app server. The method called for testing calls another servlet class which retrieves parameter value defined in web.xml file.
Here Cactus returns Null Pointer exception. what can be the reason?
 
Thanks
 
Radha


		
---------------------------------
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.

RE: Null Pointer exception in retrieving value from web.xml

Posted by radha devi <ka...@yahoo.com>.
thanks vincent

Vincent Massol <vm...@pivolis.com> wrote:Hi Radha,

2 things:

1/ Are you sure you've called "myServlet.init(config)" in your test, as
explained on
http://jakarta.apache.org/cactus/writing/howto_testcase_servlet.html

2/ If you need more help you'll need to show us the full stack trace of the
error...

-Vincent

> -----Original Message-----
> From: radha devi [mailto:kangabamradha@yahoo.com]
> Sent: lundi 19 juillet 2004 13:28
> To: cactus-user@jakarta.apache.org
> Subject: Null Pointer exception in retrieving value from web.xml
> 
> Hi,
> 
> I am using Cactus 1.6.1 to test Servlet class. I am testing in weblogic6.1
> app server. The method called for testing calls another servlet class
> which retrieves parameter value defined in web.xml file.
> Here Cactus returns Null Pointer exception. what can be the reason?
> 
> Thanks
> 
> Radha
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.


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



		
---------------------------------
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!

RE: what are the different possibilities of calling a servlet class

Posted by Vincent Massol <vm...@pivolis.com>.
> -----Original Message-----
> From: radha devi [mailto:kangabamradha@yahoo.com]
> Sent: mardi 20 juillet 2004 06:22
> To: Cactus Users List
> Subject: what are the different possibilities of calling a servlet class
> 
> Hi
> 
> To test a servlet, do I always need to create an instance of the servlet
> or is there any other way to call the servlet.
> 
> Is there way to call the servlet class through URL?

No! Cactus is about *unit testing* not about functional testing. We're not
doing black box testing but white box testing. 

Think about how you unit test any POJO. You instantiate the class and then
call the method do test. Same for Cactus.

If you wish to write functional tests, do not use Cactus. You'll find better
tools elsewhere.

-Vincent


what are the different possibilities of calling a servlet class

Posted by radha devi <ka...@yahoo.com>.
Hi

To test a servlet, do I always need to create an instance of the servlet or is there any other way to call the servlet. 
 
Is there way to call the servlet class through URL?
 
Thanks!
Radha

		
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

RE: Null Pointer exception in retrieving value from web.xml

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Radha,

2 things:

1/ Are you sure you've called "myServlet.init(config)" in your test, as
explained on
http://jakarta.apache.org/cactus/writing/howto_testcase_servlet.html

2/ If you need more help you'll need to show us the full stack trace of the
error...

-Vincent

> -----Original Message-----
> From: radha devi [mailto:kangabamradha@yahoo.com]
> Sent: lundi 19 juillet 2004 13:28
> To: cactus-user@jakarta.apache.org
> Subject: Null Pointer exception in retrieving value from web.xml
> 
> Hi,
> 
> I am using Cactus 1.6.1 to test Servlet class. I am testing in weblogic6.1
> app server. The method called for testing calls another servlet class
> which retrieves parameter value defined in web.xml file.
> Here Cactus returns Null Pointer exception. what can be the reason?
> 
> Thanks
> 
> Radha
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.