[ 
http://issues.apache.org/jira/browse/TUSCANY-368?page=comments#action_12402205 
] 

Jim Marino commented on TUSCANY-368:
------------------------------------

I spent about two minutes looking at this so I may be offbase...

This appears to be a classloading/isolation problem. SystemImplementationLoader 
calls Java5ComponentTypeIntrospector to introspect the implementation of a 
system component configured in a module fragment. As 
Java5ComponentTypeIntrospector introspects the implementation class's methods, 
it encounters a ClassCastException attempting to load StandardHost, a Tomcat 
class. StandardHost is referenced by TuscanyHost, which extends it. TuscanyHost 
is referenced by TomcatHost, a  system service which implements the host api. 
So, it sounds as if SystemImplementationLoader is attempting to process the 
SCDL entry for TomcatHost in the context of a classloader which does not have 
access to StandardHost since I believe Tomcat segregrates its implementation 
classes from application classloaders.

I haven't been following the changes where jars have been moved to common in 
Tomcat but if the above is correct, this may be the culprit.

> Running helloworld sample using dist give class not found exception
> -------------------------------------------------------------------
>
>          Key: TUSCANY-368
>          URL: http://issues.apache.org/jira/browse/TUSCANY-368
>      Project: Tuscany
>         Type: Bug

>     Reporter: Rick Rineholt
>     Priority: Blocker

>
> Running helloworld sca sample with 
> java.ext.dirs=\java\distribution\target\tuscany-dist\lib gives exception 
> below.
> Oddly enough running it with  testing/tomcat/target/j2se does not.
> Is it possible this class is in some jar manifest that's trying to load it 
> that is not created as part of the normal build process ?
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/catalina/core/StandardHost
>       at java.lang.ClassLoader.defineClass1(Native Method)
>       at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>       at 
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>       at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>       at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>       at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>       at java.lang.Class.getDeclaredMethods0(Native Method)
>       at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
>       at java.lang.Class.privateGetPublicMethods(Class.java:2488)
>       at java.lang.Class.getMethods(Class.java:1406)
>       at 
> org.apache.tuscany.core.config.impl.Java5ComponentTypeIntrospector.introspect(Java5ComponentTypeIntrospector.java:105)
>       at 
> org.apache.tuscany.core.config.impl.Java5ComponentTypeIntrospector.introspect(Java5ComponentTypeIntrospector.java:92)
>       at 
> org.apache.tuscany.core.loader.system.SystemImplementationLoader.load(SystemImplementationLoader.java:63)
>       at 
> org.apache.tuscany.core.loader.system.SystemImplementationLoader.load(SystemImplementationLoader.java:36)
>       at 
> org.apache.tuscany.core.loader.impl.StAXLoaderRegistryImpl.load(StAXLoaderRegistryImpl.java:66)
>       at 
> org.apache.tuscany.core.loader.assembly.ComponentLoader.load(ComponentLoader.java:76)
>       at 
> org.apache.tuscany.core.loader.assembly.ComponentLoader.load(ComponentLoader.java:49)
>       at 
> org.apache.tuscany.core.loader.impl.StAXLoaderRegistryImpl.load(StAXLoaderRegistryImpl.java:66)
>       at 
> org.apache.tuscany.core.loader.assembly.CompositeLoader.loadComposite(CompositeLoader.java:43)
>       at 
> org.apache.tuscany.core.loader.assembly.ModuleFragmentLoader.load(ModuleFragmentLoader.java:39)
>       at 
> org.apache.tuscany.core.loader.assembly.ModuleFragmentLoader.load(ModuleFragmentLoader.java:32)
>       at 
> org.apache.tuscany.core.loader.impl.StAXLoaderRegistryImpl.load(StAXLoaderRegistryImpl.java:66)
>       at 
> org.apache.tuscany.core.config.impl.StAXModuleComponentConfigurationLoaderImpl.loadModuleFragment(StAXModuleComponentConfigurationLoaderImpl.java:70)
>       at 
> org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadModuleComponent(AbstractModuleComponentConfigurationLoader.java:146)
>       at 
> org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadModuleComponent(AbstractModuleComponentConfigurationLoader.java:132)
>       at 
> org.apache.tuscany.core.config.impl.AbstractModuleComponentConfigurationLoader.loadSystemModuleComponent(AbstractModuleComponentConfigurationLoader.java:91)
>       at 
> org.apache.tuscany.core.client.TuscanyRuntime.<init>(TuscanyRuntime.java:97)
>       at 
> org.apache.tuscany.core.client.TuscanyRuntime.<init>(TuscanyRuntime.java:67)
>       at helloworld.HelloWorldClient.main(HelloWorldClient.java:32)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to