Jetty Annotation Timeout Reason

陌路散爱 提交于 2019-12-03 01:24:25
discolojr

I've got the same error and to fix it, you should add to your start script (start.ini) the following:

-Dorg.eclipse.jetty.annotations.maxWait=120

120 is for two minutes of annotation scanning in case that you need a higher value, just set it to the propper one.

One more (in my opinion) convinient way is to set this property using a jetty.xml like so:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure>
    <Call name="setProperty" class="java.lang.System">
        <Arg>org.eclipse.jetty.annotations.maxWait</Arg>
        <Arg>120</Arg>
    </Call>
</Configure>

This way you can omit the commandline args

It is useless to scan all dependent jars, you can make the scanning pattern more restrictive to only match certain jars:

<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <version>9.2.8.v20150217</version>
  <configuration>
    <webAppConfig>
      <contextPath>/</contextPath>
      <webInfIncludeJarPattern>.*/foo-[^/]*\.jar$|.*/classes/.*</webInfIncludeJarPattern>
    </webAppConfig>
  </configuration>
</plugin>

See webInfIncludeJarPattern doc for more details: http://www.eclipse.org/jetty/documentation/9.4.x/jetty-maven-plugin.html#configuring-your-webapp

The property (-Dorg.eclipse.jetty.annotations.maxWait=120) can be added to start.ini so it works for all the webapps in your app base.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!