wiki:HowToRunUnderJettyInEclipse

Author: François Prunayre Date: 01/21/2010

How to run GeoNetwork using embedded Jetty under Eclipse ?

  • create a Java project
  • svn co https://geonetwork.svn.sourceforge.net/svnroot/geonetwork/trunk in your new Java project
  • define the following directory as source directory
    • src
    • jeeves/src
    • cachingxslt/src
  • add the lib in your project build path
    • web/geonetwork/WEB-INF/lib/*.jar
    • web/intermap/WEB-INF/lib/*.jar
    • jetty/lib//*.jar
  • In order to avoid a ClassNotFoundException for org.mortbay.jndi.InitialContextFactory, you could modify the src/jndi.properties file as following :
    • java.naming.factory.url.pkgs=org.mortbay.naming
    • java.naming.factory.initial=org.mortbay.naming.InitialContextFactory
  • click on "Run configuration ..."
  • add a new "Java Application"
  • configure the Main panel:
    • Main class is the Jetty main start class org.mortbay.start.Main (If you can't find this class using the search button, check that jetty/start.jar is in your build path)

  • configure the Arguments panel
    • working directory is the bin folder.
    • VM arguments allows to manage memory used by the application

  • check the classpath contains all necessary jar files.

  • add source folder (needed for debugging)

  • save and start the application using normal/debug/profiling mode.

Issues

  • I'm still looking how to redirect all logs info (including geonetwork.log) to the eclipse console view.
  • If you have some errors about classes not available due to access restrictions ("Access restriction: The type BASE64Encoder is not accessible due to restriction on required library" for example), just go to the "Window" / "Preferences" / "Java" / "Compiler" / "Errors/Warnings" menu and then set "Forbidden reference (access rules)" to "Warning" or "Ignore" instead of "Error".

Last modified 6 years ago Last modified on Nov 7, 2013, 9:14:18 AM

Attachments (5)

Download all attachments as: .zip