[ 
http://jira.nuxeo.org/browse/NXP-1918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32020#action_32020
 ] 

Olivier Grisel commented on NXP-1918:
-------------------------------------

After adding Bundle-ClassPath: . (taking example at the MANIFEST.FM of 
nuxeo-core-jcr-connector.jar) I cannot make work two other embedded libraries 
see each other but I still get a NoClassDefFoundError at line 174 of 
XmlBean.java:

170        private static final Method buildMethod ( String className, String 
methodName, Class[] args )
171        {
172            try
173            {
174                return
175                    Class.forName(
176                        className, false, XmlBeans.class.getClassLoader() ).
177                            getMethod( methodName, args );
178            }
179            catch ( Exception e )
180            {
181                throw causedException(
182                    new IllegalStateException(
183                        "Cannot load " + methodName +
184                            ": verify that xbean.jar is on the classpath" ), 
e );
185            }
186        }

This is a RuntimeException and thus not catched.

This problem is thus probably specific to xmlbeans / stax-api and maybe the 
related to a class lookup ordering issue.

> Nuxeo classloader prevents embedded jars to load each other
> -----------------------------------------------------------
>
>                 Key: NXP-1918
>                 URL: http://jira.nuxeo.org/browse/NXP-1918
>             Project: Nuxeo Enterprise Platform 5
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 5.1.2
>            Reporter: Olivier Grisel
>            Assignee: Bogdan Stefanescu
>             Fix For: 5.1.3, 5.2 M1
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Use case:
> You have a custom-project.jar (with MANIFEST.MF, OSGI-INF/, pom.xml as any 
> other standard nuxeo plugin). That project as a dependency on an external jar 
> (for instance xmlbeans 2.2.0). The dependency is declared in the pom.xml file 
> of custom-project along with a declaration for the maven-dependency-plugin to 
> include that jar at the root of custom-project.jar:
>                                                               <artifactItem>
>                                                                       
> <groupId>org.apache.xmlbeans</groupId>
>                                                                       
> <artifactId>xmlbeans</artifactId>
>                                                               </artifactItem>
> Since xmlbeans 2.2.0 needs stax-api 1.0.1 to work, we add that dependency in 
> custom-project's pom.xml as well along with the maven-dependency-plugin 
> declaration as follows:
>                                                               <artifactItem>
>                                                                       
> <groupId>stax</groupId>
>                                                                       
> <artifactId>stax-api</artifactId>
>                                                               </artifactItem>
> When building the custom-project.jar we now have the following content:
> custom-project.jar/
>     xmlbeans-2.2.0.jar
>     stax-api-1.0.1.jar
>     classes/
>     ...
> After having deployed successfully custom-project.jar in nuxeo.ear/plugins, 
> when calling a method of a class of custom-project that needs a class of 
> xmlbeans, the nuxeo class loader finds the xmlbeans class but if that class 
> needs in turn a class of stax-api (such as javax.stream.QName) we get a 
> classloading exception (it cannot find QName).
> When disabling the nuxeo specific classloader in the jboss-app.xml template 
> of the ear, everything works fine.

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

        
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets

Reply via email to