You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by expresso <oa...@tentelemed.com> on 2015/07/30 11:03:36 UTC

Wicket 7 SharedResourceReference

Hi !

I have a NullPointerException after migration from 6 to 7.

Caused by: java.lang.NullPointerException
	at
org.apache.wicket.request.resource.PackageResourceReference.getResource(PackageResourceReference.java:126)
~[wicket-core-7.0.0.jar:7.0.0]
	at
com.mycompany.myproject.WicketApplication.init(WicketApplication.java:34)
~[classes/:?]
	at org.apache.wicket.Application.initApplication(Application.java:919)
~[wicket-core-7.0.0.jar:7.0.0]
	at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:429)
~[wicket-core-7.0.0.jar:7.0.0]

wicket-quickstart.zip
<http://apache-wicket.1842946.n4.nabble.com/file/n4671710/wicket-quickstart.zip>  

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-7-SharedResourceReference-tp4671710.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 7 SharedResourceReference

Posted by expresso <oa...@tentelemed.com>.
It works !!!!

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-7-SharedResourceReference-tp4671710p4671719.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 7 SharedResourceReference

Posted by Sven Meier <sv...@meiers.net>.
Hi,

this is caused by the changes in WICKET-5909 - 
PackageResourceReference#getResource() expects a running request now. 
This is clearly not the case when you call the method from your 
application's #init().

Do you have your icons in the /webapp folder? Then just use a 
ContextRelativeResource instead:

         getSharedResources().add("favicon", new 
ContextRelativeResource("logo.png"));

Otherwise please create a Jira issue.

Have fun
Sven


On 30.07.2015 17:05, expresso wrote:
> Yes sure.
>
> You can verify in changing wicket version in quickstart pom ;-)
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-7-SharedResourceReference-tp4671710p4671717.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 7 SharedResourceReference

Posted by expresso <oa...@tentelemed.com>.
Yes sure.

You can verify in changing wicket version in quickstart pom ;-)

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-7-SharedResourceReference-tp4671710p4671717.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket 7 SharedResourceReference

Posted by Sven Meier <sv...@meiers.net>.
Hi,

you have logo.png in the webapp folder. To reference it from a package 
it has to be located besides your StyleResources class:

     new PackageResourceReference(StyleResources.class, "logo.png");

Are you sure, this worked in Wicket 6?

Sven

On 30.07.2015 11:03, expresso wrote:
> Hi !
>
> I have a NullPointerException after migration from 6 to 7.
>
> Caused by: java.lang.NullPointerException
> 	at
> org.apache.wicket.request.resource.PackageResourceReference.getResource(PackageResourceReference.java:126)
> ~[wicket-core-7.0.0.jar:7.0.0]
> 	at
> com.mycompany.myproject.WicketApplication.init(WicketApplication.java:34)
> ~[classes/:?]
> 	at org.apache.wicket.Application.initApplication(Application.java:919)
> ~[wicket-core-7.0.0.jar:7.0.0]
> 	at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:429)
> ~[wicket-core-7.0.0.jar:7.0.0]
>
> wicket-quickstart.zip
> <http://apache-wicket.1842946.n4.nabble.com/file/n4671710/wicket-quickstart.zip>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-7-SharedResourceReference-tp4671710.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org