aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes How can my Applet get in touch with an EJB onJboss? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How can my Applet get in touch with an EJB onJboss?" Watch "How can my Applet get in touch with an EJB onJboss?" New topic
Author

How can my Applet get in touch with an EJB onJboss?

Sanjit Singh
Greenhorn

Joined: Nov 12, 2001
Posts: 27
Hi,
I want my applet in the web container to get in touch with an EJB on the Jboss application server.
Can someone please tell me the steps involved in doing the above mentioned?
How is the JNDI naming lookup handled?
As of now, I have the following peace of code in the init() method of my applet and it doesnt work:
Properties props= new Properties();
props.put (Context.PROVIDER_URL,"localhost:1099");
props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
InitialContext ctx = new InitialContext();
Object objref = ctx.lookup("TraderController");
TraderControllerHome home = ..................
I would be grateful if somebody could shed some light on it and help me out. Thanks!
Regards,
Sanjit
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
One possible problem is that the applet is not running in the web container. The applet is running in the applet container (either Sun's applet Runner or the Java plugin in a browser). Odds are good that your problem is one of classpaths -- you need to make sure all of the JBoss classes are in your applet's classpath (meaning they probably need to be loaded by the applet, e.g. the applet tag should reference all of the JAR files necessary).
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can my Applet get in touch with an EJB onJboss?
 
Similar Threads
calling ejb from tomcat
I have deployed my ejb with Weblogic and I have a problem with my client
Call secured EJB from "unsecured" web with custom credentials instead of "BASIC AUTH"ed credentials
problem with ejb client in Jboss
Looking up an EJB