• Post Reply Bookmark Topic Watch Topic
  • New Topic

Howto Configure Eclipse for both Tomcat w/servlet-api.jar and in-process Jetty w/servlet-api-2.5?  RSS feed

Ranch Hand
Posts: 1408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am assigned to a project that uses:

  • Subversion
  • Tomcat
  • servlet-api.jar (i.e., pre-2.5 version)

  • We develop using Eclipse.

    The team has set up a J2EE server project in Eclipse that uses Tomcat.

    This set up does not allow me to step through the server code in the debugger, so I would like to add a class and an Eclipse run configuration that will allow me to run the servlet as an embedded-Jetty application.

    My main issue is that Jetty appears to rely on the servlet-api-2.5.jar. However, my Eclipse project relies on a separate library project that includes a bunch of Jar files -- including the older servlet-api.jar.

    One solution is to upgrade to use of the servlet-api-2.5 for production. Let's assume that management is not willing to make this "risky" change.

    Therefore, I'd _like_ to be able to do is to continue compiling my servlet in Eclipse using the old servlet-api.jar -- and running it that way in Tomcat to ensure it will work in the production environment.

    But I'd also like to be able to run my servlet in Eclipse as an application using embedded Jetty (and thus the servlet-api-2.5.jar) for initial debugging.

    Is there a reasonably clean way to set up a separate Eclipse run configuration for my new start-up class that relies on the other Jars in the library project -- but NOT servlet-api.jar, and which has both servlet-api-2.5.jar and Jetty.jar in its classpath?

    How would I do this?

    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!