PLEASE HELP!
I'm having an issue regarding configuration of Embedded Jetty to run 2 Jersey Servlets in 2 classes, package entry. It runs from the Eclipse, but once when exported as runnable jar file, I'm getting ERROR: 500, for the one run secondly.
It is Maven project and the tool I'm using for creating runnable jar is <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>
,
while the Server point is configured as below:
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
context.setContextPath("/");
HttpConfiguration https = new HttpConfiguration();
https.addCustomizer(new SecureRequestCustomizer());
ServerConnector connector = new ServerConnector(jettyServer);
connector.setPort(10001);
jettyServer.setConnectors(new Connector[] { connector });
jettyServer.setHandler(context);
ServletHolder jerseyServletEntry = context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class,
"/entry/*");
jerseyServletEntry.setInitOrder(0);
jerseyServletEntry.setInitParameter("jersey.config.server.provider.classnames",
EntryPoint.class.getCanonicalName());
EntryPoint.logger.info("Server is starting up... ");
ServletHolder jerseyServletNoEntry = context.addServlet(org.glassfish.jersey.servlet.ServletContainer.class,
"/noentry/*");
jerseyServletNoEntry.setInitOrder(1);
jerseyServletNoEntry.setInitParameter("jersey.config.server.provider.classnames",
NoEntryPoint.class.getCanonicalName());
NoEntryPoint.logger.info("Server is starting up... ");
The Postman error I've got :
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<title>Error 500 </title>
</head>
<body>
<h2>HTTP ERROR: 500</h2>
<p>Problem accessing /entry/input//7858/768434. Reason:
<pre> Request failed.</pre>
</p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
Reminder: It works fine in Eclipse, and no errors listed when running in console with java -jar command.