I try start Jersey + Jetty + Nginx via this tutorial and I cannot use war file. How can I start my java application?
I start application by right click on BackendServer.java and click "Run" in IDEA or using in terminal java -cp /home/example/backend/build/WEB-INF/lib/backend.jar:/home/example/backend/libs/* com.example.backend.BackendServer
.
Project structure is described here.
/opt/jetty/webapps/backend.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC
"-//Mort Bay Consulting//DTD Configure//EN"
"http://www.eclipse.org/jetty/configure_9_0.dtd">
<!--
Configure a custom context for serving javadoc as static resources
-->
<Configure class="org.eclipse.jetty.server.handler.ContextHandler">
<Set name="contextPath">/</Set>
<Set name="resourceBase"><SystemProperty name="jetty.home" default="."/>??????????</Set>
<Set name="handler">
<New class="org.eclipse.jetty.server.handler.ResourceHandler">
<Set name="welcomeFiles">
<Array type="String">
<Item>index.html</Item>
</Array>
</Set>
<Set name="cacheControl">max-age=3600,public</Set>
</New>
</Set>
</Configure>
What should be instead ???????
? Should I use embedded jetty in BackendServer.java? I know that I have redirect requests from nginx to jetty, but I don't understand how can I start jersey application with jetty...