[ 
https://issues.apache.org/jira/browse/COCOON-2080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508564
 ] 

Reinhard Poetz commented on COCOON-2080:
----------------------------------------

The problem is that if a class or an interface is loaded by the reloading 
classloader and it is used to create a proxy from it, it can't be found. As a 
workaround you can put the interface in a different module which is added as 
normal dependency to your block (of course you mustn't add this other module to 
your rcl.properties either).

> interface com.atn.htest.PersonDAO is not visible from class loader
> ------------------------------------------------------------------
>
>                 Key: COCOON-2080
>                 URL: https://issues.apache.org/jira/browse/COCOON-2080
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core, - Build System: Maven
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Vladimir S Bronnikov
>
> I'm wrote my own Generator. The main purpose of them is to find "spring 
> beans" in application context and invoke thier methods.
>       WebApplicationContext ctx = 
> WebAppContextUtils.getCurrentWebApplicationContext();
>       Object bf = ctx.getBean(beanName);
>       Method method = BeanUtils.findMethod(bf.getClass(), methodName, 
> paramTypes);
>       Object result = method.invoke(bf, paramValues);
> When I deploy my cocoon block first time - all fine.
> But if I change some resource and rcl do it's work, I get this error:
> org.springframework.beans.factory.BeanCreationException: Error creating bean 
> with name 'com.atn.htest.PersonDAO' defined in URL 
> [file:D:/work/eclipse-3.2.1/workspaces/springframework/block2/target/classes/META-INF/cocoon/spring/demo-application-context.xml]:
>  Invocation of init method failed; nested exception is 
> java.lang.IllegalArgumentException: interface com.atn.htest.PersonDAO is not 
> visible from class loader
> Caused by: java.lang.IllegalArgumentException: interface 
> com.atn.htest.PersonDAO is not visible from class loader
>       at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
>       at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
>       at 
> org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:117)
>       at 
> org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:110)
>       at 
> org.springframework.aop.framework.AbstractSingletonProxyFactoryBean.getProxy(AbstractSingletonProxyFactoryBean.java:187)
>       at 
> org.springframework.aop.framework.AbstractSingletonProxyFactoryBean.afterPropertiesSet(AbstractSingletonProxyFactoryBean.java:159)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
>       at 
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
>       at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
>       at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
>       at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
>       at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
>       at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
>       at 
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
>       at 
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
>       at 
> org.apache.cocoon.tools.rcl.springreloader.SpringReloader.reload(SpringReloader.java:57)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at 
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingSpringFilter.doFilter(ReloadingSpringFilter.java:64)
>       at 
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingServletFilter.doFilter(ReloadingServletFilter.java:50)
>       at 
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
> Why after reload classloader interface is not visible?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to