-
Sep 23rd, 2011, 09:20 AM
#1
Multiple Context Problem : Not working
Hi Everyone,
This is my first post on this wonderful forum. I would appreciate if someone can help me resolving the below Issue which am not able to fix from last couple of days.
Background :
Earlier we had one app abcd, which has UI and webservice and they share same context. But due to business requirement, we need to split up the UI and webservices(is used to download some files) in two parts. Webservice is two parts, first on some request to generate some url and second to retrieve the content by clicking on generated URL.
So to accommodate the same, I did the separation by adding the necessary files. i.e. one context for UI (abcd) and one context for Webservice(abcd-webservice). App is getting deployed properly with proper structure and configuration. UI piece work fine but in webservice its work fine for generating url but when I tried to retrieve details it failed. Internally it called servlet which has code to get ImageBean and it failed there.
ImageBO bo = (ImageBO) helper.getBean("imageBO");
It gives me 404 in browser and at server level following exception
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'imageBo' defined in URL [file:C:/Project/abcd_2010/src/conf/application.xml]: Initialization of bean failed;
nested exception is java.lang.IllegalArgumentException: interface com.chandresh.rss.test.servlet.ImageBO is not visible from class loader
java.lang.IllegalArgumentException: interface com.chandresh.test.download.servlet.ImageBO is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:3 37)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.jav a:567)
at org.springframework.aop.framework.JdkDynamicAopPro xy.getProxy(JdkDynamicAopProxy.java:104)
at org.springframework.aop.framework.JdkDynamicAopPro xy.getProxy(JdkDynamicAopProxy.java:94)
at org.springframework.aop.framework.ProxyFactory.get Proxy(ProxyFactory.java:70)
at org.springframework.aop.framework.autoproxy.Abstra ctAutoProxyCreator.createProxy(AbstractAutoProxyCr eator.java:375)
at org.springframework.aop.framework.autoproxy.Abstra ctAutoProxyCreator.postProcessAfterInitialization( AbstractAutoProxyCreator.java:237)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyBeanPostProcessors AfterInitialization(AbstractAutowireCapableBeanFac tory.java:267)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:364)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.context.support.AbstractApplic ationContext.getBean(AbstractApplicationContext.ja va:555)
at com.chandresh.test.download.util.ApplicationContex tHelper.getBean(ApplicationContextHelper.java:119)
at com.chandresh.test.download.servlet.ImageServlet.d oGet(ImageServlet.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletI nvocationAction.run(ServletStubImpl.java:1077)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:465)
at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :7047)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3902)
at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2773)
at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:183)
But if tweak the URL and point to old context i.e. abcd it works fine. Am able to download the necessary details.
So looks like the old context is able to load the bean but newer context can't read it Some configuration I need to tweak to make it working
Attached is my
ApplicationContextHelper java class
and web.xml(UI-Old context i.e.abcd)
and web.xml (webservice - new context ie.abcd-detail)
and beanrefcontext
Please go through it and please suggest accordingly the necessary changes needed.
ApplicationContextHelper.txt abcd_ui_web.txt abcd-detail-webservice-web.txt BeanRefContext.txt
Cheers,
Cha
-
Sep 26th, 2011, 01:36 AM
#2
-
Oct 3rd, 2011, 07:09 AM
#3
No great mind can help me resolving this !!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules