Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Novice Maven User

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,
My Main class has the following imports:



But each of these imports gives me a warning in Eclipse "The import org.mortbay cannot be resolved"... What are the changes I need to add to my pom.xml to resolve this issue?

Thanks in advance,
 
Saloon Keeper
Posts: 27933
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These are all Jetty internal classes. Jetty is a J2EE container, which means that unless you're actually customizing Jetty, you shouldn't be using a Main class nor importing any of the org.mortbay.jetty packages, since J2EE requires a WAR and use the javax. enterprise APIs not the Jetty-specific implementations.
 
Tumaini Kilimba
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:These are all Jetty internal classes. Jetty is a J2EE container, which means that unless you're actually customizing Jetty, you shouldn't be using a Main class nor importing any of the org.mortbay.jetty packages, since J2EE requires a WAR and use the javax. enterprise APIs not the Jetty-specific implementations.



Am trying to create an executable war (by embedding jetty in the war) as per the following example described HERE... So what are the changes I need to add to my pom.xml to resolve this issue?
 
Tim Holloway
Saloon Keeper
Posts: 27933
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. One of those things.

What you are actually attempting to do is create a self-executing JAR where the main class of the JAR launches an embedded J2EE appserver (jetty) and the JAR serves as the one and only WAR for the appserver. As I've recently mentioned, classpaths structuring in WARs make all this a little tricky, but it's doable.

The main thing that's necessary for Maven to pull this off is that you need to pull a dependency for Jetty itself. I think probably what you're looking for is the org.mortbay.jetty/jetty-embedded dependency.

Setup to build a JAR, add the above dependency to the POM and see if it builds.
 
If tomatoes are a fruit, then ketchup must be a jam. Taste this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic