[
https://issues.apache.org/jira/browse/DELTASPIKE-384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13696836#comment-13696836
]
Richard DiCroce commented on DELTASPIKE-384:
--------------------------------------------
@Gerhard: the EAR has two WARs, one for a JSF application and another for a
JAX-RS web service. The JSF module is not being shared in the EAR lib. It is
part of the appropriate WAR's lib. The problem is that the current code uses
ClassUtils to try to load the class and doesn't specify a classloader, so
ClassUtils uses its own classloader. But ClassUtils is part of DS core, and the
core module is in the EAR lib, which means it uses the EAR's classloader, which
can't see the classes in the WAR. I don't see how any solution to
DELTASPIKE-335 is going to fix that. But if you still don't want to commit the
patch because it fixes this issue (for me, at least) then consider committing
it because it makes the code cleaner by removing a bunch of unnecessary
gymnastics.
> ViewConfigUtils.toNodeList() fails in EAR
> -----------------------------------------
>
> Key: DELTASPIKE-384
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-384
> Project: DeltaSpike
> Issue Type: Bug
> Components: JSF-Module
> Affects Versions: 0.4
> Environment: JBoss AS 7.2.0.Final (EAP 6.1.0.Alpha1)
> Reporter: Richard DiCroce
> Assignee: John D. Ament
> Fix For: 0.5
>
> Attachments: deltaspike-384.patch
>
>
> ViewConfigUtils.toNodeList() does not work in my EAR.
> ClassUtils.tryToLoadClassForName() returns null for every class that
> toNodeList() uses it to try to load. This eventually results in a
> NullPointerException.
> To work around the problem, I have substituted my own version of the
> ViewConfigUtils class, containing the below rewrite of toNodeList() which is
> equivalent but doesn't require use of any classloaders:
> {code}
> public static List<Class> toNodeList(Class nodeClass) {
> List<Class> treePath = new ArrayList<Class>();
> do {
> treePath.add(0, nodeClass);
> nodeClass = nodeClass.getEnclosingClass();
> } while (nodeClass != null);
> return treePath;
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira