How to setup Wicket Examples in Eclipse
Wicket examples is a good place to learn Apache Wicket by examples, and a must reference site for new or experienced Wicket’s developers. In this Wicket examples site, it almost contains all of the usage of the common wicket’s components.
In this guide, we show you how to setup the above Apache Wicket example site in your local development environment (Eclipse IDE).
Tools used :
- Apache Wicket 1.4.17
- Eclipse 3.6
- Maven 3
1. Download Source Code
Download Apache Wicket 1.4.17 from http://wicket.apache.org/. The Wicket example code is packaged inside the “src” folder.
2. Review Directory
Extracts the downloaded Wicket zip file, review the directory structure. The folder “wicket-examples“, which inside the “$WICKET_PATH/src” folder is what you need.

3. Maven Build
Navigate to the “wicket-examples” folder , compile and build with Maven, and make it support Eclipse WTP features.
$WICKET_EXAMPLE_FILE_PATH> mvn eclipse:eclipse -Dwtpversion=2.0
P.S Maven will configure the project and download the project dependencies automatically.
4. Eclipse Project + WTP
Import the project into Eclipse IDE (you should know how
).
However, in Wicket 1.4.17, the Maven “-Dwtpversion=2.0” option seem not working in my Eclipse 3.6, because i noticed Eclipse facets files and deployment dependency libraries are not configure properly. If you have the same problem, do following steps :
1. Right click on project –> Properties –> “Project Facets“. Select “Dynamic Web Module” and “Java“.

2. Same windows –> Select “Deployment Assembly“, make sure the libraries and root deploy path “/” are configured properly. Just add it if it’s missing.

5. Deploy + Test
In Eclipse IDE, create a Tomcat instance, assigned your configured “wicket-example” project to the new Tomcat instance and start it.
Visit this URL : http://localhost:8080/wicket-examples/

Done. The entire wicket examples site is cloned into your local development environment.
[...] Hello World Example A simple hello world to explore the basic structure of Wicket web application. Setup Wicket examples in local enviroment Setup a cloned Wicket example site in your local development environment for quick reference. [...]
This is how my Deployment assembly looks like:
http://dl.dropbox.com/u/8189835/deploymentassembly.jpg
Is there anything missing here?
I keep getting the same error. It worked with the Jetty server, as you suggested, but I would like to run wicket-examples in the Tomcat server in Eclipse.
Just tested again, the wicket examples is working fine in my Eclipse. Hmm…. your dependency look fine as well. Did you build with Maven? “mvn eclipse:eclipse -Dwtpversion=2.0″.
applicationContext.xml is belong to Spring, still dun know the root cause of it, just disable your contactDao bean and try again.
Filip, were you able to figure out why you were getting the ClassNotFoundException on Tomcat server? Running into the same problem and my deployment assembly looks just like your dropbox screenshot.
Doesn’t work for me, I get this exception when trying to start Tomcat (Wicket-examples 1.4 and Tomcat 7)
I found a solution, it worked when I skipped step 4 and built the project from the downloaded archive, without first moving it.
The pom.xml in the wicket-examples directory is dependent on the pom.xml in the parent directory, so you just cannot move it somewhere else and expect it to work.
Hi Diego, thanks for your inputs, Wicket is changing fast, article is updated to Wicket 1.4.17.
I am also getting this error. I have followed each step, exactly as your tutorial describes.
Article is tested under Wicket 1.4.17 + Eclipse 3.6. Please make sure your Eclipse facets and deployment is configured properly.
Can I please get in touch with you somehow? If you have Skype it would be fantastic
My skype username is filip_h
Thank you very much!
1- Both facets and deployment are configured as you described in this article.
2- In step 3 you write “compile and build with Maven”, what is the command for this?
3- I am using:
“Eclipse IDE for Java EE Developers”
I also tried downloading: “Eclipse Classic 3.6.2″, but in this version of Eclipse I cannot add a server instance, because the server view is not possible to add to workspace.
4- I also tried both Maven 3 and 2
I’m still getting this message when I run the tomcat 6 server.
Also another thing I noticed was that in the project facets of the wicket-examples project it says:
Java … version 1.5 (not 1.6 like in your screenshot)
Dynamic Web Module … version 2.3 (not 2.4 like in your screenshot)
Maybe this has something to do with it?
This is the exact error message I receive:
ERROR – ContextLoader – Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.wicket.spring.common.ContactDaoImpl] for bean with name ‘contactDao’ defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.wicket.spring.common.ContactDaoImpl……..
Do not nest this comment anymore, please open a new thread.
Look like your dependency is missing, check your eclipse deployment assembly and add all dependencies. Alternative, just use “mvn jetty:run” to run it.
Hi..
i’m new wicket user. I would like to ask your advise about the windows model. I found out the when windows model popup. The current main page at backgroup are disabled. Due to the user requirement, how to i allow the current page at backgroup are allow to edit. Because not very page we must be disabled. Thanks
Green
Thank you very much, this article helped me a lot!!!!
hello, how are you friend, i follow the steps for developing the application but it shows a server error, I could help, the error that showed me tomcat is:
HTTP Status 404 – / wicket-examples /
————————————————– ——————————
type Status report
Message / wicket-examples /
Desc The requested resource (/ wicket-examples /) is not available esti ¿½.
404 is not found, you should check your ‘web.xml’ configuration file. Or would you mind to zip it and send it to me for the debuging?
Excellent article! It got me going even though I use Linux and wanted Wicket 1.3.5. Thanks a lot! (Please keep it up, it’s one of the few resources with this information.)
indeed, Wicket’s resources are too little…
Thank you !
This is the only place I have found telling how to get everything with wicket including the examples to work. “How difficult can it BE!!”
/Tommy
Welcome, enjoy wicket programing ~
[...] Please set up a wicket example to explore more about wicket usage.How do setup Wicket Examples in Eclipse [...]