Witajcie,
Zaczynam przygodę z webową Javą (Spring MVC z Apache Tiles, z pomocą Mavena) i na samym początku mam pewien zgrzyt. Otóż przy odpaleniu aplikacji wyskakuje błąd ( http://www.bankfotek.pl/image/1512861.jpeg ). Co ciekawe, gdy zmodyfikuję jakikolwiek plik klasy Javy (choćby dodając spację w losowym miejscu i zapisując plik) aplikacja ponownie deployuje się na Tomcacie i po odświeżeniu wszystko działa jak należy do czasu kliknięcia na url do kolejnej podstrony projektu. Wówczas muszę powtórzyć wcześniejsze działanie i tak w kółko. Nadmieniam, że problem nie występował, gdy zamiast <tiles:insertAttribute name="content" />
miałem statyczny paragraf z Lorem ipsum.
Skoro po redeploy'u wszystko działa jak należy, to problem musi leżeć nie po stronie kodu aplikacji, ale po stronie konfiguracji projektu. I właśnie w tym miejscu chciałbym prosić o nakierowanie - gdzie szukać błędu? Czy to kwestia brakującej paczki lub wręcz przeciwnie - kolidujących bibliotek?
Oto mój tiles-config.xml:
<tiles-definitions>
<definition name="page" template="WEB-INF/jsp/template.jsp" />
<definition name="index" extends="page">
<put-attribute name="title" value="Strona główna" type="string" />
<put-attribute name="content" value="/WEB-INF/jsp/index.jsp" type="template"/>
</definition>
<definition name="quotes/list" extends="page">
<put-attribute name="title" value="Cytaty" type="string" />
<put-attribute name="content" value="/WEB-INF/jsp/quotes.jsp" type="template" />
</definition>
</tiles-definitions>
Tak wygląda log redeploy'u, po którym problem znika:
INFO: Reloading Context with name [/Notebook] has started
cze 16, 2013 12:40:51 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/Notebook] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
cze 16, 2013 12:40:51 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/Notebook] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
cze 16, 2013 12:40:52 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/home/mgd/NetBeansProjects/Notebook/target/Notebook-1.0-SNAPSHOT/WEB-INF/lib/el-api-6.0.36.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
cze 16, 2013 12:40:52 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/home/mgd/NetBeansProjects/Notebook/target/Notebook-1.0-SNAPSHOT/WEB-INF/lib/jsp-api-2.1-glassfish-9.1.02.B04.p0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
cze 16, 2013 12:40:52 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/home/mgd/NetBeansProjects/Notebook/target/Notebook-1.0-SNAPSHOT/WEB-INF/lib/servlet-api-3.0.pre1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
cze 16, 2013 12:40:52 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/home/mgd/NetBeansProjects/Notebook/target/Notebook-1.0-SNAPSHOT/WEB-INF/lib/servlet-api-6.0.36.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined
cze 16, 2013 12:40:53 AM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/mgd/NetBeansProjects/Notebook/target/Notebook-1.0-SNAPSHOT/WEB-INF/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/mgd/NetBeansProjects/Notebook/target/Notebook-1.0-SNAPSHOT/WEB-INF/lib/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
cze 16, 2013 12:40:56 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/Notebook] is completed
A oto dependencies z pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>20030825.184428</version>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>20030825.183949</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.25</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate-core-version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate-core-version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>${tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>${tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-template</artifactId>
<version>${tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>${tiles.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>displaytag</groupId>
<artifactId>displaytag</artifactId>
<version>${displaytag.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl104-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
Gdzie może tkwić problem?