2 Replies Latest reply on Jul 8, 2009 9:48 AM by alberto13

    java.lang.NoClassDefFoundError: [Lorg/jboss/aop/advice/Inter

    tfleming

      I have a SLSB deployed on JBoss 4.0.5.GA with the EJB 3.0_RC9 Patch. I've written a JUnit class to make calls to the session bean.

      Session Bean Interface

      package com.gan.visuality.security.service;
      
      public interface SecurityService {
       public SessionId authenticate(String callerId, String password);
      }


      Session Bean
      package com.gan.visuality.security.service;
      
      import javax.ejb.*;
      import javax.persistence.*;
      
      @Stateless(name="SecurityService")
      @Remote
      public class SecurityServiceBean implements SecurityService {
       @PersistenceContext
       protected EntityManager em;
      
       public SecurityServiceBean(){
       }
      
       public SessionId authenticate(String callerId, String password){
       return null;
       }
      }


      JUnit Test Class
      package test.com.gan.visuality.security.service;
      
      import static org.junit.Assert.*;
      
      import org.junit.Before;
      import org.junit.Test;
      
      import javax.ejb.EJB;
      import javax.naming.InitialContext;
      
      import com.gan.visuality.security.service.SecurityService;
      
      public class SecurityServiceTest extends junit.framework.TestCase {
       @EJB
       static SecurityService service;
      
       private static InitialContext ctx;
       private static SessionId sessId;
      
       @Before
       public void setUp() throws Exception {
       ctx = new InitialContext();
       service = (SecurityService) ctx.lookup("gan_server_g2/SecurityService/remote");
       }
      
       @Test
       public void testAuthenticate() {
       sessId = service.authenticate("testuser", "testpassword");
       assertNotNull("Session is not null: ", sessId);
       }
      }


      When I run the test I get the following:
      Testcase: testAuthenticate took 0.453 sec
      Caused an ERROR
      [Lorg/jboss/aop/advice/Interceptor;
      java.lang.NoClassDefFoundError: [Lorg/jboss/aop/advice/Interceptor;
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2259)
      at java.lang.Class.getDeclaredField(Class.java:1852)
      at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1582)
      at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
      ...


      The Interceptor class is in a server deployment jar. I'm a bit unclear why the client application would be looking for it. Any ideas?

      Thanks