1.原文链接:
2.复制副本
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
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小时内删除。
留言与评论(共有 0 条评论) |