Я получаю следующую ошибку при запуске моего встроенного файла войны на пристани:
>>> cd $JETTY_BASE; java -jar $JETTY_HOME/start.jar
2018-05-24 11:02:05.024:INFO::main: Logging initialized @386ms to org.eclipse.jetty.util.log.StdErrLog
2018-05-24 11:02:05.201:INFO:oejs.Server:main: jetty-9.4.9.v20180320; built: 2018-03-20T05:21:10-07:00; git: 1f8159b1e4a42d3f79997021ea1609f2fbac6de5$
jvm 1.8.0_172-b11
2018-05-24 11:02:05.214:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///Users/dlynch/Srv/bubbleshadow/webapps/] at interval 1
2018-05-24 11:02:05.590:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
2018-05-24 11:02:05.596:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2018-05-24 11:02:05.596:INFO:oejs.session:main: No SessionScavenger set, using defaults
2018-05-24 11:02:05.597:INFO:oejs.session:main: Scavenging every 600000ms
2018-05-24 11:02:05.604:WARN:oejshC.ROOT:main: unavailable
javax.servlet.UnavailableException: Servlet class net.firezeal.bubbleshadow.Application is not a javax.servlet.Servlet
at org.eclipse.jetty.servlet.ServletHolder.checkServletType(ServletHolder.java:553)
bubbleshadow2.xml
<Configure id="bubbleshadow" class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<Set name="war"><Property name="jetty.webapps" default="."/>/bubbleshadow2.war</Set>
<Set name="extractWAR">true</Set>
<Set name="copyWebDir">false</Set>
<Set name="defaultsDescriptor"><Property name="jetty.home" default="."/>/etc/webdefault.xml</Set>
<Set name="overrideDescriptor"><Property name="jetty.webapps" default="."/>/bubbleshadow2.d/override-web.xml</Set>
</Configure>
override-web.xml
<web-app>
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
metadata-complete="false"
version="3.1">
<servlet>
<servlet-name>bubbleshadow2</servlet-name>
<servlet-class>net.firezeal.bubbleshadow.Application</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>bubbleshadow2</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
Application.java
package net.firezeal.bubbleshadow;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
public class Application extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public StartupRunner schedulerRunner() {
return new StartupRunner();
}
}
Я уверен, что мой класс "Application" не рассматривается как javax.servlet.Servlet, потому что я думал, что расширение из SpringBootServletInitializer будет правильным способом сделать это.