users@glassfish.java.net

Glassfish does not find deployed class!

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 May 2009 10:18:11 PDT

Folks:

   I am using Glassfish V2.1.

   I am trying to deploy and use an EJB (Version 3). The EJB is part of a complete Enterprise application. It is within a JAR that is deployed with a WAR within an EAR.

   The EJB is pretty straightforward. It uses a local interface:

@Local
public interface CategoriesLocal
{
   public int save(Categories nwCategory);
}

and the bean itself is more a skeleton than anything else:

@Stateless
public class CategoriesFacade implements CategoriesLocal
{

    /**
     * Default constructor.
     */
    public CategoriesFacade() {
    }

   @Override
   public int save(Categories nwCategory) {
      return 0;
   }

The client code, at the moment, uses old- style JNDI (because DI is failing for some reason):

      try
      {
         InitialContext ctx = new InitialContext();
         CategoriesLocal local = (CategoriesLocal )ctx.lookup("com.path.CategoriesFacade");
         .
         .
         .

Based on documentation of EJB3 and Glassfish, the client code should be able to get an instance of the facade from the server. But when the client code is run, I get the following exception:

WARNING: javax.naming.NameNotFoundException: com.path.CategoriesFacade not found
        at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
        at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
        at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
        at
<other lines omitted for brevity>

Obviously, I am missing something. Can someone tell me why this is not working???
[Message sent by forum member 'factor_3' (factor_3)]

http://forums.java.net/jive/thread.jspa?messageID=347582