I received outstanding guidance yesterday on integrating wicket-spring into my 
application and combined with the write-up along with a lot of other similar 
articles/blogs I found online, I'm confident I'm on the right track.  I have 
encountered an error that has me a little mystified and was hoping someone 
could help shed some light.  I'm getting the following exception when I attempt 
to start Tomcat within Eclipse:

java.lang.IllegalStateException: bean of type 
[org.apache.wicket.protocol.http.WebApplication] not found

Full stack trace below.

Despite having defined my WebApplication bean in the applicationContext.xml, 
this exception appears at start-up, leading me to believe that it cannot find 
my applicationContext.xml configuration, though I feel that I'm pointing Spring 
and Wicket in the right direction with the following:

<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
</context-param>

<listener>
        
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

I have also adjusted my filter to leverage SpringWebApplicationFactory as 
follows:

<filter>
        <filter-name>wicket.wicketFilter</filter-name>
        
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
        
        <init-param>
                <param-name>applicationFactoryClassName</param-name>
                
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
        </init-param>
</filter>

<filter-mapping>
        <filter-name>wicket.wicketFilter</filter-name>
        <url-pattern>/*</url-pattern>
</filter-mapping>

And in my applicationContext.xml, my WebApplication bean has been defined:

<bean id="wicketApplication" class="com.oa.frontoffice.FrontOfficeApp" />

Lastly, I have the following in my init() method on the WebApplication object:

getComponentInstantiationListeners().add(new SpringComponentInjector(this));

Has anyone encountered this exception before who can offer me some advice on 
where to start digging?

The full stack trace is here:

Jun 25, 2013 8:17:52 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter wicket.wicketFilter
java.lang.IllegalStateException: bean of type 
[org.apache.wicket.protocol.http.WebApplication] not found
        at 
org.apache.wicket.spring.SpringWebApplicationFactory.createApplication(SpringWebApplicationFactory.java:161)
        at 
org.apache.wicket.spring.SpringWebApplicationFactory.createApplication(SpringWebApplicationFactory.java:140)
        at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:370)
        at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:336)
        at 
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
        at 
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
        at 
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
        at 
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
        at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4624)
        at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
        at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

Regards,

Mike

-----Original Message-----
From: Joachim Schrod [mailto:jsch...@acm.org] 
Sent: Monday, June 24, 2013 12:28 PM
To: users@wicket.apache.org
Subject: Re: Wicket with Spring for IOC

Michael Chandler wrote:
> I'm using Wicket with Spring for dependency injection and at first 
> really struggled with what appears to be Wicket serializing my 
> application context.

Then you probably don't use wicket-spring. Or you store your app context in a 
Wicket component, e.g., a page.

The "official" documentation is
https://cwiki.apache.org/confluence/display/WICKET/spring.html
IMHO it's problematic because it tells you first about things you don't want to 
use.

There's a chapter in the new free Wicket guide, but it's very basic as well.

So, here's my method / recommendation:

*snip*

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

Reply via email to