Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Deployment issue with BTAdapter

Help
Pragnesh
2009-07-11
2013-05-09
  • Pragnesh
    Pragnesh
    2009-07-11

    Hi Jason,

    Have you ever seen this issue?

    <Jul 10, 2009 7:07:29 PM PDT> <Warning> <HTTP> <BEA-101162> <User defined listener org.springframework.web.context.ContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.mtgi.analytics.servlet.ServletRequestBehaviorTrackingAdapter#0': Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.mtgi.analytics.servlet.ServletRequestBehaviorTrackingAdapter]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given.
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.mtgi.analytics.servlet.ServletRequestBehaviorTrackingAdapter#0': Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.mtgi.analytics.servlet.ServletRequestBehaviorTrackingAdapter]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:217)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:465)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(Unknown Source)
        Truncated. see log file for complete stacktrace
    org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.mtgi.analytics.servlet.ServletRequestBehaviorTrackingAdapter]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
        at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:213)
        at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:490)
        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:365)
        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:325)
        Truncated. see log file for complete stacktrace
    java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
        at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:718)
        at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:499)
        at net.sf.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        Truncated. see log file for complete stacktrace

     
    • Jason Trump
      Jason Trump
      2009-07-11

      the issue is that you have AOP configuration that is attempting to decorate a beet class that can't be automatically decorated. what are you using AOP for, and how is it configured?  transactions?

       
    • Pragnesh
      Pragnesh
      2009-07-11

      Hi Jason,

      This issue is weird if I uncomment any of the 2 beans declared at the end then this issue occurs. Not sure why?

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:bt="http://www.mantis-tgi.com/schema/bt/1.1"
          xsi:schemaLocation=" http://www.springframework.org/schema/beans
                  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                  http://www.springframework.org/schema/tx
                  http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
                  http://www.springframework.org/schema/aop
                  http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
                  http://www.mantis-tgi.com/schema/bt/1.1
                  http://www.mantis-tgi.com/schema/bt/mtgi-bt-1.1.xsd"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          default-autowire="byName"
          xmlns:tx="http://www.springframework.org/schema/tx"
          xmlns:aop="http://www.springframework.org/schema/aop">

          <aop:config proxy-target-class="true"/>
          <aop:aspectj-autoproxy/>
          <bt:manager application="beet-point-jsf"
              flush-schedule="0/30 * * * * ?"
              track-method-expression="execution(public * demo..*(..))">
              <!--  track-method-expression="execution(public * oracle.samples.wlp.jsf.portlets.login.JSFLoginPortletRequestBean.*(..))" -->
              <bt:xml-persister binary="false" compress="false" file="xxx/gcp_domain/servers/AdminServer/logs/beet-login-perf.xml"/>       
              <bt:http-requests parameters="_pageLabel"/>
          </bt:manager>
          <bean class="demo.DemoUser" id="demoUser" scope="request" >
              <property name="customer" ref="CustomerDAO"/>
          </bean>
         
          <bean id="auditManager" class="com.asdf.gse.bt.audit.AuditManagerSOPImpl"/>
          <bean id="btSessionContext" class="com.asdf.gse.bt.BeetExtendedSessionContext"/>
         
          <bean id="auditAspect" class="com.asdf.gse.bt.audit.AuditAspect">
              <property name="auditType" value="Customer"/>
              <property name="auditManager" ref="auditManager"/>
              <property name="sessionContext" ref="btSessionContext"/>
              <property name="application" value="GCP"/>
          </bean>
         
          <bean id="CustomerDAO" class="demo.dao.CustomerDAO"></bean>
          <!-- bean id="CustomerExtensionAdvisor" class="com.asdf.gse.bt.audit.AuditableCustomerExtensionAdvisor" scope="prototype"/ -->
          <!-- bean id="DefaultAuditableAdvisor" class="com.asdf.gse.bt.audit.AuditableToStringAdvisor" scope="prototype"/ -->
         
          </bean>
      </beans>

      The beans extend as follows
      public class AuditableToStringAdvisor extends DefaultIntroductionAdvisor {

      Not sure why if I put these advisors as beans spring thinks I am trying to decorate beet class. Any clue?

       
      • Jason Trump
        Jason Trump
        2009-07-19

        one (or both) of your advisor classes must be applying advice to beet's beans.  just a guess, but in looking at the javadoc for DefaultIntroductionAdvisor:

          Simple IntroductionAdvisor implementation that by default **applies to any class**.

        this is most likely not what you want.  You could consider to overriding the getClassFilter() method to narrow the set of classes you are trying to advise.  alternatively you could try using pointcut annotations as described in section 6.2.3 of the spring manual (http://static.springsource.org/spring/docs/2.5.x/reference/aop.html); or configure pointcuts in your applicationContext.xml.

        hope that helps,
        jason