2012-01-04 13 views
14

Quando si esegue la mia applicazione JSF 2 in Eclipse sto ottenendo diversi registri di informazioni che TLD è stata saltata perché è già definito come segue:Cosa significa "INFO: TLD ignorato, l'URI è già definito" significa?

Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://www.springframework.org/tags/form is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined 
Jan 3, 2012 7:24:45 PM org.apache.catalina.startup.TaglibUriRule body 
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined 

Sono curioso di sapere, che cosa vuol dire questo registro?

+0

Si prega di astenersi dal ripubblicare le vostre domande. – NullUserException

+2

post duplicato collegato è stato rimosso –

risposta

11

Ciò significa che sono presenti file TLD duplicati nel percorso di runtime del proprio webapp. Poiché i TLD sono normalmente contenuti nei file JAR della libreria, ciò significa che si hanno file JAR duplicati nel percorso di runtime del proprio webapp.

Supponendo di non aver toccato la cartella /lib di appserver né le cartelle /lib del JDK, tali duplicati si trovano nella cartella /WEB-INF/lib del build WAR. Pulirlo

3

ordine di priorità degli URI richiesti dalla specifica è:

J2EE platform taglibs - Tomcat doesn't provide these 

web.xml entries 

JARS in WEB-INF/lib & TLDs under WEB-INF (equal priority) 

Additional entries from the container 

carichi Tomcat TLD due volte.

1, all'avvio di Tomcat, carica tld per trovare gli ascoltatori nei file tld.

2, quando viene compilato il primo file jsp, crea una cache di coppie tld.

1, carico tld per trovare gli ascoltatori in file TLD

Quando si carica da web.xml, mette taglib-uri da web.xml e uri da file TLD in un insieme. Durante il caricamento da WEB-INF o jar, l'uri viene dal file tld.

Tomcat deve evitare la duplicazione dell'aggiunta di listener tld, quindi controlla se uri esiste nel set. Se uri esiste già, lo registra i messaggi che pubblichi e salta l'aggiunta di listener tld.

2, costruire la cache

1) voci web.xml, il tag uri è ottenuto dal web.xml

2) i file TLD scansione sotto WEB-INF, l'URI tag è ottenuto dal file tld

3) scan i jar, il tag uri è ottenuto dai file tld.

Se uri è già esistente, la voce verrà ignorata.

0

Significa, ad esempio, se si utilizzano Tomcat e Maven (o altri server) che si spedisce una libreria JSTL già presente sul server e il server si lamenta.

<dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>jstl</artifactId> 
     <version>1.2</version> 
    </dependency> 

Al momento della applicazione viene distribuita (su Tomcat) allora si ottiene il messaggio di errore:

INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 
Mar 02, 2017 2:19:32 PM org.apache.catalina.startup.TaglibUriRule body 

La soluzione è quella di utilizzare il tag 'scope' e un valore di 'condizione' perché JSTL è già fornito con Tomcat (solo per IDE):

<dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>jstl</artifactId> 
     <version>1.2</version> 
     <scope>provided</scope> 
    </dependency> 

Quindi l'errore scompare.