|
From: Kristof J. <dy...@on...> - 2005-02-17 14:44:57
|
Hi, do I see it right that LazyInitTargetSource with Spring 1.4 cannot be applied to factory objects? Concretely, I'd want to initialize the configured JaxRpcPortProxyFactoryBean in a lazy way and it both looks like it *is* getting initalized on startup and it throws an exception about trying to subclass a final class.. (see the exception at the end). I'd need to figure out that issue as soon as possible, so any help's greatly appreciated. Any workarounds might also help.. thanks much in advance, Kristof org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rasPublicService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.aopalliance.aop.AspectException: null java.lang.IllegalArgumentException: Cannot subclass final class class $Proxy0 at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:438) 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:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:368) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:280) at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:176) at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:137) at org.springframework.aop.framework.ProxyFactoryBean.getSingletonInstance(ProxyFactoryBean.java:241) at org.springframework.aop.framework.ProxyFactoryBean.setBeanFactory(ProxyFactoryBean.java:201) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:700) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:668) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:282) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:131) at org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationContext(ContextLoaderPlugIn.java:352) at org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext(ContextLoaderPlugIn.java:295) at org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn.java:224) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220) at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:445) at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:150) at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:458) at org.mortbay.http.HttpServer.start(HttpServer.java:663) at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282) at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104) at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75) |
|
From: Juergen H. <ju...@in...> - 2005-02-22 13:55:39
|
This is not a general problem with LazyInitTargetSource on a FactoryBean: It's rather a problem with LazyInitTargetSource on a JDK proxy as target, if no proxy interfaces have been specified. Try specifying an appropriate interface on your ProxyFactoryBean definition (via the "proxyInterfaces" bean property); this should automatically lead to a JDK proxy being generated there too. BTW, why do you prefer your JaxRpcPortProxyFactoryBean to be lazily initialized? To avoid checking the WSDL at startup? It would maybe make sense to add a lazy initialization option to Spring's JaxRpcPortProxyFactoryBean itself in this case (I'll consider this). Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Kristof Jozsa Sent: Thursday, February 17, 2005 3:45 PM To: spr...@li... Subject: [Springframework-developer] is LazyInitTargetSource on factories possible? Hi, do I see it right that LazyInitTargetSource with Spring 1.4 cannot be applied to factory objects? Concretely, I'd want to initialize the configured JaxRpcPortProxyFactoryBean in a lazy way and it both looks like it *is* getting initalized on startup and it throws an exception about trying to subclass a final class.. (see the exception at the end). I'd need to figure out that issue as soon as possible, so any help's greatly appreciated. Any workarounds might also help.. thanks much in advance, Kristof org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rasPublicService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.aopalliance.aop.AspectException: null java.lang.IllegalArgumentException: Cannot subclass final class class $Proxy0 at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:438) at net.sf.cglib.transform.TransformingClassGenerator.generateClass(Transforming ClassGenerator.java:33) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy .java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java: 215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:368) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:280) at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.jav a:176) at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.jav a:137) at org.springframework.aop.framework.ProxyFactoryBean.getSingletonInstance(Prox yFactoryBean.java:241) at org.springframework.aop.framework.ProxyFactoryBean.setBeanFactory(ProxyFacto ryBean.java:201) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:145) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .autowireByName(AbstractAutowireCapableBeanFactory.java:700) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .populateBean(AbstractAutowireCapableBeanFactory.java:668) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory .createBean(AbstractAutowireCapableBeanFactory.java:260) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:221) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra ctBeanFactory.java:145) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst antiateSingletons(DefaultListableBeanFactory.java:282) at org.springframework.context.support.AbstractApplicationContext.refresh(Abstr actApplicationContext.java:317) at org.springframework.web.context.support.AbstractRefreshableWebApplicationCon text.refresh(AbstractRefreshableWebApplicationContext.java:131) at org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationConte xt(ContextLoaderPlugIn.java:352) at org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext (ContextLoaderPlugIn.java:295) at org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn. java:224) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java: 839) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220) at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.j ava:445) at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplic ationHandler.java:150) at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext. java:458) at org.mortbay.http.HttpServer.start(HttpServer.java:663) at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282) at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104) at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75) ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Scott B. <sco...@ru...> - 2005-02-22 15:45:56
|
Juergen Hoeller wrote: >BTW, why do you prefer your JaxRpcPortProxyFactoryBean to be lazily >initialized? To avoid checking the WSDL at startup? It would maybe make >sense to add a lazy initialization option to Spring's >JaxRpcPortProxyFactoryBean itself in this case (I'll consider this). > > We've had to use the lazy-init on the JaxRpcPortProxyFactoryBean in order avoid checking the WSDL at start up in the case where the client of the web service is deployed in the same Tomcat instance as the web service itself (maybe there's a better way to handle this situation though...). -Scott |
|
From: Kristof J. <dy...@on...> - 2005-02-23 14:12:25
|
Scott, We're having the very same scenario here. Could you please post privately the according part of your spring applicationcontext configuration where lazy-init really happens lazily? Did you also wrap the bean with LazyInitTargetSource? I'd love to see a working solution for that.. thanks, Kristof Scott Battaglia wrote: > Juergen Hoeller wrote: > >> BTW, why do you prefer your JaxRpcPortProxyFactoryBean to be lazily >> initialized? To avoid checking the WSDL at startup? It would maybe make >> sense to add a lazy initialization option to Spring's >> JaxRpcPortProxyFactoryBean itself in this case (I'll consider this). >> >> > We've had to use the lazy-init on the JaxRpcPortProxyFactoryBean in > order avoid checking the WSDL at start up in the case where the client > of the web service is deployed in the same Tomcat instance as the web > service itself (maybe there's a better way to handle this situation > though...). > > -Scott > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Kristof J. <dy...@on...> - 2005-02-23 14:09:00
|
Juergen, we need to run to separate webapps which are integrated via WS on the same tomcat (client's choice), so checking the WSDL at startup is not an option. A configurable setting of the WSDL checking would be a perfect solution for that problem. I don't have the application context code anymore and it's not in our CVS either as it wasn't working, but I remember explicitly specifying cglib proxying for that scenario and that's what failed. I needed a quick solution so I separated the WS-integration beans into a separate config file and loading it lazily from the caller manually using the ApplicationContextAware interface, but that's really a workaround, not a solution for the problem. regards, Kristof Juergen Hoeller wrote: > This is not a general problem with LazyInitTargetSource on a FactoryBean: > It's rather a problem with LazyInitTargetSource on a JDK proxy as target, if > no proxy interfaces have been specified. Try specifying an appropriate > interface on your ProxyFactoryBean definition (via the "proxyInterfaces" > bean property); this should automatically lead to a JDK proxy being > generated there too. > > BTW, why do you prefer your JaxRpcPortProxyFactoryBean to be lazily > initialized? To avoid checking the WSDL at startup? It would maybe make > sense to add a lazy initialization option to Spring's > JaxRpcPortProxyFactoryBean itself in this case (I'll consider this). > > Juergen > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Kristof Jozsa > Sent: Thursday, February 17, 2005 3:45 PM > To: spr...@li... > Subject: [Springframework-developer] is LazyInitTargetSource on > factories possible? > > > Hi, > > do I see it right that LazyInitTargetSource with Spring 1.4 cannot be > applied to factory objects? Concretely, I'd want to initialize the > configured JaxRpcPortProxyFactoryBean in a lazy way and it both looks > like it *is* getting initalized on startup and it throws an exception > about trying to subclass a final class.. (see the exception at the end). > > I'd need to figure out that issue as soon as possible, so any help's > greatly appreciated. Any workarounds might also help.. > > thanks much in advance, > > Kristof > > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'rasPublicService' defined in ServletContext resource > [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested > exception is org.aopalliance.aop.AspectException: null > java.lang.IllegalArgumentException: Cannot subclass final class class > $Proxy0 > at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:438) > at > net.sf.cglib.transform.TransformingClassGenerator.generateClass(Transforming > ClassGenerator.java:33) > at > net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy > .java:25) > at > net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java: > 215) > at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:368) > at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:280) > at > org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.jav > a:176) > at > org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.jav > a:137) > at > org.springframework.aop.framework.ProxyFactoryBean.getSingletonInstance(Prox > yFactoryBean.java:241) > at > org.springframework.aop.framework.ProxyFactoryBean.setBeanFactory(ProxyFacto > ryBean.java:201) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory > .createBean(AbstractAutowireCapableBeanFactory.java:338) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory > .createBean(AbstractAutowireCapableBeanFactory.java:260) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra > ctBeanFactory.java:221) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra > ctBeanFactory.java:145) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory > .autowireByName(AbstractAutowireCapableBeanFactory.java:700) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory > .populateBean(AbstractAutowireCapableBeanFactory.java:668) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory > .createBean(AbstractAutowireCapableBeanFactory.java:325) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory > .createBean(AbstractAutowireCapableBeanFactory.java:260) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra > ctBeanFactory.java:221) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra > ctBeanFactory.java:145) > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst > antiateSingletons(DefaultListableBeanFactory.java:282) > at > org.springframework.context.support.AbstractApplicationContext.refresh(Abstr > actApplicationContext.java:317) > at > org.springframework.web.context.support.AbstractRefreshableWebApplicationCon > text.refresh(AbstractRefreshableWebApplicationContext.java:131) > at > org.springframework.web.struts.ContextLoaderPlugIn.createWebApplicationConte > xt(ContextLoaderPlugIn.java:352) > at > org.springframework.web.struts.ContextLoaderPlugIn.initWebApplicationContext > (ContextLoaderPlugIn.java:295) > at > org.springframework.web.struts.ContextLoaderPlugIn.init(ContextLoaderPlugIn. > java:224) > at > org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java: > 839) > at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332) > at javax.servlet.GenericServlet.init(GenericServlet.java:256) > at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220) > at > org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.j > ava:445) > at > org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplic > ationHandler.java:150) > at > org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext. > java:458) > at org.mortbay.http.HttpServer.start(HttpServer.java:663) > at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282) > at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104) > at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75) > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |