« Return to Thread: Error running wicket :(wrong name: SimpleChatBytesMessageCreator)

Re: Error running wicket :(wrong name: SimpleChatBytesMessageCreator)

by wfaler :: Rate this Message:

Reply to Author | View in Thread

Hi,
I'm afraid I've found the whole @Service and app.getService() thing to be a bit flaky as different platforms (Windows, Mac, Linux) traverse the classpath in different ways, which the code didn't account for.
Also the functionality kind of duplicates Google Guice.
As a consequence I will remove it in the next release (it is already removed in subversion) - it basically duplicates functionality that is in Google Guice, and therefore I thought it was better to just go with Google Guice for service discovery, rather than duplicate something others have done better.

So my suggestion would be to replace it with the Wicket Guice integration as it will achieve the same effect with very little change. there is a good, short tutorial for it here:
http://herebebeasties.com/2007-06-20/wicket-gets-guicy/

For the current Wicket RAD release, you can just add this to your pom.xml for it to work as described in the blog post above:
<dependency>
    <groupId>org.apache.wicket</groupId>
    <artifactId>wicket-guice</artifactId>
    <version>1.3.4</version>
</dependency>

Apologies for the inconvenience (and flaky code for service discovery, I never actually used it myself, I just half heartedly wrote it before discovering Guice).

In the upcoming 0.6 release, Guice will be explicitly supported and integrated beyond how it is already integrated in Wicket to support some new functionality.

wadi wrote:
I just wanted to add that this happends when I call app.getService(). I have an interface with the @Service annotations wich implementation has a @Service annotation too. I do a app.getService(MiInterface.class) to call the service and it throws the stacktrace I posted.
Thanks,
Wadi

 « Return to Thread: Error running wicket :(wrong name: SimpleChatBytesMessageCreator)