wood burning stoves 2.0*
The moose likes Websphere and the fly likes problem with WSAD5.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "problem with WSAD5.1" Watch "problem with WSAD5.1" New topic
Author

problem with WSAD5.1

John David
Greenhorn

Joined: Aug 17, 2006
Posts: 29
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

Joined: Feb 26, 2005
Posts: 2057
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

Joined: Aug 17, 2006
Posts: 29
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

Joined: Jan 30, 2007
Posts: 30
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: problem with WSAD5.1