commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BCEL-110) Problem with JAXB if the bcel classloader is used
Date Fri, 20 Feb 2015 09:36:12 GMT

    [ https://issues.apache.org/jira/browse/BCEL-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14328743#comment-14328743
] 

Thomas Neidhart commented on BCEL-110:
--------------------------------------

The most likely cause for this is because the bcel Classloader does not follow the Java 2
classloader delegation pattern.
Depending on the setup, it might use a SyntheticRepository to load the class from the classpath
(which also includes the system classes, and org.xml.sax.InputSource is part of them) instead
of using the bootstrap classloader to load system classes.

Furthermore the bcel ClassLoader does not correctly call definePackage, so clazz.getPackage()
might be null and cause problems in some cases.

> Problem with JAXB if the bcel classloader is used
> -------------------------------------------------
>
>                 Key: BCEL-110
>                 URL: https://issues.apache.org/jira/browse/BCEL-110
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.2
>         Environment: Operating System: Windows XP
> Platform: PC
>            Reporter: Oleg Barmin
>            Assignee: Apache Commons Developers
>
> When I try to run program with a JAXB code I got an exception if the bcel
> classloader is used.
> Exception in thread "main" java.lang.LinkageError: Class org/xml/sax/InputSource
> violates loader constraints
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(Unknown Source)
> 	at java.lang.ClassLoader.defineClass(Unknown Source)
> 	at org.apache.bcel.util.ClassLoader.loadClass(ClassLoader.java:127)
> 	at java.lang.ClassLoader.loadClass(Unknown Source)
> 	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> 	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)
> 	at
> advdebug.config.parser.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:140)
> 	at
> javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:131)
> 	at
> javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:136)
> 	at
> javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:145)
> 	at
> javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:163)
> 	at test.Test.main(Test.java:47)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message