2 Replies Latest reply on Jul 21, 2010 7:21 PM by Anders Åberg

    Exception after upgrading to GlassFish 3.0.1: Duplicate interceptor class definition

    Anders Åberg Newbie

      Hi guys


      I posted this question in the Glassfish forums as well, but didn't get any response so I'm trying here as well.
      GlassFish forum link


      We have a security interceptor that performs security checks on methods. This works as expected on GF3.0.0, but after upgrading to 3.0.1 we get an exception when deploying the app:


      org.glassfish.deployment.common.DeploymentException: Duplicate interceptor class definition when bindingorg.jboss.weld.bean-/C:/Dev/glassfishv3.0.1/glassfish/domains/domain1/eclipseApps/admin/-Interceptor-no.evote.service.security.SecurityInterceptor on AROUND_INVOKE
      at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:167)
      at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:125)
      at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:224)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
      at java.lang.Thread.run(Thread.java:619)



      We have a @Securable annotation that looks like this:




      @Target( { ElementType.TYPE, ElementType.METHOD })
      @Retention(RetentionPolicy.RUNTIME)
      @InterceptorBinding
      public @interface Securable {
      }



      The interceptor is defined like this:



      @Interceptor
      @Securable
      public class SecurityInterceptor implements Serializable {
      
      @AroundInvoke
      public Object name(final InvocationContext ctx) {
      ....
      



      And the interceptor is also specified in beans.xml:


      <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
           <interceptors>
                 <class>no.evote.service.security.SecurityInterceptor</class>
           </interceptors>
      </beans>



      It should be just like it is done here and referenced here.


      Glassfish 3.0.0 has a module weld-osgi-bundle version 1.0.0.SP4 while 3.0.1 has version 1.0.1.SP3. I have googled the error but not found any other mentions of it.


      Any idea what this error means?


      Regards,
      Anders