AW: AW: Troubles with Spring: bean of type X not found

2009-02-21 Thread Christian Helmbold
It seems like my Spring config doesn't take effect. If I use a not existent 
application class name in my applicationContext.xml the Wicket application 
starts without an error message (the error with missing bean appears on first 
request).

Wicket starts even with:
bean id=wicketApplication class=notexistent /

Spring itself seems to work:
21.02.2009 09:56:31 org.springframework.web.context.ContextLoader 
initWebApplicationContext
INFO: Root WebApplicationContext: initialization started

It looks like Wicket is starting, Spring is starting but they don't now each 
other. Both should be connected in web.xml:

filter
filter-nameWickiApplication/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
init-param
  param-nameapplicationFactoryClassName/param-name
  
param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
/filter

I guess something is wrong with this. But it is like the example in Spring in 
Action (page 311).

What can I do to integrate Spring?

Thanks
Christian

 -- 
http://www.groovy-forum.de





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



Re: AW: AW: Troubles with Spring: bean of type X not found

2009-02-21 Thread Nicolas Labrot

Hello Christian,

Have you add the following statement in your web.xml : 

context-param
param-namecontextConfigLocation/param-name
param-valueclasspath:applicationContext.xml/param-value
/context-param



?


On Sat, 21 Feb 2009 09:09:18 + (GMT), Christian Helmbold
christian.helmb...@yahoo.de wrote:
 It seems like my Spring config doesn't take effect. If I use a not
existent
 application class name in my applicationContext.xml the Wicket
application
 starts without an error message (the error with missing bean appears on
 first request).
 
 Wicket starts even with:
 bean id=wicketApplication class=notexistent /
 
 Spring itself seems to work:
 21.02.2009 09:56:31 org.springframework.web.context.ContextLoader
 initWebApplicationContext
 INFO: Root WebApplicationContext: initialization started
 
 It looks like Wicket is starting, Spring is starting but they don't now
 each other. Both should be connected in web.xml:
 
 filter
 filter-nameWickiApplication/filter-name

filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
 init-param
   param-nameapplicationFactoryClassName/param-name
  
param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
 /init-param
 /filter
 
 I guess something is wrong with this. But it is like the example in
Spring
 in Action (page 311).
 
 What can I do to integrate Spring?
 
 Thanks
 Christian
 
  -- 
 http://www.groovy-forum.de
 
 
   
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org

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



AW: AW: AW: Troubles with Spring: bean of type X not found

2009-02-21 Thread Christian Helmbold
Hello Nicolas,


 Have you add the following statement in your web.xml

Yes, exactly as you wrote:
context-param
  param-namecontextConfigLocation/param-name
  param-valueclasspath:applicationContext.xml/param-value
/context-param

I've also tried to use a wrong name for the xml file, only to see if I get an 
error - and I get one. So the spring config seems to be found.

Regards
Christian






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



Re: AW: AW: Troubles with Spring: bean of type X not found

2009-02-21 Thread Martijn Reuvers
Hi Christian,

I am using the same config as you (as far as I can tell), with the
exception I always use: @SpringBean (name=nameHere) so I always use
the name of a bean. So far I never had trouble with that. Perhaps its
the wicket version you are using different from ours? I use 1.4rc2 and
accompanying modules. My main config spring file (your .xml file) is
located directly under WEB-INF/classes (when its deployed) and not in
WEB-INF itself.

Martijn



On Sat, Feb 21, 2009 at 10:40 AM, Christian Helmbold
christian.helmb...@yahoo.de wrote:
 Hello Nicolas,


 Have you add the following statement in your web.xml

 Yes, exactly as you wrote:
context-param
  param-namecontextConfigLocation/param-name
  param-valueclasspath:applicationContext.xml/param-value
/context-param

 I've also tried to use a wrong name for the xml file, only to see if I get an 
 error - and I get one. So the spring config seems to be found.

 Regards
 Christian






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



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



AW: Troubles with Spring: bean of type X not found

2009-02-20 Thread Christian Helmbold
This is because of changes while writing my last email. Now all package names 
are changed, but the error still occurs.

Christian





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



Re: AW: Troubles with Spring: bean of type X not found

2009-02-20 Thread jWeekend

Christian,

The declared type of your repository field should be an interface (that
PageRepository implements, in this case). In the Spiring config, your
PageRepository is used as a class, so I guess it is not an interface.

The proxy Wicket will inject is of the type of that interface, not
(necessarily) of the implementation class.

Does that make sense?

Regards - Cemal
http://jWeekend.com jWeekend 



christian.helmbold wrote:
 
 This is because of changes while writing my last email. Now all package
 names are changed, but the error still occurs.
 
 Christian
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Troubles-with-Spring%3A-bean-of-type-X-not-found-tp22124921p22128992.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



AW: AW: Troubles with Spring: bean of type X not found

2009-02-20 Thread Christian Helmbold
Hello Cemal

thanks for your advice. Know I have extracted an interface which is used in my 
WikiPage class and implemented by my Repository, but the the error is the same.

public class PageRepository extends RepositoryPage implements IPageRepository
{
...
}

public class WikiPage extends WebPage
{
  @SpringBean
  IPageRepository repository;
...
}

Error message:

java.lang.IllegalStateException: bean of type 
[com.helmbold.wicki.domain.IPageRepository] not foundI also tried to use a 
named bean, then I get:


org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 
'pageRepository' is defined

It seems like my application cannot access the Spring but context. But Spring 
itself seems to work, since it creates my Wicket app.

Sometimes I ask myself if Spring is the solution or the problem ;-)
Regards
Christian

 -- 
http://www.groovy-forum.de





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