java - Jetty - Jersey and Jar issue -
java - Jetty - Jersey and Jar issue -
i'm new in jetty.
i works on tomcat project need utilize embedded jetty server.
my project construction is:
src bundle controller main ... webcontent meta-inf web-inf lib web.xml
i created main within package.main this:
public class serverlauncher { public static void main(string[] args) throws exception { new serverlauncher().configureserver(); } public void configureserver() throws exception{ server server = new server(8080); webappcontext webapp = new webappcontext(); webapp.setcontextpath("/"); webapp.setwar("webcontent"); server.sethandler(webapp); server.start(); server.join(); } }
my problem is:
when execute eclipse, correctly works.
when export runnablejar file, doesn't find me webcontent:
slf4j: version of slf4j requires log4j version 1.2.12 or later. see http://www.slf4j.org/codes.html#log4j_version - logging initialized @248ms - jetty-9.3.z-snapshot - web application not found webcontent - failed startup of context o.e.j.w.webappcontext@7d19979e{/,null,null}{webcontent} java.io.filenotfoundexception: webcontent @ org.eclipse.jetty.webapp.webinfconfiguration.unpack(webinfconfiguration.java:493) @ org.eclipse.jetty.webapp.webinfconfiguration.preconfigure(webinfconfiguration.java:72) @ org.eclipse.jetty.webapp.webappcontext.preconfigure(webappcontext.java:460) @ org.eclipse.jetty.webapp.webappcontext.dostart(webappcontext.java:496) @ org.eclipse.jetty.util.component.abstractlifecycle.start(abstractlifecycle.java:68) @ org.eclipse.jetty.util.component.containerlifecycle.start(containerlifecycle.java:132) @ org.eclipse.jetty.server.server.start(server.java:388) @ org.eclipse.jetty.util.component.containerlifecycle.dostart(containerlifecycle.java:114) @ org.eclipse.jetty.server.handler.abstracthandler.dostart(abstracthandler.java:61) @ org.eclipse.jetty.server.server.dostart(server.java:355) @ org.eclipse.jetty.util.component.abstractlifecycle.start(abstractlifecycle.java:68) @ package.main.serverlauncher.main(serverlauncher.java:19) - started serverconnector@53622a11{http/1.1}{0.0.0.0:8080} - started @462ms
how can correctly export jar in order execute jar correctly?
thanks!
you need specify class main method in it. utilize manifest file that.
here link may help:
http://www.skylit.com/javamethods/faqs/createjar.html
java eclipse jetty
Comments
Post a Comment