3 Replies Latest reply on Sep 29, 2014 3:39 AM by Wolf-Dieter Fink

    Cant' lookup an EJB via JNDI into java application under EAP6

    akrima Newbie

      I have Tow separated applications :

      1=> The first named : my-services (contains Remote Interfaces and Implementations) and this is an example:


      public class PersonFactory implements IPersonLocal, IPersonRemote {
                private static final long serialVersionUID = 1L;
                public voif findByCostumer(final String cId) {
                System.out.println("The client id is "+cId);


      I marked a clean and install (maven) and that generated a jar file in the target folder and I deployed it on the jboss EAP6:



      2=> I have a another java project named : MyProject with a main methode like this:


      public class RemoteEJBClient {

      public static void main(String[] args) throws Exception {

      private static void invokeStatelessBean() throws NamingException {

      final Hashtable jndiProperties = new Hashtable();
      final Context context = new InitialContext(jndiProperties);
      final String appName = "";
      final String moduleName = "my-services-all";
      final String distinctName = "";
      final String beanName = PersonFactory.class.getSimpleName();
      final String viewClassName = IPersonFactoryRemote.class.getName();
      final IPersonFactoryRemote statelessRemoteCalculator = (IPersonFactoryRemote) context
      .lookup("ejb:" + appName + "/" + moduleName + "/"
      + distinctName + "/" + beanName + "!" + viewClassName);


      but when I try to execute the programme it gives me the following errors :

      DEBUG org.jboss.logging - EjbNamingContext.java:59 - Logging Provider: org.jboss.logging.Log4jLoggerProvider
      INFO org
      .jboss.ejb.client - EJBClient.java:45 - JBoss EJB Client version 1.0.24.Final-redhat-1
      Exception in thread "main" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/ejb/EJBException
      at java
      .lang.ClassLoader.defineClass1(Native Method)
      at java
      at java
      at java
      at java
      at java
      at java
      at java
      .security.AccessController.doPrivileged(Native Method)
      at java
      at java
      at sun
      at java
      at org
      at org
      at org
      at org
      at javax

      I can't understand no think in that exceptions.

      Any explications & sollutions please.