[ 
https://issues.apache.org/jira/browse/WICKET-2034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676058#action_12676058
 ] 

Juergen Donnerstag commented on WICKET-2034:
--------------------------------------------

applied a patch that Wicket will not test the classloaders in the following 
order:

                if (clazz != null)
                {
                        resourceStream = 
getResourceStream(clazz.getClassLoader(), path);
                        if (resourceStream != null)
                        {
                                return resourceStream;
                        }
                }

                // use context classloader when no specific classloader is set
                // (package resources for instance)
                resourceStream = 
getResourceStream(Thread.currentThread().getContextClassLoader(), path);
                if (resourceStream != null)
                {
                        return resourceStream;
                }

                // use Wicket classloader when no specific classloader is set
                return getResourceStream(getClass().getClassLoader(), path);


> Resources refereced by HeaderContributor outside of WAR inaccessible.
> ---------------------------------------------------------------------
>
>                 Key: WICKET-2034
>                 URL: https://issues.apache.org/jira/browse/WICKET-2034
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-RC1
>            Reporter: Maarten Billemont
>
> It appears that when referencing resources outside of the Wicket 
> application's WAR using a statement such as:
> add(HeaderContributor.forJavaScript(getClass(), "foo.js")) ;
> The AS can't resolve the reference created for it.
> My scenario is the following:
> - I have a Wicket page which extends FooPage.  FooPage resides in a JAR 
> somewhere in the classpath, outside of the WAR.  My Wicket page that extends 
> FooPage is in the WAR.
> - FooPage uses the code above to add a HeaderContributor to the page.  
> "foo.js" is a resource that's in the same package, and in the same JAR as 
> FooPage (So also outside of the WAR).
> - When the page is rendered; the script is referenced using the URL: 
> http://localhost/fooapp/resources/my.package.FooPage/foo.js
> - When I open that URL, I get the following error message from my JBoss AS:
> HTTP Status 404 - Unable to find package resource [path = 
> net/link/safeonline/wicket/web/functions.js, style = null, locale = null]

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