Discussion:
Wicket 1.3.4 and Spring annotations
alex2008
2008-08-13 13:21:00 UTC
Permalink
It's possible use this version of wicket with a service injected on spring by
annotations?
--
View this message in context: http://www.nabble.com/Wicket-1.3.4-and-Spring-annotations-tp18962935p18962935.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Nino Saturnino Martinez Vazquez Wael
2008-08-13 13:40:35 UTC
Permalink
Yes it are possible, theres the wicket-spring annot project..


look in the wiki
http://cwiki.apache.org/WICKET/spring.html

And you can also just use the Wicket Iolite archetype, it has spring and
jpa setup for you:

http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Iolite
Is it possible use this version of wicket with a service injected on spring
by annotations?
--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
alex2008
2008-08-13 15:22:35 UTC
Permalink
In my small project (hibernate-spring-wicket) without JPA I have this big
problem:


@SpringBean
private PersoneList personeList;
public void setPersoneList(PersoneList personeList) {
this.personeList = personeList;
}

public void init() {

addComponentInstantiationListener(this);
//mount("/Home", PackageName.forClass(Home.class));
}

/**
* Constructor
*/
public Home() {
InjectorHolder.getInjector().inject(this);
................

WicketMessage: Can't instantiate page using constructor public
wicketapp.Home()

Root cause:

java.lang.IllegalStateException: bean of type [service.PersoneList] not
found
.........

The PersonList is injected with spring annotation.

I am very discouraged I can not proceed, every time I have to stop for a
problem, if it continues so I fear that I will leave wicket. :,(
Post by Nino Saturnino Martinez Vazquez Wael
Yes it are possible, theres the wicket-spring annot project..
look in the wiki
http://cwiki.apache.org/WICKET/spring.html
And you can also just use the Wicket Iolite archetype, it has spring and
http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Iolite
Is it possible use this version of wicket with a service injected on spring
by annotations?
--
-Wicket for love
Nino Martinez Wael
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/Wicket-1.3.4-and-Spring-annotations-tp18962935p18965346.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Martijn Dashorst
2008-08-13 15:26:52 UTC
Permalink
move InjectorHolder.getInjector().inject(this); to the init() method
*AFTER* the addComponentInstantiatonListener call.

Martijn
Post by alex2008
In my small project (hibernate-spring-wicket) without JPA I have this big
@SpringBean
private PersoneList personeList;
public void setPersoneList(PersoneList personeList) {
this.personeList = personeList;
}
public void init() {
addComponentInstantiationListener(this);
//mount("/Home", PackageName.forClass(Home.class));
}
/**
* Constructor
*/
public Home() {
InjectorHolder.getInjector().inject(this);
................
WicketMessage: Can't instantiate page using constructor public
wicketapp.Home()
java.lang.IllegalStateException: bean of type [service.PersoneList] not
found
.........
The PersonList is injected with spring annotation.
I am very discouraged I can not proceed, every time I have to stop for a
problem, if it continues so I fear that I will leave wicket. :,(
Post by Nino Saturnino Martinez Vazquez Wael
Yes it are possible, theres the wicket-spring annot project..
look in the wiki
http://cwiki.apache.org/WICKET/spring.html
And you can also just use the Wicket Iolite archetype, it has spring and
http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Iolite
Is it possible use this version of wicket with a service injected on spring
by annotations?
--
-Wicket for love
Nino Martinez Wael
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/Wicket-1.3.4-and-Spring-annotations-tp18962935p18965346.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
--
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.4 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Igor Vaynberg
2008-08-13 15:44:40 UTC
Permalink
Post by alex2008
In my small project (hibernate-spring-wicket) without JPA I have this big
@SpringBean
private PersoneList personeList;
public void setPersoneList(PersoneList personeList) {
this.personeList = personeList;
}
public void init() {
addComponentInstantiationListener(this);
//mount("/Home", PackageName.forClass(Home.class));
}
/**
* Constructor
*/
public Home() {
InjectorHolder.getInjector().inject(this);
................
WicketMessage: Can't instantiate page using constructor public
wicketapp.Home()
java.lang.IllegalStateException: bean of type [service.PersoneList] not
found
.........
The PersonList is injected with spring annotation.
a) you do not need a setter for dependencies
b) you do not need init method in a page
c) you do not need injectorholder line in your constructor, that is
only needed for non-component classes
d) you need to add addComponentInstantiationListener(new
SpringComponentInjector(this)); to your application's init
Post by alex2008
I am very discouraged I can not proceed, every time I have to stop for a
problem, if it continues so I fear that I will leave wicket. :,(
really??? oh no! i dont think we have interest in keeping users who
cry. everything i have told you has been clearly outlined in the
spring wiki page and in the example code. if you cannot be bothered to
read and follow examples i do not think you will make it far with
wicket anyways.

-igor
Post by alex2008
Post by Nino Saturnino Martinez Vazquez Wael
Yes it are possible, theres the wicket-spring annot project..
look in the wiki
http://cwiki.apache.org/WICKET/spring.html
And you can also just use the Wicket Iolite archetype, it has spring and
http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Iolite
Is it possible use this version of wicket with a service injected on spring
by annotations?
--
-Wicket for love
Nino Martinez Wael
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/Wicket-1.3.4-and-Spring-annotations-tp18962935p18965346.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
alex2008
2008-08-13 17:26:04 UTC
Permalink
public class WicketApplication extends WebApplication
{

public void init() {
addComponentInstantiationListener(new
SpringComponentInjector(this));
//mount("/Home", PackageName.forClass(Home.class));
}

..................

public class Home extends WebPage {

@SpringBean
private PersoneList personeList;
public void setPersoneList(PersoneList personeList) {
this.personeList = personeList;
}

public void init() {
addComponentInstantiationListener(new
SpringComponentInjector(this));
//mount("/Home", PackageName.forClass(Home.class));
}
--
View this message in context: http://www.nabble.com/Wicket-1.3.4-and-Spring-annotations-tp18962935p18967603.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Michael Sparer
2008-08-13 18:22:13 UTC
Permalink
as igor said, remove the setter and the init method from your webpage and
double-check your spring-configuration ... and try coding against interfaces

if it doesn't work show us the part where you configure the beans (the
application and the PersoneList) and the configuration of the wicket filter
in your web.xml

regards,
Michael
Post by alex2008
public class WicketApplication extends WebApplication
{
public void init() {
addComponentInstantiationListener(new
SpringComponentInjector(this));
}
..................
public class Home extends WebPage {
@SpringBean
private PersoneList personeList;
public void setPersoneList(PersoneList personeList) {
this.personeList = personeList;
}
public void init() {
InjectorHolder.getInjector().inject(this);
}
...........
The problem remain.:-((
The problem is that the documentation and examples are not always
clarification, paradoxically, it is easier to follow something more
complex but very well documented and with many update examples, compared
to something seemingly more simple but that is able to completely stop a
project for entire days.
I find only one example for spring-hibernate-wicket and it has wrote for
wicket 1.2.x.
-----
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context: http://www.nabble.com/Wicket-1.3.4-and-Spring-annotations-tp18962935p18968499.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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