users@glassfish.java.net

Re: Access EJB within a servlet

From: Sahoo <Sahoo_at_Sun.COM>
Date: Mon, 10 Nov 2008 10:56:43 +0530

You need to package the remote interface class and its dependencies in
the war file. Have you done that?

glassfish_at_javadesktop.org wrote:
> Hi dear developers :)
>
> I deployed my ejb called SessionManager through glassfish. If I try to access it using a Java application client it works perfectly, but if I try using a Servlet (deployed into the same glassfish instance) I get: ejb ref resolution error for remote business interfacehelb.test.ejb.SessionManager [Root exception is java.lang.ClassNotFoundException: helb.test.ejb.SessionManager]
> I believe this issue is related to glassfish as my source code works in Java app mode.
> Anyway here's what I do:
>
> [code]
> InitialContext ictx;
> SessionManager ism;
> try {
> ictx = new InitialContext();
> ism = (SessionManager) ictx.lookup("ejb/SessionManagerJNDI");
>
> } catch (NamingException e) {
>
> e.printStackTrace();
> }
> [/code]
> Thanks ;)
> [Message sent by forum member 'goundy' (goundy)]
>
> http://forums.java.net/jive/thread.jspa?messageID=315689
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>