web 项目配置jetty

阅读: 评论:0

web 项目配置jetty

web 项目配置jetty

 

1.原文链接:

2.复制副本

Run-Jetty-Run (RJR) with Jetty 8 and Servlet 3.0 scanns all JAR files ignoring WebInfIncludeJarPattern l

I'm using Servlet 3.0 without l just using Spring WebApplicationInitializer. When I start the Webapplication with Run-Jetty-Run in eclipse, the JARScanning takes about 40 seconds since it tries to find HandlesTypes annotations in all jars.

Thus, I tried to set the WebInfIncludeJarPattern in l (I also l) and put it in the webapp/WEB-INF folder as described in . I also set metadata-complete="true". The content of l file is:

<Configure class=&#lipse.jetty.webapp.WebAppContext"><Call name="setAttribute"><Arg&lipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg><Arg>.*/.*foo-api-[^/].jar$|./.*bar-[^/].jar$|./.*wibble[^/]*.jar$</Arg></Call>
</Configure>

I'm using Servlet 3.0 without l just using Spring WebApplicationInitializer. When I start the Webapplication with Run-Jetty-Run in eclipse, the JARScanning takes about 40 seconds since it tries to find HandlesTypes annotations in all jars.

Thus, I tried to set the WebInfIncludeJarPattern in l (I also l) and put it in the webapp/WEB-INF folder as described in . I also set metadata-complete="true". The content of l file is:

<Configure class=&#lipse.jetty.webapp.WebAppContext"><Call name="setAttribute"><Arg&lipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg><Arg>.*/.*foo-api-[^/].jar$|./.*bar-[^/].jar$|./.*wibble[^/]*.jar$</Arg></Call>
</Configure>

However, the JarScanner still scans all the JAR files. In the debug output I can see, that l file is parsed AFTER all the JARScanning is done:

OUTPUT:

2013-08-30 09:09:52.836:DBUG:oejw.WebAppContext:j.w.WebAppContext{/admin2,[file:/C:/....../src/main/webapp/]} with runjettyrun.webapp.RJRWebInfConfiguration@1cdc4a5
......
2013-08-30 09:09:52.979:DBUG:oejw.WebAppContext:j.w.WebAppContext{/admin2,[file:/C:/..../src/main/webapp/]} lipse.jetty.webapp.WebXmlConfiguration@136f39e
2013-08-30 09:09:53.076:DBUG:oejw.WebDescriptor:file:/C:/......../src/main/webapp/l: Calculated metadatacomplete = True with version=3.0
2013-08-30 09:09:53.076:DBUG:oejw.WebAppContext:j.w.WebAppContext{/admin2,[file:/C:/....../src/main/webapp/]} with runjettyrun.webapp.RJRMetaInfoConfiguration@164de63
... <LOTS OF JARSCANNING>
2013-08-30 09:10:36.677:DBUG:oejw.JarScanner:Search of file:/C:/......./httpclient-cache-4.1.2.jar
2013-08-30 09:10:36.710:DBUG:oejw.WebAppContext:j.w.WebAppContext{/.................} lipse.jetty.webapp.JettyWebXmlConfiguration@803365
2013-08-30 09:10:36.711:DBUG:oejw.JettyWebXmlConfiguration:l
2013-08-30 09:10:36.715:DBUG:oejw.JettyWebXmlConfiguration:Configure: file:/C:/......./src/main/webapp/l

How can I force RJR to pick up l earlier and only scan the files specified in there? Or is there any other way in RJR to specify the JARS to be scanned?

I am using following versions: Eclipse: Kepler Release 4.3 Build id: 20130614-0229 RJR: 1.3.3.201301020723 Jetty: 8.1.8.v20121106

WINDOWS: 64 bit

Thank you

Here is a workaround for speeding up Jetty 8 with

  1. Create a file (l)
  2. Open the RJR configuration
  3. Click on "Show advanced options"
  4. l:

The file (l) must have these lines:

<Configure id="Server" class=&#lipse.jetty.server.Server"><Get name="handler"><Call name="setAttribute"><Arg&lipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg><Arg>.*/mwa-web-.*.jar$</Arg></Call></Get>
</Configure>

Here, I'm telling Jetty that any file starting with mwa-web-* should be scanned for

 

<webInfIncludeJarPattern>:jetty-8.1.x之后的版本可以使用,可选参数,配置加载到Web应用程序的Classloader(WEB-INF classpath)中的Jar包的路径或匹配模式,符合条件的jar包将会被检测META-INF、资源、tld和类的继承关系

 

.html

 

WebInfIncludeJarPattern

<webapp>

<webInfIncludeJarPattern>./*spring.*.jar|.*/classes/.*</webInfIncludeJarPattern>

</webapp>

 

本文发布于:2024-02-04 22:23:50,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170717769660198.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:项目   web   jetty
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23