Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "HowTo/FasterStartUp" page has been changed by KonstantinKolinko:
https://wiki.apache.org/tomcat/HowTo/FasterStartUp?action=diff&rev1=22&rev2=23

Comment:
Amend WebSocket annotation scanning note and move it into general 'scanning' 
section. Several minor improvements as well.

  
  Among the scans the annotation scanning is the slowest. That is because each 
class file (except ones in ignored JARs) has to be read and parsed looking for 
annotations in it.
  
+ An example of a container-provided SCI that triggers annotation scanning is 
the WebSocket API implementation which is included with standard distribution 
in all versions of Tomcat 8 and with Tomcat 7 starting with 7.0.47. An SCI 
class declared there triggers scanning for WebSocket endpoints (the classes 
annotated with `@ServerEndpoint` or implementing `ServerApplicationConfig` 
interface or extending the abstract `Endpoint` class). If you do not need 
support for WebSockets, you may remove the WebSocket API and WebSocket 
implementation JARs from Tomcat (`websocket-api.jar` and 
`tomcat7-websocket.jar` or `tomcat-websocket.jar`).
+ 
  ''A note on TLD scanning'': In Tomcat 7 and earlier the TLD scanning happens 
twice,
  
   * first, at startup time, to discover listeners declared in tld files (done 
by `TldConfig` class),
@@ -48, +50 @@

  
  The `<absolute-ordering>` element specifies which web fragment JARs 
(according to the names in their `WEB-INF/web-fragment.xml` files) have to be 
scanned for SCIs, fragments and annotations. An empty `<absolute-ordering/>` 
element configures that none are to be scanned.
  
+ In Tomcat 7 the `absolute-ordering` option affects discovery both of SCIs 
provided by web application and ones provided by the container (i.e. by the 
libraries in `$CATALINA_HOME/lib`). In Tomcat 8 the option affects the web 
application ones only, while the container-provided SCIs are always discovered, 
regardless of `absolute-ordering`. In such case the `absolute-ordering` option 
alone does not prevent scanning for annotations, but the list of JARs to be 
scanned will be empty, and thus the scanning will complete quickly. The classes 
in `WEB-INF/classes` are always scanned regardless of `absolute-ordering`.
- Note: in Tomcat 8 the container-provided SCIs are always discovered, 
regardless of `absolute-ordering`. It does not prevent scanning for 
annotations, but the list of JARs to be scanned will be empty, and thus it will 
complete quickly. The classes in `WEB-INF/classes` are always scanned 
regardless of `absolute-ordering`.
- An example of a container-provided SCI is in the WebSocket API implementation 
jar (`tomcat-websocket.jar`, `tomcat7-websocket.jar`) which is included with 
Tomcat 7 starting with 7.0.47. If you do not need support for WebSockets, you 
may remove it.
  
  Scanning for web application resources and TLD scanning are not affected by 
these options.
  
@@ -64, +65 @@

  
  In Tomcat 7 JAR files can be excluded from scanning by listing their names or 
name patterns in a 
[[http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#JAR_Scanning|system
 property]]. Those are usually configured in the `conf/catalina.properties` 
file.
  
- In Tomcat 8 you can use a 
[[http://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html#JAR_Scanning|system
 property]] or configure a `<JanScanFilter>` 
[[http://tomcat.apache.org/tomcat-8.0-doc/config/jar-scan-filter.html| 
element]] in the 
[[http://tomcat.apache.org/tomcat-8.0-doc/config/context.html|context file]] of 
your web application.
+ In Tomcat 8 there are several options available. You can use a 
[[http://tomcat.apache.org/tomcat-8.0-doc/config/systemprops.html#JAR_Scanning|system
 property]] or configure a `<JanScanFilter>` 
[[http://tomcat.apache.org/tomcat-8.0-doc/config/jar-scan-filter.html| 
element]] in the 
[[http://tomcat.apache.org/tomcat-8.0-doc/config/context.html|context file]] of 
your web application.
  
  == Entropy Source ==
  Tomcat 7+ heavily relies on !SecureRandom class to provide random values for 
its session ids and in other places. Depending on your JRE it can cause delays 
during startup if entropy source that is used to initialize !SecureRandom is 
short of entropy. You will see warning in the logs when this happens, e.g.:

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to