ClassFinder needs better processing of creating list of classes from JARs
-------------------------------------------------------------------------

                 Key: XBEAN-140
                 URL: https://issues.apache.org/jira/browse/XBEAN-140
             Project: XBean
          Issue Type: Bug
          Components: finder
    Affects Versions: 3.5
            Reporter: Vamsavardhana Reddy


I am using the ClassFinder with Geronimo code.  One of the JARs that needed to 
be processed in my case is com\sun\xml\bind\jaxb-xjc\2.0.5\jaxb-xjc-2.0.5.jar.  
This jar contains a directory named 1.0 with some classes in it.  When 
ClassFinder is processes this JAR, it is constructing class names like 
"1.0.com.sun.codemodel.CodeWriter" etc which are not valid class names and 
can't be located in the jar at "/1/0/com/sun/codemodel/CodeWriter.class" (but 
is present at "/1.0/com/sun/codemodel/CodeWriter.class").  This is resulting in 
stack traces like the following:

java.lang.Exception: Could not load 1/0/com/sun/codemodel/CodeWriter.class
        at 
org.apache.xbean.finder.ClassFinder.readClassDef(ClassFinder.java:726)
        at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:141)
        at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:97)
        at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:86)
        at 
org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:269)
        at 
org.apache.openejb.config.AnnotationDeployer$DiscoverAnnotatedBeans.deploy(AnnotationDeployer.java:247)
        at 
org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:167)
        at 
org.apache.tuscany.sca.contribution.jee.JavaEEModuleHelper.getMetadataCompleteModules(JavaEEModuleHelper.java:116)
        at 
org.apache.tuscany.sca.contribution.jee.impl.JavaEEIntrospectorImpl.introspectWebArchive(JavaEEIntrospectorImpl.java:80)
        at 
org.apache.tuscany.sca.contribution.jee.impl.WebArchiveProcessor.read(WebArchiveProcessor.java:46)
        at 
org.apache.tuscany.sca.contribution.jee.impl.WebArchiveProcessor.read(WebArchiveProcessor.java:1)
        at 
org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessorExtensionPoint$LazyURLArtifactProcessor.read(DefaultURLArtifactProcessorExtensionPoint.java:222)
        at 
org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read(ExtensibleURLArtifactProcessor.java:96)
        at 
org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase(ContributionServiceImpl.java:541)
        at 
org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:419)
        at 
org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:198)
        at 
org.apache.geronimo.tuscany.EmbeddedRuntimeGBean.doStart(EmbeddedRuntimeGBean.java:90)
...

I guess there will also be problems when a directory inside the jar has a dot 
in its name.  It is better to eliminate invalid class names while creating the 
list of classes.

-- 
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