I am using intellij, spring mvc and tiles. At least I am trying ๐
I get this error when executing on tomcat:
HTTP Status 503 - Servlet spring is currently unavailable
The requested service (Servlet spring is currently unavailable) is not currently available.
I really don’t know what is wrong.
Here is the tomcat output:
cmd /c "C:\Program Files\apache-tomcat-6.0.35\bin\catalina.bat" run
Using CATALINA_BASE: "C:\Documents and Settings\๏ฟฝโฌโฆห\.IntelliJIdea10\system\tomcat\Unnamed_project"
Using CATALINA_HOME: "C:\Program Files\apache-tomcat-6.0.35"
Using CATALINA_TMPDIR: "C:\Program Files\apache-tomcat-6.0.35\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.7.0_01"
Using CLASSPATH: "C:\Program Files\apache-tomcat-6.0.35\bin\bootstrap.jar"
ืื ื 21, 2012 2:51:16 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.22.
ืื ื 21, 2012 2:51:16 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [false], sendfile [true], accept filters [false], random [true].
ืื ื 21, 2012 2:51:17 AM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
ืื ื 21, 2012 2:51:17 AM org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
ืื ื 21, 2012 2:51:17 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2135 ms
ืื ื 21, 2012 2:51:17 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
ืื ื 21, 2012 2:51:17 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
ืื ื 21, 2012 2:51:17 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/WorkingDirectory/Projects/GreenWheels/green-wheels-project/web-app-module/target/web-app-module/WEB-INF/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/WorkingDirectory/Projects/GreenWheels/green-wheels-project/web-app-module/target/web-app-module/WEB-INF/lib/slf4j-nop-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
ืื ื 21, 2012 2:51:19 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
ืื ื 21, 2012 2:51:19 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
ืื ื 21, 2012 2:51:19 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
ืื ื 21, 2012 2:51:19 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
ืื ื 21, 2012 2:51:19 AM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
ืื ื 21, 2012 2:51:19 AM org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
ืื ื 21, 2012 2:51:19 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1967 ms
Connected to server
My web.xml is:
<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Archetype Created Web Application</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
</web-app>
My spring-servlet.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan
base-package="Success.GreenWheels.Controller" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.tiles2.TilesView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles.xml</value>
</list>
</property>
</bean>
</beans>
I am using maven in order to load dependencies. Here are my dependencies:
<dependencies>
<dependency>
<groupId>success.green-wheels</groupId>
<artifactId>domain-library-module</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>${org.apache.tiles}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${org.apache.tiles}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>${org.apache.tiles}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>${org.apache.tiles}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-template</artifactId>
<version>${org.apache.tiles}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</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-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</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-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
</dependencies>
I am using org.springframework.version = 3.1.0.RELEASE and org.apache.tiles = 2.2.2
What can be wrong?
My guess is that Spring initialization failed.
However, there is no evidence for this in the
catalina.outfile you provided. OTOH, there is nothing whatsoever from Spring in the logfile. So I’m betting that your webapp’s logging configuration have been set up to ignore all of Springs log events … or to log them somewhere else.Anyway, you need that evidence to find out what the real problem is. So my advice is to change the logging configs so that the effective logging level for Spring classes is
DEBUG, and see what the logs say. Note, there will be a lot ofDEBUGlog messages: if you don’t see any then you’ve still got the logging configs wrong.Actually, there’s a couple of other fishy things:
The
catalina.outfile doesn’t say anything about deploying or starting your webapp.The
catalina.outfile seems to be saying that there’s a problem with the logging:It looks like your WAR file contains two SLF4J binding JARs, and that one of them is for the “nop” binding. I imagine that the effect of the “nop” binding is to disable all logging via the the SFL4J facade … and that’s how Spring does its logging IIRC.