Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB Runtime error

 
Rashmee H S
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am getting this error while running my Ejb application
plese help me......
I done these things in my application

jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<display-name>sessionBeanExp</display-name>
<enterprise-beans>
<session>
<display-name>CcountBeanExp</display-name>
<ejb-name>CcountBean</ejb-name>
<home>vtcbean.CcountHome</home>
<remote>vtcbean.CcountObject</remote>
<ejb-class>vtcbean.CcountBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<security-identity>
<description></description>
<run-as-principal></run-as-principal>
<use-caller-identity></use-caller-identity>
</security-identity>
<jndi-name>sessionBean/remote</jndi-name>
<local-jndi-name>sessionBean/local</local-jndi-name>
</session>
</enterprise-beans>
</jboss>

and getting "sessionBean/Bean" as My Jndi-name
and in my client application
InitialContext ic=new InitialContext();
Object ref=ic.lookup("sessionBean/remote");
System.out.println(ref);
CcountHome home=(CcountHome)PortableRemoteObject.narrow(ref,CcountHome.class);
CcountObject count=home.create();
System.out.println(str);
System.out.println("Upper is"+count.upper(str));
System.out.println("Lowe is"+count.lower(str));
System.out.println("Spaces are"+count.space(str));
System.out.println("Characters are"+count.space(str));
After compiling if i run this application it will give this error
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at ejbUsage.UseEjb.main(UseEjb.java:16)

Please help me .....................

[ June 06, 2008: Message edited by: Rashmee Hs ]
[ June 06, 2008: Message edited by: Rashmee Hs ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Rashmee Hs",
Please check your private messages regarding an important administrative matter.
-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Amit M Tank
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to setup your InitialContext properly.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic