jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Urgent help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Urgent help needed" Watch "Urgent help needed" New topic

Urgent help needed


Joined: Sep 04, 2002
Posts: 7
I am a newbie to java technology.
i am creating java applications using visualage for java.
I have a EJB created and tested in WTE of visualage for java(VAJ) is working fine.
I have a servlet which is also developed in VAJ is also working fine.
When i am trying to call the EJB from the servlet, it does not show any error while creating the objects of the bean.
But when i am running it, it shows a Null pointer exception.
Both the EJB and servlet are in the same package.
Please help me in get rid of this problem by providing a solution to this.
If possible please provide me the exact syntax to call a EJB from servlet through a sample code which i can run on VAJ.
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
post the code you have now, only the relevant bits, ie bean creation from servlet, i'll see if i can help
maybe also post the stack trace
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Welcome to the JavaRanch! Please adjust your display name to meet
the JavaRanch Naming Policy. You can change it here.
and welcome to the JavaRanch!

Joined: Sep 04, 2002
Posts: 7
here is my servler coding
InitialContext jndiContext= new InitialContext();
Object ref= jndiContext.lookup("com/ibm/ivj/wte/samples/leapyear/loginHome");
loginHome home=(loginHome) PortableRemoteObject.narrow(ref,loginHome.class);
login loged= home.create();
The exceptions are handled perfectly.
The bean coding (the method that i have called)is here
System.out.println("just a try");
It does not shown any error while creating the object of the bean. but it gives the following exception
Error 500
An error has occured while processing request:http://localhost:8080/servlet/com.ibm.ivj.wte.samples.leapyear.usebean
Message: Server caught unhandled exception from servlet [com.ibm.ivj.wte.samples.leapyear.usebean]: null
the <ejb-ref> in web.xml is set as follows
<description>The test of java bean</description>
please reply for this as quick as possible.
with thanks,
I agree. Here's the link: http://aspose.com/file-tools
subject: Urgent help needed
jQuery in Action, 3rd edition