Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6075873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:32:34+00:00 2026-05-23T10:32:34+00:00

To my knowledge, and according to instructions I’ve found (like this and this too

  • 0

To my knowledge, and according to instructions I’ve found (like this and this too), I need this in web.xml for Spring to work:

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

In my Wicket application class, I’d have:

public class MyApplication extends WebApplication {

    @Override
    protected void init() {
        super.init();    
        addComponentInstantiationListener(new SpringComponentInjector(this));
    }

    @Override
    public Class<? extends Page> getHomePage() {
        return HelloWorldPage.class;
    }
}

Problem is, whenever I have ContextLoaderListener in web.xml, Wicket doesn’t start. I just get 404 errors (or blank page), and console output like:

SEVERE: Error listenerStart
Jun 28, 2011 12:49:04 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,973] milliseconds.
Jun 28, 2011 12:49:04 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
Jun 28, 2011 12:49:04 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [org.hsqldb.jdbc.JDBCDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jun 28, 2011 12:49:04 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jun 28, 2011 12:49:04 PM org.apache.catalina.startup.HostConfig deployDirectory

I’m using latest releases of both frameworks (Wicket 1.4.17 & Spring 3.0.5), and Tomcat 7 to run them on (the same thing happens with Tomcat 6). Also, I have the following jars in WEB-INF/lib. Something missing or too much?

antlr-2.7.6.jar                        log4j-1.2.16.jar              spring-web-3.0.5.jar
commons-collections-3.1.jar            mysql-connector-5.1.10.jar    slf4j-api-1.6.1.jar
dom4j-1.6.1.jar                        spring-beans-3.0.5.jar        slf4j-log4j12-1.6.1.jar
guava-r09.jar                          spring-context-3.0.5.jar      wicket-1.4.17.jar
hibernate-3.6.5.jar                    spring-core-3.0.5.jar         wicket-auth-roles-1.4.17.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar  spring-jdbc-3.0.5.jar         wicket-datetime-1.4.17.jar
hsqldb.jar                             spring-orm-3.0.5.jar          wicket-ioc-1.4.17.jar
javassist-3.12.0.GA.jar                spring-test-3.0.5.jar         wicket-spring-1.4.17.jar
jta-1.1.jar                            spring-transaction-3.0.5.jar  wicketstuff-annotation-1.4.17.2.jar

The rest of the web.xml (I’ve tried setting up Wicket with both servlet and filter; makes no difference):

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <display-name>My App</display-name>

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

    <context-param>
        <param-name>configuration</param-name>
        <param-value>development</param-value>
    </context-param>

    <filter>
        <filter-name>MyApp</filter-name>
        <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
        <init-param>
            <param-name>applicationClassName</param-name>
            <param-value>com.acme.MyApplication</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>MyApp</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

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

</web-app>

Googling around I found someone with the same problem, but no solutions.

Funny thing is, I’ve had Spring and Wicket working together nicely before, with pretty much identical setup. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:32:35+00:00Added an answer on May 23, 2026 at 10:32 am

    Edit: Later on I realised the root problem here most likely was missing log configuration. In our case (using SLF4J with log4j), after adding proper configuration in log4j.properties all kinds of warnings & errors logged by libraries became visible, even with Tomcat.


    I tried Jetty instead of Tomcat, and started getting better error messages. Turns out there were several libraries missing — stuff needed by some of the libraries I already used.

    2011-06-28 15:57:01.879:WARN::Unable to reach node goal: started
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:640)
    

    Some of the libs apparently require commons-logging, which I added. Next:

    java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor
        at org.springframework.context.support.AbstractRefreshableApplicationContext.customizeBeanFactory(AbstractRefreshableApplicationContext.java:218)
    

    Added spring-asm. Next:

    org.springframework.beans.factory.BeanDefinitionStoreException: 
      Unexpected exception parsing XML document from class path resource [applicationContext.xml]; 
      nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/config/AopNamespaceUtils
    

    Added spring-aop. Next something a little less straight-forward:

    org.springframework.beans.factory.BeanDefinitionStoreException: 
      Unexpected exception parsing XML document from class path resource [applicationContext.xml]; 
      nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor
    

    Found discussion about aopalliance missing in Spring blog comments. Apparently it has been completely removed from spring-aop, and you need to get aopalliance.jar from sourceforge.

    (I think this kind of swamp is Java EE at its worst: I don’t know what spring-asm or spring-aop let alone aopalliance do, but apparently I need them. :-P)

    So, added aopalliance.jar. Later I still needed to add spring-expression and cglib-2.2 (which comes with Hibernate).

    After that, some problems with my Spring/Hibernate persistence layer configuration remain, but they are out of scope for this question. Otherwise Wicket & Spring now work nicely (e.g. for injecting service layer objects on Wicket pages).

    I guess one moral of this is that in some cases Tomcat eats useful error messages and Jetty might be better for debugging. Also, using Maven would have probably helped with the dependency hell somewhat (but it’s not free of problems either).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My knowledge of matlab is merely on a need to know basis, so this
according to my knowledge, this feature already exists in PHP. lets look at the
According to my (limited) knowledge of the C++ spec, the vtable of a class
According to my teacher, it's bad practice to write user-defined functions like this: int
My knowledge of xml and php is somewhat basic but have been able to
According to this http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html article, I defnitely should. Quote Gentle, yet insistent executive summary:
I recently ran into an issue at work in which, at least according to
I would like to specify the order of testing in CppUnit. According to my
As a student in web development, I work with PHP, mainly through CMSs. I
I have a list of favourite movies and I'd like to sort them according

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.