Details
-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.0
-
Fix Version/s: None
-
Component/s: xml
-
Labels:None
-
Environment:jdk 1.5.0_05
-
Number of attachments :
Description
Reference: Mail [picocontainer-user] Re: Hotswap with Nanocontainer XML scripting possible?
This is nearly the same component configuration like the
'cbrcp.container.CBRCPAbstractContainer'(pls see ./src/cbrcp/container/CBRCPAbstractContainer
in zip) which works perfectly. The difference
in the XML script is that some components which has no cyclic dependencies
are added as "component-implementation" to the container. The result from
the script is that all components which are added via "component-adapter"
are NOT started. For testing I changed the other ("component-implementation")
to "component-adapter" and they are not started either.
Next thing I tried out, was changing
<component-adapter-factory key="CBRCPFactory" class="org.picocontainer.defaults.CachingComponentAdapterFactory">
<component-adapter-factory class="org.picocontainer.gems.adapters.HotSwappingComponentAdapterFactory">
<component-adapter-factory class="org.picocontainer.defaults.ConstructorInjectionComponentAdapterFactory" />
</component-adapter-factory>
</component-adapter-factory>
to
<component-adapter-factory key="CBRCPFactory" class="org.picocontainer.defaults.HotSwappingComponentAdapterFactory">
<component-adapter-factory class="org.picocontainer.gems.adapters.CachingComponentAdapterFactory">
<component-adapter-factory class="org.picocontainer.defaults.ConstructorInjectionComponentAdapterFactory"/>
</component-adapter-factory>
</component-adapter-factory>
which complies with my class 'CBRCPHotSwappingComponentAdapterFactory.java'
(pls see below again), but this produces only the following exception:
#Exception begin===========================================================
Exception in thread "main" org.nanocontainer.script.NanoContainerMarkupException: Class not found:
'org.picocontainer.gems.adapters.CachingComponentAdapterFactory' classloader stack
[org.picocontainer.defaults.CustomPermissionsURLClassLoader 27338224:
sun.misc.Launcher$AppClassLoader@133056f
sun.misc.Launcher$ExtClassLoader@a9c85c
]
at org.nanocontainer.script.xml.XMLContainerBuilder.populateContainer(XMLContainerBuilder.java:166)
at org.nanocontainer.script.xml.XMLContainerBuilder.createContainerFromScript(XMLContainerBuilder.java:140)
at org.nanocontainer.script.ScriptedContainerBuilder.createContainer(ScriptedContainerBuilder.java:60)
at org.nanocontainer.integrationkit.LifecycleContainerBuilder.buildContainer(LifecycleContainerBuilder.java:26)
at cbrcp.CBRCPStarter.startByNanocontainer(CBRCPStarter.java:110)
at cbrcp.CBRCPStarter.setupContainer(CBRCPStarter.java:76)
at cbrcp.CBRCPStarter.main(CBRCPStarter.java:42)
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)
Caused by: java.lang.ClassNotFoundException:
'org.picocontainer.gems.adapters.CachingComponentAdapterFactory' classloader stack
[org.picocontainer.defaults.CustomPermissionsURLClassLoader 27338224:
sun.misc.Launcher$AppClassLoader@133056f
sun.misc.Launcher$ExtClassLoader@a9c85c
]
at org.picocontainer.defaults.CustomPermissionsURLClassLoader.decorateException(CustomPermissionsURLClassLoader.java:71)
at org.picocontainer.defaults.CustomPermissionsURLClassLoader.loadClass(CustomPermissionsURLClassLoader.java:42)
at org.nanocontainer.script.xml.XMLContainerBuilder.registerComponentImplementation(XMLContainerBuilder.java:308)
at org.nanocontainer.script.xml.XMLContainerBuilder.addComponentAdapterFactory(XMLContainerBuilder.java:245)
at org.nanocontainer.script.xml.XMLContainerBuilder.addComponentAdapterFactory(XMLContainerBuilder.java:234)
at org.nanocontainer.script.xml.XMLContainerBuilder.registerComponentsAndChildContainers(XMLContainerBuilder.java:204)
at org.nanocontainer.script.xml.XMLContainerBuilder.populateContainer(XMLContainerBuilder.java:164)
... 11 more
#Exception end===========================================================
My classpath seems to be correct, so the components would not start via the
extended DefaultPicoContainer. I got really stuck. Does these problems say
something to you...?
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 1.0 [ 10148 ] | |
Summary | Problem with Nanocontainer XML script start with components having cyclic dependencies (Reference: Mail [picocontainer-user] Re: Hotswap with Nanocontainer XML scripting possible?) | Problem with Nanocontainer XML script start with components having cyclic dependencies |
Type | Task [ 3 ] | Bug [ 1 ] |
Attachment | testcase-src.zip [ 18817 ] |
Resolution | Won't Fix [ 2 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Sorry forgotten, unzip attachment and open project in IDEA. compile and run. Presets are starting application from XML script incorrectly (i.e only the "component-implementation" defined components). To start the Picocontainer make a comment before
containerSetupFile=./container-config/start-container-setup.xml
in file './cbrcp-start.properties. This will launch the application correctly.