Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Synthetic Context bundle loading while migrating from Virgo 3.0.1 to 3.5.0(Import bundles are not loading through Bundle Synthetic Context(PAR) while migrating from Virgo version 3.0.1 to 3.5.0)
Synthetic Context bundle loading while migrating from Virgo 3.0.1 to 3.5.0 [message #1702705] Fri, 24 July 2015 08:30 Go to next message
Hemendra Yadav is currently offline Hemendra YadavFriend
Messages: 1
Registered: July 2015
Junior Member
Hi,

I have three below bundles:

1) Core-bundle.jar : In this JAR I have a class that is used for dynamic loading of the class(using TCCL: Thread.currentThread().getContextClassLoader()). I have placed this jar in usr repository.

2) Service-bundle.jar - This is using Core-bundle.jar to load its classes and imports Core-bundle.jar. I have placed this jar in usr repository.

3) Application-bundle.par(PAR) - This bundle is importing the Service-bundle.jar and Core-bundle.jar. I am deploying this par in pickup folder.It will create synthetic bundle.


In Virgo 3.5.0 i am getting the below error:

org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: com.core.bundle.Delagate in KernelBundleClassLoader: [bundle=Application-par-1-synthetic.context_1.0.0]
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:139)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.core.bundle.config.xml.Parser.parseChild(Parser.java:143)
at com.core.bundle.config.xml.Parser.parseInternal(Parser.java:64)
at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1325)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:202)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:170)
at org.eclipse.gemini.blueprint.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:140)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:60)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:242)
at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:220)
at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:224)
at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:177)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:157)
at org.eclipse.gemini.blueprint.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:222)
at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

I am using below code for loading the classes in in Core-bundle: com.core.bundle.config.xml.Parser

ClassLoader loader = Thread.currentThread().getContextClassLoader();
loader.loadClass(className);

Same deployment is working fine in Virgo version 3.0.1 but i am getting the above error in 3.5.0

While analysing the logs I found that with 3.0.1 version class delegation start with [bundle=Application-par-1-Application.TestService_1.0.0](here TestService is the jar inside PAR) and load the imported classess successfully but with 3.5.0 delegation starts with synthetic context [bundle=Application-par-1-synthetic.context_1.0.0] and not able to load the classes hence throwing Class not found exception.

Can you please suggest why synthetic context throwing the Class not found exception.
Re: Synthetic Context bundle loading while migrating from Virgo 3.0.1 to 3.5.0 [message #1702800 is a reply to message #1702705] Fri, 24 July 2015 17:15 Go to previous message
Violeta Georgieva is currently offline Violeta GeorgievaFriend
Messages: 276
Registered: October 2010
Senior Member
Hi,

Is it possible that you are facing the following https://wiki.eclipse.org/Virgo/Community/Migrating_from_3.0.x_to_3.5.0#Thread_Context_Class_Loading_with_PARs_and_Scoped_Plans?

Regards,
Violeta
Previous Topic:Define the order to pickup jars in pickup folder of Virgo Nano
Next Topic:Neo4j on Eclipse Virgo
Goto Forum:
  


Current Time: Sat Sep 22 20:46:58 GMT 2018

Powered by FUDForum. Page generated in 0.05154 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top