Error in simple session bean ..................
Hi friends,
i am trying a simple HelloWOrld EJb on Websphere Applicatiopn server 6.1.
Can any one plz help me to solve this issue.
here is the client code which i have written.
package com.ibm.pck;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import com.ibm.ejb.example;
import com.ibm.ejb.exampleHome;
public class exampleClient {
public static void main(String args[]) {
try {
Properties props = new Properties();
props.put(Context.INITIAL<em>CONTEXT</em>FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory ");
props.put(Context.PROVIDER_URL, "iiop://localhost:900");
Context initialContext = new InitialContext(props);
Object objref = initialContext.lookup("ejb/com/ibm/ejb/exampleHome"); <br />
exampleHome home = (exampleHome)PortableRemoteObject.narrow(objref, exampleHome.class); <br />
example myHelloWorld = home.create(); <br />
String message = myHelloWorld.sayHello(); <br />
System.out.println(message); <br />
}
catch (Exception e) {
e.printStackTrace(); <br />
System.exit(2);
}
}
}
i am getting these errors while i am runnign above client.
javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory ]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:669)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:259)
at javax.naming.InitialContext.init(InitialContext.java:235)
at javax.naming.InitialContext.<init>(InitialContext.java:209)
at com.ibm.pck.exampleClient.main(exampleClient.java:21)
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory
at java.lang.Class.forName(Class.java:164)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:57)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:666)
... 4 more
View Answers
February 14, 2011 at 2:49 PM
Ads
Related Tutorials/Questions & Answers:
Error in simple session bean ..................
Error in
simple session bean .................. Hi friends,
i am trying a
simple HelloWOrld EJb on Websphere Applicatiopn server 6.1.
Can any one plz help me to solve this issue.
here is the client code which i have
Stateless Session Bean Example Error
Stateless
Session Bean Example Error Dear sir,
I'm getting following
error while running StatelessSessionBean example on Jboss. Please help me...)
Please visit the following link:
Stateless
Session Bean Example
Advertisements
Session Bean
is a
Session bean
A
session bean is the
enterprise
bean that directly.... A
session bean represents a single client
accessing the enterprise application.... A
session bean makes an interactive
session only
for a single client and shields
Stateful Session Bean Example
Stateful
Session Bean Example
 ...
using stateful
session bean.
The purpose of account is to performs two...
bean:
The enterprise
bean in our example is a statelful
session bean called
Session Bean Example
Session Bean Example I want to know that how to run ejb module by jboss 4.2.1 GA (
session bean example by jboss configuration )?
Please visit the following link:
http://www.roseindia.net/javabeans
Stateless Session Bean Example
Stateless
Session Bean Example
 ... stateless
session bean.
The purpose of example is to performs the mathematical...
bean:
The enterprise
bean in our example is a stateless
session bean called
Stateless Bean Error
Stateless
Bean Error Ejb stateless
bean giving following
error,please help me.
11:49:54,894 INFO [STDOUT]
Error:$Proxy72 cannot be cast... are providing you a link that will illustrate you more clearly about Stateless
Bean
Issue in Stateless session bean example
Issue in Stateless
session bean example Hi Team,
I tried your Stateless
session bean example in the path http://www.roseindia.net/ejb/examples-of-StatelessBean.shtml. I got the below exception can you plese guide to rectify
Writing Calculator Stateless Session Bean
Writing Calculator Stateless
Session Bean...
javax.ejb.EJBObject. Remote interface is the client view of
session bean.
Methods defined... for our Calculator
Session Bean:
/*
* 
Deploying and testing Stateless Session Bean
Deploying and testing Stateless
Session Bean...
Session Bean developed in the last section. We will use ant
build tool to build... learnt how to deploy
Session Bean and
test on Web Logic Server
Chapter 4. Session Bean Life Cycle
Chapter 4.
Session Bean Life CyclePrev Part I. ... the life cycle of a
stateful or stateless
session bean instance.
Stateful
Session Bean
A
session bean
Stateful and Stateless Session Bean Life Cycle
Understanding Stateful and
Stateless
Session Bean Life Cycle...
Bean Life cycle
There are two stages in the Lifecycle of Stateless
Session Bean... container
creates the new instance of the
Bean and then sets the
session context
Rose India Stateless Session Bean Example Question
Rose India Stateless
Session Bean Example Question Hi Team,
Is this example can be compiled using NetBeans and Glass Fish ? Actually, in descriptor .xml file it is shown that it can be run by using JBoss and Apache Ant. If I
Chapter 2. Client View of a Session Bean
or examples about the client view of a
session
bean's local and remote home interfaces, including the code used by a client to locate
a
session bean's... for the Cart
session bean can be located using the following code segment
how to get session object in simple java class??
how to get
session object in
simple java class?? i am fallowing a
simple mvc architecture.
actually my problem is....
i am using 4 classes in my... into
session.
so, please tell me, how to get the
session object (GroupPojo) in a
simple
session
session Which methods can be invoked by the container on a stateless
session bean