aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes What is happenning? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "What is happenning?" Watch "What is happenning?" New topic
Author

What is happenning?

Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
hi

I dont know what i am missing to note... i installed j2ee and when i ran the session bean(stateless) it is giving me this error for some reason

E:\EJBHeadFirst\Projects\SimpleSession>java -cp {$CLASSPATH}:"e:\EJBHeadFirst\Pr
ojects\SimpleSession";"e:\EJBHeadFirst\Projects\SimpleSession\SimpleSessionModul
e.jar";"d:\applications\Sun\AppServer\lib\j2ee.jar"; AdviceClient
other exception5
java.lang.NullPointerException
at AdviceClient.go(AdviceClient.java:35)
at AdviceClient.main(AdviceClient.java:13)

The client code is simple i included the variables just to make sure where it is failing

import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import javax.ejb.*;
import java.util.*;

public class AdviceClient
{


public static void main (String args[])
{
new AdviceClient().go();}

public void go()
{
int i =0,j=0;
try{
/*Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitCo ntextFactory");
env.put(Context.PROVIDER_URL, "localhost:1050");*/
i=2;
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
p.put(Context.PROVIDER_URL, "iiop://localhost:3700");

i=3;
Context ic = new InitialContext(p);
Object o= ic.lookup("StatelessSession");

i=4;
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o,AdviceHome.class);

i=5;
AdviceComponent advisor= home.create();
i=6;
do{
System.out.println(advisor.getAdvice());
j+=1;
}while(j<4);
}catch(NamingException d)
{
System.out.println("Naming");
}
catch (CreateException ex)
{
System.out.println("Create "+i);
}
catch (RemoteException e)
{
System.out.println("Remote");
}
catch(Exception ee3)
{
System.out.println("other exception"+ i);
ee3.printStackTrace();
}
}
why it should fail here "AdviceComponent advisor= home.create();"
the same code was running fine for me before (i had uninstalled and installed again)

Something is missing my eyes. can someone help?
thanks
rajendar medishetty
Greenhorn

Joined: Jun 09, 2005
Posts: 6
Hi

I think ur bean is not properly deployed try to redeploy and try ..u will get it.?Ur unable to find the home interface...

Thanks
Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
Thanks for your reply.
For some reason ikept getting this error when I tried with 1.4.02 i uninstalled it and installed the older verion 1.4.01 and it worked.
Didnt get much time to check the new version.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is happenning?
 
Similar Threads
NoInitialContextException:
JNDI lookup problem in advice client
Advice Client problem
Client does not run
Client does not run - NoInitialContextException !