Announcement Announcement Module
Collapse
No announcement yet.
STrange CGLIB and Tomcat issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STrange CGLIB and Tomcat issue

    I ran into a problem with tomcat 4.1.31.

    I am trying to create ProxyFactoryBean and add an advisor. I was trying to force Spring to create CGLIB proxies first by not specifying interfaces. It worked fine within a testing environment but hicks up in Tomcat 4.1.31. If I force spring to create JDK proxies everything works allright.

    The spring version is 1.2.3 CGLIB version is 2.1_2 nodep one. Is there something special about tomcat CGLIB I have to know? Does anyone know what might this be?

  • #2
    What exactly goes wrong?

    Rob

    Comment


    • #3
      I get an exception on instantiation of the proxy:

      Code:
      ... nested exception is org.aopalliance.
      aop.AspectException: null
      java.lang.IllegalStateException: Unknown callback class org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor
              at net.sf.cglib.proxy.CallbackUtils.getGenerator(CallbackUtils.java:102)
              at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:298)
              at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:246)
              at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:194)
              at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:150)
              at org.springframework.aop.framework.ProxyFactoryBean.getSingletonInstance(ProxyFactoryBean.java:256)
              at org.springframework.aop.framework.ProxyFactoryBean.setBeanFactory(ProxyFactoryBean.java:220)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:343)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:957)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:768)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:330)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBeanDefinition(BeanDefinitionValueResolver.java:147)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:96)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:957)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:768)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:330)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
              at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:957)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:768)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:330)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:239)
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
              at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:548)
              at com.opensymphony.xwork.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:134)
              at com.opensymphony.xwork.ObjectFactory.buildAction(ObjectFactory.java:87)
              at com.opensymphony.xwork.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:168)
              at com.opensymphony.xwork.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:228)
              at com.opensymphony.xwork.config.providers.XmlConfigurationProvider.loadConfigurationFile(XmlConfigurationProvider.java:567)
              at com.opensymphony.xwork.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:124)
              at com.opensymphony.xwork.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:85)
              at com.opensymphony.xwork.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:56)
              at com.opensymphony.xwork.DefaultActionProxyFactory.setupConfigIfActionIsCommand(DefaultActionProxyFactory.java:58)
              at com.opensymphony.xwork.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:43)
              at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:270)
              at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:237)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627)
              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306)
              at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:391)
              at org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
              at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
              at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
              at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
              at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
              at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
              at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
              at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
              at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
              at java.lang.Thread.run(Thread.java:534)

      Comment


      • #4
        Is it possible that you have multiple versions of Spring or CGLIB on the classpath?

        Rob

        Comment


        • #5
          That was my suspicion at first, so I checked for it. But I do not seem to be able to find two versions of either spring or cglib on my classpath (i.e. in in WEB-INF/lib and common/lib of tomcat) ... no duplication there is just one spring 1.2.3 and one cglib 2.1_2 nodep and both are in WEB-INF/lib.

          Comment


          • #6
            This was totaly stupid of me. My maven pom had dependency on 2.0 cglib :oops: Changed to 2.1.2 and everything started to work. Thanks for your help

            Comment

            Working...
            X