at javax.naming.InitialContext.lookup(Unknown Source) at SessionClientSample.main(SessionClientSample.java:42)
The client code goes like this:
line 38> Properties env = new Properties(); line 39> env.put "java.naming.factory.initial", "desisoft.ejb.client.JRMPFactory" ); line 40> env.put( "desisoft.ejb.nameServer1", "localhost:2050" );
line 41> Context ctx = new InitialContext( env );
line 42> StockQuotesHome home = (StockQuotesHome) PortableRemoteObject.narrow( ctx.lookup( "StockQuotes" ), StockQuotesHome.class );
System.out.println(" passed here 3");
I'm using Blazix application server.
Has anybody faced similar problems? How to resolve this one? I'm sure this exception is something related to security policy. Could anybody please help provide some insight about setting security policy in JRE.
I tried your suggestion but its still not working. Have you tried this type of client program. If so, can you please paste the lines where you initialize the properties and obtain the home interface and obtain ejb context?
I also figured out the other problems I was having.
1.) The JNDI name had to be specified in JBOSS.xml and the lookup has to be exactly what you specify in the deployment descriptors.
2.) The class path in the client has to point to the jar file or a directory structure consistent with your package name. The class loader doesn't like to find the class file in a local directory that doesn't have the same directory structure as the classpath.
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop