• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

EJB Runtime error

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Rashmee H S",
Please check your private messages.
-Ben
 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to setup your InitialContext properly.

 
reply
    Bookmark Topic Watch Topic
  • New Topic