Hi,

I have a Entity Bean and A session bean facade.
My Client side look up works fine and I am able to retrieve the .count() method results. But when things involve serialization, like .create() or delete() or edit(), java.lang.reflect.UndeclaredThrowableException comes up..

Any pointers will be appreciated

package eb1;


import ejb.Customer;
import ejb.CustomerFacade;
import ejb.CustomerFacadeRemote;
import javax.ejb.EJB;

import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class Main {

    
    public static void main(String[] args) {
        
    Properties properties = new Properties();
      properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      properties.put("java.naming.factory.url.pkgs","=org.jboss.naming:org.jnp.interfaces");
      properties.put("java.naming.provider.url","localhost:1099");
    //Context context = new InitialContext(properties);
        // TODO code application logic here

      Context context;

      try
      {
          context =new InitialContext();
          CustomerFacadeRemote c=(CustomerFacadeRemote)context.lookup(CustomerFacade.RemoteJNDIName);
          System.out.println(c.count());
           
          Customer cs = c.find(1);
          System.out.println(cs.getName());
      }
      catch(Exception e)
      {
          System.out.println(e);
      }


    }

}

check your bean classes etc., do they have the proper signatures (including required exceptions)?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.