This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

STrange CGLIB and Tomcat issue

Aug 29th, 2005, 03:25 PM

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?

Comment

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

Comment

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.