Server startup failing with org.xwiki.container.servlet.XWikiServletContextListener

If you follow the exception stack trace you will see: Caused by: java.lang.ClassNotFoundException: <class>

There are some possibilities:

  • Sometimes WTP "forgets" a dependency for some reason. Most of the time you can fix it easily by cleaning the server:
    • Go to Servers view, right click on your server and then click Clean...
    • Restart the server
  • You imported a Maven Project into the workspace and forgot to add it to the Deployment Assembly. See Link Jar project to the web project
  • The value you defined for the XWIKIPLATFORM (see Mirror XWiki war) contains spaces or other special characters. Eclipse may handle it well, but you may face problems when deploying it through WTP.

I imported a JAR which is already a dependency of xwiki debug project but it's not deployed

You may need to do right click -> Maven -> Update project... on the xwiki debug project.

Should not reproduce anymore

Keeping them here in case of a M2e/Eclipse regression.

"Too many open files" on Linux

Stopped applying this workaround for years and never noticed any related error.

Looks like by default (at least on Ubuntu) the limits of files to open is too low for the couple Eclipse3.4/M2Eclipse (I never had this with Eclipse 3.3).

You add up this limit by editing /etc/security/limits.conf file and by setting:

* soft nofile 2048
* hard nofile 2048

I get "Error creating zip file xwiki-core.jar: duplicate entry: META-INF/LICENSE" when starting the server

I don't have this problem anymore with M2Eclipse 0.12 on Eclipse 3.6.

XWiki uses the maven remote resource plugin to add the LICENSE and NOTICE files in all of the XWiki generated jars and it's doing it by copying the files in the output folders: classes and test-classes. The problem is that Eclipse does not make any difference between classes and test-classes, builds everything in the same jar and complains because there are files with the same entry name.

There are some crappy solutions:

  • remove the META-INF folder from test-classes by hand each time you get the error
  • remove the test-classes from the output folders in project Properties. This is easier when you are editing a lot the resources files because the META-INF folder is re-generated each time you modify something.

When I look in a published jar it seems resources has not been built

I don't have this problem anymore with M2Eclipse 0.12 on Eclipse 3.6.

M2Eclipse build resources only when it's modified and sometimes it comes that it forgot it for a reason I don't know.

Just modify any resource of the jar project and save it and it should rebuild it correctly.

Since m2eclipse 0.9.8 it's even worse since the resource are never built:
The "safest" solution is to include resource back in the java build process: by default m2eclipse excludes all the resources to handle it itself but we don't really have a use case where it's really needed. To include it back go to project Properties -> Java Build Path and remove the filter (search src/main/resources "Excluded: **"). Don't remove the filter on test resource unless you want to launch unit tests from Eclipse. Some projects have custom components overwrites for test so if you include it in the runtime you will break things. Until Eclipse itself supports the difference between main and test like maven does we will always have this issue; there is not much M2Eclipse can do here.

My Eclipse can't stop crashing

I don't have this problem anymore with Eclipse 3.4 on Ubuntu Linux

Environment: Linux + Eclipse 3.3

The Eclipse configuration in eclipse.ini seems too fragile in terms of memory at least in the Linux version. You should give a try to the following configuration:


 previous | home


Get Connected