[jboss-dev-forums] [JBoss AS7 Development] - Re: Using JAXB and see java.lang.ClassNotFoundException: __redirected/__DatatypeFactory
Jason Greene
do-not-reply at jboss.com
Thu Aug 25 10:26:09 EDT 2011
Jason Greene [http://community.jboss.org/people/jason.greene] created the discussion
"Re: Using JAXB and see java.lang.ClassNotFoundException: __redirected/__DatatypeFactory"
To view the discussion, visit: http://community.jboss.org/message/622967#622967
--------------------------------------------------------------
My above answer is not entirely accurate. The TCCL needs to point to any module classloader (all of them can see __redirected). In some cases TCCL might be null, in which case the boot classpath is used and __redirected is not seen. Before calling into any JAXP factory (any newInstance()) just make sure you set TCCL to point to your module classloader (and reset it back to the original in finally block)
One important clarification point though is that if this is an EE deployment executing in an EE context (like say servlet init), then it has TCCL set to the deployment (which is correct). If you are taking an action on behalf of the user (e.g. it is expected that THEIR JAXP impls be used), then you can safely reuse this. If however it is an implementation detail of your subsystem, then you want your versions to be used and not theirs.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/622967#622967]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110825/f095f588/attachment.html
More information about the jboss-dev-forums
mailing list