spring - jetty 9 : No Spring WebApplicationInitializer types detected on classpath

标签 spring jetty jetty-9

我正在尝试从 jetty 7.6 切换到 jetty-9.2.1。我进行了所需的配置更改。但在初始化jetty服务器时,我不断收到“在类路径上未检测到Spring WebApplicationInitializer类型”消息。

我的部署管理器是:

新类=“org.eclipse.jetty.deploy.providers.WebAppProvider”>

<Set name="monitoredDirName">
  <Property name="cometd.deploy.dir" default="/u/khandela/cometD/webapps_dev/" />
</Set>
<Set name="defaultsDescriptor">
  <Property name="jetty.home" default="."/>/etc/webdefault.xml
</Set>
<Set name="scanInterval">1</Set>
<Set name="extractWars">true</Set>
<Set name="contextXmlDir">
 <Property name="jetty.home" default="." />/contexts
</Set>

在新版本中,“contextXmlDir”已被删除。所以我也从配置中删除了。当我运行时,我不断收到上面显示的消息。如果是的话我应该把它加回来吗?

在运行时我正在使用: --module=server,jsp,deploy,jmx,resources,websocket,ext,plus,annotations

以下是我运行服务器时收到的详细消息:

2014-07-08 14:07:42.634:INFO::main: Logging initialized @512ms
2014-07-08 14:07:43.253:INFO:oejs.Server:main: jetty-9.2.1.v20140609
2014-07-08 14:07:43.306:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/u/khandela/cometD/logs_dev/webapps] at interval 1
2014-07-08 14:07:43.306:WARN:oejdp.ScanningAppProvider:main: Does not exist: file:/u/khandela/cometD/logs_dev/webapps
2014-07-08 14:07:43.450:INFO:oejs.AbstractNCSARequestLog:main: Opened /u/khandela/cometD/logs_dev/jetty-20140708.log
2014-07-08 14:07:43.468:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/u/khandela/cometD/webapps_dev/] at interval 1
2014-07-08 14:07:46.945:INFO:cometd:main: No Spring WebApplicationInitializer types detected on classpath
2014-07-08 14:07:47.332:INFO:cometd:main: Initializing Spring root WebApplicationContext
2014-07-08 14:07:48.696:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@6fd02e5{/cometd,file:/tmp/jetty-0.0.0.0-8107-cometd.war-_cometd-any-404202732061519131.dir/webapp/,AVAILABLE}{/u/khandela/cometD/webapps_dev/cometd.war}
2014-07-08 14:07:49.183:INFO:oejs.ServerConnector:main: Started ServerConnector@180bc464{HTTP/1.1}{0.0.0.0:8107}
2014-07-08 14:07:49.184:INFO:oejs.Server:main: Started @7083ms

谢谢

阿努杰

最佳答案

如果您配置 org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern jetty.xml 中的属性将起作用。您可以在 Jetty Documentation 上找到有关此参数的更多信息。 :这是一个可以在 org.eclipse.jetty.webapp.WebAppContext 上设置的上下文属性。控制容器类路径的哪些部分应该处理诸如注释之类的事情。

<Call name="setAttribute">
  <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
  <Arg>.*/foo-[^/]*\.jar$|.*/bar-[^/]*\.jar$|.*/bin/.*|.*/classes/.*|.*/target/.</Arg>
</Call>

关于spring - jetty 9 : No Spring WebApplicationInitializer types detected on classpath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24627632/

相关文章:

java - 解决 Jetty 应用程序中的 java 内存泄漏问题

tomcat - 在 Jetty/Tomcat 中处理异常的不同方式

java - Jetty 服务器 9.4.10 - 超时异常 - 空闲超时已过期

java - Jetty 应用程序中的系统环境变量

tomcat - Tomcat 和 Jetty 的 web.xml 文件是否不同

java - ResponseEntity<Stream<MyObject>> 是否将所有内容都存储在内存中?

java - spring security上的用户名随机未设置

java - 使用 2 个不同的数据源 : Spring batch

spring - 使用 Spring Data 存储库在 Mongodb 中获取最后创建的文档

java - 如何使用jetty和spring boot收集并获取连接池统计信息?