Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with WSAD5.1

 
John David
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I WROTE A STATELESS SESSION BEAN AND A SMALL CLIENT CLASS TO ACCESS THAT BEAN.
IAM GETTING THE FOLLOWING EXCEPTIONS AT RUN TIME

javax.naming.ConfigurationException: The property com.ibm.ws.naming.wsn.factory.initial is not set. The most likely cause is that the jar which contains the file com/ibm/websphere/naming/jndiprovider.properties cannot be found by the class loader.
at com.ibm.websphere.naming.WsnInitialContextFactory.init_implClassCtor(WsnInitialContextFactory.java:190)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:108)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:255)
at javax.naming.InitialContext.init(InitialContext.java:231)
at javax.naming.InitialContext.<init>(InitialContext.java:207)
at JrsClient1.main(JrsClient1.java:40)
Exception in thread "main"


CAN ANYBODY EXPLAIN ME WHAT IS THE REAL PROBLEM..
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It might be more pleasant if you use small caps in your posts.

Was the ejb successfully deployed?

Without making a client yourself, try use WSAD's Universal Test Client. Right-click on your class, and the option something like 'Launch Universal Test Client' will appear.

Once you are able to successfully transact using the UTC (Universal Test Client), then you know that the ejb is running ok, and that your problem is somewhere in the client.
 
John David
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i did not wrote any business logic in bean .
all the problem is with client code which is calling that home object.
my client code is like this


public class JrsClient1 {
public static void main(String ar[]) throws Exception
{

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");

System.out.println("after initial context factory");
env.put(Context.PROVIDER_URL,"iiop://localhost:2809");

Context context = new InitialContext(env);

Object ref = context.lookup("ejb/com/americanexpress/JRSStatelessHome");
System.out.println("after lookup");
JRSStatelessHome jhome= (JRSStatelessHome)PortableRemoteObject.narrow(ref,JRSStatelessHome.class);

JRSStateless jrsstateless=jhome.create();
System.out.println( jrsstateless.addJrs());
}

}



the exception im getting is

javax.naming.NameNotFoundException: ejb/com/americanexpress/JRSStatelessHome. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
at org.omg.CosNaming.Naming
ContextPackage.NotFoundHelper.read(NotFoundHelper.java:48)



pleaseeeeee help mee
 
Kurtcebe Eroglu
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John,

May this be the reason?
env.put(Context.PROVIDER_URL,"iiop://localhost:2809");



So your code works fine on the same machine your application server runs, but not on anywhere else? What happens when you put ip of your application server instead of "localhost" ?

Regards
Kurtcebe Eroglu
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic