4 Replies Latest reply on Jan 29, 2008 5:03 PM by Reind D

    Error: SessionBeanInterceptor.postConstruct

    Reind D Newbie

      After adding a jboss-app.xml file to my ear/META-INF/ dir I've started seeing the following error when starting jboss 4.2.2:

      java.lang.RuntimeException: @javax.annotation.PostConstruct annotated method has the wrong signature - public void org.jboss.seam.intercept.SessionBeanInterceptor.postConstruct(javax.interceptor.InvocationContext)
      at org.jboss.ejb3.interceptor.InterceptorInfoRepository$AnnotationInitialiser.resolveLifecycleMethod(InterceptorInfoRepository.java:741)


      The javadoc says:
      The method MUST NOT have any parameters except in the case of EJB interceptors in which case it takes an InvocationC ontext object as defined by the EJB specification.

      http://java.sun.com/javaee/5/docs/api/javax/annotation/PostConstruct.html

      So, it looks ok (well, obviously, as it worked without the jboss-app.xml). Any ideas what it could be? Perhaps related to the jars I've packaged?

      activation-1.1.jar
      antlr-2.7.6.jar
      asm-2.2.jar
      asm-attrs-1.5.3.jar
      avalon-framework-4.1.3.jar
      cglib-2.1_3.jar
      commons-beanutils-1.7.0.jar
      commons-codec-1.3.jar
      commons-collections-3.2.jar
      commons-digester-1.8.jar
      commons-el-1.0.jar
      commons-fileupload-1.0.jar
      commons-lang-2.1.jar
      commons-logging-1.1.jar
      commons-validator-1.3.1.jar
      dom4j-1.6.1-jboss.jar
      el-api-1.0.jar
      hibernate-3.2.4.sp1.jar
      hibernate-annotations-3.3.0.ga.jar
      hibernate-commons-annotations-3.0.0.ga.jar
      hibernate-entitymanager-3.3.1.ga.jar
      hibernate-validator-3.0.0.GA.jar
      javassist-3.3.ga.jar
      jboss-el-2.0.0.GA.jar
      jboss-seam-mail-2.0.0.GA.jar
      jboss-seam-ui-2.0.0.GA.jar
      jsf-facelets-1.1.14.jar
      jstl-1.1.0.jar
      jta-1.0.1B.jar
      logkit-1.0.1.jar
      mail-1.4.jar
      oro-2.0.8.jar
      postgresql-8.2-507.jdbc3.jar
      richfaces-api-3.1.2.SP1.jar
      richfaces-impl-3.1.2.SP1.jar
      richfaces-ui-3.1.2.SP1.jar
      slf4j-api-1.4.2.jar
      slf4j-jdk14-1.3.0.jar
      slf4j-log4j12-1.4.2.jar
      tomahawk-1.1.6.jar
      


      My jboss-app.xml looks like:
      <!DOCTYPE jboss-app
      PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
      "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
      
      <jboss-app>
       <loader-repository>
       seam.jboss.org:loader=test.ear
       </loader-repository>
      </jboss-app>



        • 1. Re: Error: SessionBeanInterceptor.postConstruct
          Pete Muir Master

          Yes. Most of those jars are in the app server. Use seam-gen to generate a skeleton project or use an example to see what libraries you should package in your ear.

          • 2. Re: Error: SessionBeanInterceptor.postConstruct
            Reind D Newbie

            Hi Pete, I'm very grateful for your reply. I've significantly paired down the jars that I'm packaging:

            asm-2.2.jar
            asm-attrs-1.5.3.jar
            commons-beanutils-1.7.0.jar
            commons-digester-1.8.jar
            commons-el-1.0.jar
            commons-fileupload-1.0.jar
            commons-lang-2.1.jar
            commons-validator-1.3.1.jar
            hibernate-validator-3.0.0.GA.jar
            jboss-el-2.0.0.GA.jar
            jboss-seam-mail-2.0.0.GA.jar
            jboss-seam-ui-2.0.0.GA.jar
            jsf-facelets-1.1.14.jar
            oro-2.0.8.jar
            richfaces-api-3.1.2.SP1.jar
            richfaces-impl-3.1.2.SP1.jar
            richfaces-ui-3.1.2.SP1.jar
            slf4j-api-1.4.2.jar
            slf4j-jdk14-1.3.0.jar
            slf4j-log4j12-1.4.2.jar
            tomahawk-1.1.6.jar
            velocity-1.5.jar
            


            But I still get this error
            ObjectName: jboss.j2ee:service=EJB3,module=jboss-seam-2.0.0.GA.jar
             State: FAILED
             Reason: java.lang.RuntimeException: @javax.annotation.PostConstruct annotated method has the wrong signature - public void org.jboss.seam.intercept.SessionBeanInterceptor.postConstruct(javax.interceptor.InvocationContext)


            What else can I try?

            • 3. Re: Error: SessionBeanInterceptor.postConstruct
              Pete Muir Master

              Are you sure you aren't deploying an extra copy of the ejb3 api? thats what it looks like to me.

              • 4. Re: Error: SessionBeanInterceptor.postConstruct
                Reind D Newbie

                Pete,

                That was it, we were using another 3rd party jar that I didnt mention that, for some reason, had it's own javax.interc
                eptor.InvocationContext.class that was getting loaded first.

                Works now. Thanks so much for your help.