I'm trying to start a new application from scratch with Spring 3.2, and I got the 404 error when I try to get access to my Controller. Here is my configuration:
WEB-INF
web.xml
web-context.xml
web.xml:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/application-context.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/web-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/deblan/*</url-pattern>
</servlet-mapping>
</web-app>
web-context.xml:
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.deboralandini.web.controllers"/>
<mvc:annotation-driven/>
<beans>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>
</beans>
My controller:
package com.deboralandini.web.controllers;
import ...;
#Controller
#RequestMapping("cuenta")
public class CuentaController {
#Autowired
private CuentaService cuentaService;
...
#RequestMapping(value = "/cCuenta")
public String cCuenta(Model model){
return "crearCuenta";
}
...
}
My index.jsp:
<%# taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<html>
<body>
<h2>BlaBla</h2>
<br/>
Crear Cuenta
</body>
</html>
Unfortunately, when I click the link, I get:
Status HTTP 404 - /deblan/cuenta/cCuenta
The browser tries to make a GET to http://localhost:8080/deblan/cuenta/cCuenta, but I cannot get in my controller. I debugged the controller and in fact is not entering there, so: Whats my newbie error?
Thanks in advance
Marcos
Edit: this is my output:
"C:\...\App\tomcat8\bin\catalina.bat" run
[2014-10-21 08:57:21,069] Artifact DebLan:war: Server is not connected. Deploy is not available.
Using CATALINA_BASE: ...
Connected to the target VM, address: '127.0.0.1:64352', transport: 'socket'
21-Oct-2014 20:57:21.743 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.14
21-Oct-2014 20:57:21.745 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 24 2014 09:01:51
21-Oct-2014 20:57:21.745 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.14.0
21-Oct-2014 20:57:21.745 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 8.1
21-Oct-2014 20:57:21.745 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.3
21-Oct-2014 20:57:21.745 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
21-Oct-2014 20:57:21.745 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.7.0_55-b13
21-Oct-2014 20:57:21.745 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
21-Oct-2014 20:57:21.924 INFO [main] org.apache.catalina.core.AprLifecycleListener.init Cargada la biblioteca nativa APR de Apache Tomcat 1.1.31 con la versión APR 1.4.8.
21-Oct-2014 20:57:21.924 INFO [main] org.apache.catalina.core.AprLifecycleListener.init Capacidades APR: IPv6 [true], enviar fichero [true], aceptar filtros [false], aleatorio [true].
21-Oct-2014 20:57:22.551 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL inicializado correctamente (OpenSSL 1.0.1h 5 Jun 2014)
21-Oct-2014 20:57:22.649 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8080"]
21-Oct-2014 20:57:22.662 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"]
21-Oct-2014 20:57:22.664 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 992 ms
21-Oct-2014 20:57:22.695 INFO [main] org.apache.catalina.core.StandardService.startInternal Arrancando servicio Catalina
21-Oct-2014 20:57:22.695 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.14
21-Oct-2014 20:57:22.708 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"]
21-Oct-2014 20:57:22.719 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"]
21-Oct-2014 20:57:22.722 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 57 ms
Connected to server
[2014-10-21 08:57:23,165] Artifact DebLan:war: Artifact is being deployed, please wait...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[2014-10-21 08:57:32,003] Artifact DebLan:war: Artifact is deployed successfully
[2014-10-21 08:57:32,003] Artifact DebLan:war: Deploy took 8,838 milliseconds
21-Oct-2014 20:57:32.712 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Despliegue del directorio C:...\App\tomcat8\webapps\manager de la aplicación web
21-Oct-2014 20:57:32.762 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:...\App\tomcat8\webapps\manager has finished in 50 ms
If deblan is the context root then don't put it in the servlet mapping. You've got this url:
http://localhost:8080/deblan/cuenta/cCuenta
if you've deployed this app with deblan as the context root then:
http://localhost:8080/deblan
takes you to your app
/cuenta/cCuenta
now maps to your controller, so try:
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Which means http://localhost:8080/deblan + whatever comes after.
Related
I'm new to Spring and trying MVC. I built simple demo app and run it on tomcat 9.0.41
It seems artifact is deploied correctly and problem seems to be in Controller mapping ... it simply can not find my jsp.
here is my project structure
here is web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>spring-mvc-demo</display-name>
<!-- <context-param>-->
<!-- <param-name>contextConfigLocation</param-name>-->
<!-- <param-value>/WEB-INF/applicationContext.xml</param-value>-->
<!-- </context-param>-->
<!-- <listener>-->
<!-- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>-->
<!-- </listener>-->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-mvc-demo-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
spring-mvc-demo-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name>spring-mvc-demo</display-name>
<!-- <context-param>-->
<!-- <param-name>contextConfigLocation</param-name>-->
<!-- <param-value>/WEB-INF/applicationContext.xml</param-value>-->
<!-- </context-param>-->
<!-- <listener>-->
<!-- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>-->
<!-- </listener>-->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-mvc-demo-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
HomeController
package com.springmvcdemo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
public class HomeController {
#RequestMapping("/")
public String showPage(){
return "main-menu";
}
}
and simple main-menu.jsp
<html>
<body>
<h2>
Spring Demo MVC - Home page
</h2>
</body>
</html>
here is server log
"C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\catalina.bat" run
[2021-02-03 07:52:45,945] Artifact SpringMVCdemo:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.1\tomcat\Tomcat_9_0_41_SpringMVCdemo"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Tomcat 9.0"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk-15.0.1"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin\tomcat-juli.jar"
Using CATALINA_OPTS: ""
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
03-Feb-2021 19:52:46.548 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.41
03-Feb-2021 19:52:46.549 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Dec 3 2020 11:43:00 UTC
03-Feb-2021 19:52:46.549 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.41.0
03-Feb-2021 19:52:46.549 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
03-Feb-2021 19:52:46.549 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Версия ОС: 10.0
03-Feb-2021 19:52:46.549 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Архитектура: amd64
03-Feb-2021 19:52:46.550 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk-15.0.1
03-Feb-2021 19:52:46.550 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Версия JVM: 15.0.1+9-18
03-Feb-2021 19:52:46.550 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
03-Feb-2021 19:52:46.550 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.1\tomcat\Tomcat_9_0_41_SpringMVCdemo
03-Feb-2021 19:52:46.550 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 9.0
03-Feb-2021 19:52:46.551 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
03-Feb-2021 19:52:46.551 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
03-Feb-2021 19:52:46.551 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.1\tomcat\Tomcat_9_0_41_SpringMVCdemo\conf\logging.properties
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.1\tomcat\Tomcat_9_0_41_SpringMVCdemo\jmxremote.password
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.1\tomcat\Tomcat_9_0_41_SpringMVCdemo\jmxremote.access
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
03-Feb-2021 19:52:46.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
03-Feb-2021 19:52:46.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
03-Feb-2021 19:52:46.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2020.1\tomcat\Tomcat_9_0_41_SpringMVCdemo
03-Feb-2021 19:52:46.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
03-Feb-2021 19:52:46.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp
03-Feb-2021 19:52:46.563 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.25] using APR version [1.7.0].
03-Feb-2021 19:52:46.563 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
03-Feb-2021 19:52:46.563 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
03-Feb-2021 19:52:46.566 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1g 21 Apr 2020]
03-Feb-2021 19:52:46.723 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
03-Feb-2021 19:52:46.748 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [347] milliseconds
03-Feb-2021 19:52:46.785 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
03-Feb-2021 19:52:46.785 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.41]
03-Feb-2021 19:52:46.791 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
03-Feb-2021 19:52:46.797 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [49] milliseconds
Connected to server
[2021-02-03 07:52:47,043] Artifact SpringMVCdemo:war exploded: Artifact is being deployed, please wait...
[2021-02-03 07:52:47,364] Artifact SpringMVCdemo:war exploded: Artifact is deployed successfully
[2021-02-03 07:52:47,364] Artifact SpringMVCdemo:war exploded: Deploy took 321 milliseconds
03-Feb-2021 19:52:56.801 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory Установка веб приложения в папку [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager]
03-Feb-2021 19:52:56.879 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager] has finished in [78] ms
i have tried #RequestMapping(value="/", method = RequestMethod.GET) and ("/main-menu"). Serched stack for similar errors and used sugestions but nothing works. Tried creatign different project from scratch... It's driving me nuts, seems everything is done by the book but still errors
Why is your spring-mvc-demo-servlet.xml file the exact copy of web.xml? Try changing spring-mvc-demo-servlet.xml to:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<mvc:annotation-driven />
<context:component-scan base-package="com.springmvcdemo" />
<mvc:default-servlet-handler />
<mvc:view-controller path="/" view-name="main-menu"/>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
OR...
In web.xml change the mapping as something similar as follows:
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/demo/*</url-pattern>
</servlet-mapping>
You will append demo in your url as http://localhost:8080/demo/
This is the complete documentation in case you haven't seen it yet:
Configuring View Controllers
i posted wrong code for spring-mvc-demo-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Step 3: Add support for component scanning -->
<context:component-scan base-package="com.springmvcdemo" />
<!-- Step 4: Add support for conversion, formatting and validation support -->
<mvc:annotation-driven/>
<!-- Step 5: Define Spring MVC view resolver -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/view/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>```
SOLVED
added extra mapping for method
#Controller
#RequestMapping
public class HomeController {
#RequestMapping("/home")
public String showPage(){
return "home-page";
}
}
added to web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
then lowered my language level to 13 since artifact could not deploy because of level 15 was unsupported by Spring (java.lang.IllegalArgumentException: Unsupported class file major version 59)
then i just call home page from browser
http://localhost:8080/SpringMVCdemo_war_exploded/home
Maybe this will help someone )
I have a problem with my spring app. While I run it, I am getting below exception:
It had worked correctly, but app didn't see changes in .jsp files and loaded the same page every time.
I faced with this problem in the past? but unfortunately I couldn't resolve this, and recreated project.
My project struct:
My spring-mvc-demo-servlet.xml file:
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Step 3: Add support for component scanning -->
<context:component-scan base-package="com.spring" />
<!-- Step 4: Add support for conversion, formatting and validation support -->
<mvc:annotation-driven/>
<!-- Step 5: Define Spring MVC view resolver -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/view/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
My web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name>spring-mvc-demo</display-name>
<!-- Spring MVC Configs -->
<!-- Step 1: Configure Spring MVC Dispatcher Servlet -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/spring-mvc-demo-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Step 2: Set up URL mapping for Spring MVC Dispatcher Servlet -->
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
Maybe there is a problem with artifacts or tomcat configuration, because I changed it while tried resolve this error.
My pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.spring</groupId>
<artifactId>SpringgMVC</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.1.4.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.1.4.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.1.4.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>LATEST</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.4.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/jsp-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>8.5.39</version>
<type>pom</type>
</dependency>
</dependencies>
Update:::
I created a new artfacts, and received a new error:
my artifacts:
Although there are problem in web.xml.
Tomcat Log
"C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\catalina.bat" run
[2019-05-16 03:36:54,591] Artifact SpringgMVC:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\Users\__it\.IntelliJIdea2018.3\system\tomcat\Unnamed_SpringgMVC"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Tomcat 8.5"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_151"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin\tomcat-juli.jar"
16-May-2019 15:36:55.256 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.39
16-May-2019 15:36:55.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 14 2019 11:24:26 UTC
16-May-2019 15:36:55.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.39.0
16-May-2019 15:36:55.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
16-May-2019 15:36:55.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
16-May-2019 15:36:55.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
16-May-2019 15:36:55.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_151\jre
16-May-2019 15:36:55.257 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_151-b12
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\__it\.IntelliJIdea2018.3\system\tomcat\Unnamed_SpringgMVC
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 8.5
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\__it\.IntelliJIdea2018.3\system\tomcat\Unnamed_SpringgMVC\conf\logging.properties
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\__it\.IntelliJIdea2018.3\system\tomcat\Unnamed_SpringgMVC
16-May-2019 15:36:55.258 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.5
16-May-2019 15:36:55.259 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp
16-May-2019 15:36:55.259 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_151\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\ProgramData\Boxstarter;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Yarn\bin;C:\Program Files\dotnet\;C:\Program Files\Calibre2\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files\TortoiseGit\bin;C:\Python27\gnuplot\binary;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\__it\AppData\Local\Microsoft\WindowsApps;C:\Users\__it\AppData\Local\Yarn\.bin;C:\Program Files\MongoDB\Server\3.4\bin;c:\Program Files\PhantomJS 2.1.1\bin;C:\ProgramData\Oracle\Java\javapath;;D:\PyCharm Community Edition 2018.3.5\bin;;.]
16-May-2019 15:36:55.334 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
16-May-2019 15:36:55.343 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
16-May-2019 15:36:55.355 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
16-May-2019 15:36:55.357 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
16-May-2019 15:36:55.357 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 381 ms
16-May-2019 15:36:55.372 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
16-May-2019 15:36:55.372 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.39
16-May-2019 15:36:55.378 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
16-May-2019 15:36:55.384 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
16-May-2019 15:36:55.384 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 27 ms
Connected to server
[2019-05-16 03:36:55,667] Artifact SpringgMVC:war exploded: Artifact is being deployed, please wait...
16-May-2019 15:36:57.032 INFO [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
[2019-05-16 03:36:57,076] Artifact SpringgMVC:war exploded: Artifact is deployed successfully
[2019-05-16 03:36:57,077] Artifact SpringgMVC:war exploded: Deploy took 1 410 milliseconds
16-May-2019 15:37:05.382 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager]
16-May-2019 15:37:05.442 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager] has finished in [60] ms
Error is: Can not resolve servlet 'dispatcher'.
Pom.xml updated too above.
You can try maven tomcat plugin
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>9000</port> //Configure port number
<path>/spring5-webmvc-demo</path> //Configure application root URL
</configuration>
</plugin>
Then you can do a build mvn clean install and then mvn tomcat7:run
At least I resolved my problem. As told M. Deinum I have moved an web.xml, view, and spring-mvc-demo-servlet.xml to WEB-INF, because I have:
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/view/" />
<property name="suffix" value=".jsp" />
</bean>
Then I regenerated an Artifacts.
After upgrading my environment from Apache Tomcat 6.0.37 to 8.0.44 and Java from 1.7.0_45 to 1.8.0_131, one of my webapps will not deploy while the others run without issue.
My development environment is as follows.
Product Version: NetBeans IDE 8.2 (Build 201609300101)
Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 2
Java: 1.8.0_131; Java HotSpot(TM) 64-Bit Server VM 25.131-b11
Runtime: Java(TM) SE Runtime Environment 1.8.0_131-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\heinzk\AppData\Roaming\NetBeans\8.2
Cache directory: C:\Users\heinzk\AppData\Local\NetBeans\Cache\8.2
When I attempt to run or debug my problematic webapp (which worked fine before these upgrades), I get the following server output.
Using CATALINA_BASE: "C:\Program Files\Apache Software Foundation\Tomcat 8.0"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Tomcat 8.0"
Using CATALINA_TMPDIR: "C:\Program Files\Apache Software Foundation\Tomcat 8.0\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_131"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Tomcat 8.0\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Tomcat 8.0\bin\tomcat-juli.jar"
Listening for transport dt_shmem at address: tomcat_shared_memory_id
20-Jun-2017 12:52:55.059 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.44
20-Jun-2017 12:52:55.064 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: May 10 2017 17:21:09 UTC
20-Jun-2017 12:52:55.064 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.44.0
20-Jun-2017 12:52:55.064 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 7
20-Jun-2017 12:52:55.064 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.1
20-Jun-2017 12:52:55.065 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
20-Jun-2017 12:52:55.065 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_131\jre
20-Jun-2017 12:52:55.065 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_131-b11
20-Jun-2017 12:52:55.065 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
20-Jun-2017 12:52:55.065 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Program Files\Apache Software Foundation\Tomcat 8.0
20-Jun-2017 12:52:55.065 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 8.0
20-Jun-2017 12:52:55.066 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\logging.properties
20-Jun-2017 12:52:55.066 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
20-Jun-2017 12:52:55.066 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.jmxremote.port=9876
20-Jun-2017 12:52:55.066 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.jmxremote.ssl=false
20-Jun-2017 12:52:55.066 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.jmxremote.authenticate=false
20-Jun-2017 12:52:55.066 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dhttp.nonProxyHosts=localhost|127.0.0.1|US3C0771A3E9F2
20-Jun-2017 12:52:55.066 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
20-Jun-2017 12:52:55.067 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
20-Jun-2017 12:52:55.067 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_shmem,address=tomcat_shared_memory_id,server=y,suspend=n
20-Jun-2017 12:52:55.067 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 8.0\endorsed
20-Jun-2017 12:52:55.067 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 8.0
20-Jun-2017 12:52:55.067 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.0
20-Jun-2017 12:52:55.067 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 8.0\temp
20-Jun-2017 12:52:55.067 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_131\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\RSA SecurID Token Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Perforce;C:\Program Files (x86)\Tools;C:\Program Files\adt-bundle-windows-x86_64-20140321\sdk\tools;C:\Program Files\Git\cmd;C:\cygwin64\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Users\heinzk\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\WebEx\Productivity Tools;C:\Program Files (x86)\WebEx\PTools020000000;C:\Program Files (x86)\Scrivener;C:\Program Files (x86)\Scrivener\Aspell;C:\Program Files (x86)\Scrivener\Aspell\bin;.
20-Jun-2017 12:52:55.499 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
20-Jun-2017 12:52:59.671 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
20-Jun-2017 12:52:59.676 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
20-Jun-2017 12:52:59.685 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
20-Jun-2017 12:52:59.686 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 5325 ms
20-Jun-2017 12:52:59.751 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
20-Jun-2017 12:52:59.752 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.44
20-Jun-2017 12:52:59.765 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\Catalina\localhost\Device_Monitor.xml
20-Jun-2017 12:53:05.430 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Device_Monitor]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:587)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1798)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:363)
at java.util.Properties.getProperty(Properties.java:969)
at org.apache.catalina.startup.ContextConfig.authenticatorConfig(ContextConfig.java:400)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:794)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:307)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5213)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 10 more
Unfortunately the NullPointerException on the HashTable is not of much help.
The context.xml file is and always has been as follows.
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/Device_Monitor"/>
Obviously there's a property being retrieved for which the property name is null. However, I have no idea which it might be as the stack trace is truncated.
Is there a way to get the balance of the "cause's" stack trace?
Is it possible that the context.xml file is incomplete for this new environment?
A sampling of the web.xml is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Device Monitor</display-name>
<description>Device Monitor application to monitor devices</description>
<context-param>
<param-name>db_hostname</param-name>
<param-value>device-monitor-database</param-value>
<description>Database server hostname/IP address</description>
</context-param>
<context-param>
<param-name>db_name</param-name>
<param-value>device_monitor</param-value>
<description>Database schema name</description>
</context-param>
<context-param>
<param-name>db_password</param-name>
<param-value>device_monitor</param-value>
<description>Database account password</description>
</context-param>
<context-param>
<param-name>db_username</param-name>
<param-value>device_monitor</param-value>
<description>Database account username</description>
</context-param>
<context-param>
<param-name>db_trim_connections</param-name>
<param-value>True</param-value>
<description>Set true to dynamically trim database conections</description>
</context-param>
<context-param>
<param-name>max_HTTP_requests</param-name>
<param-value>25</param-value>
<description>Maximum number of HTTP requests that
may be processed at a time.
Set to "0" (zero) for no limit</description>
</context-param>
<servlet>
<servlet-name>DM Database</servlet-name>
<description>Start first to ensure table definitions are loaded
so any needed repairs can be initiated</description>
<servlet-class>database.Main</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>DM Message</servlet-name>
<description>Start next to ensure only old messages are cleared and
caches are preloaded</description>
<servlet-class>message.Main</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>DM GlobalSetting</servlet-name>
<description>This servlet is loaded next to read the global settings
stored in the database before anything other than messages starts</description>
<servlet-class>globalSetting.Main</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet>
<servlet-name>DM Device</servlet-name>
<description>Load after messages to update the health status of each
device per any uncleared messages</description>
<servlet-class>device.Main</servlet-class>
<init-param>
<param-name>removeDeletionsAfterMonths</param-name>
<param-value>6</param-value>
</init-param>
<init-param>
<param-name>deleteChangesAfterMonths</param-name>
<param-value>6</param-value>
</init-param>
<load-on-startup>4</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DM Database</servlet-name>
<url-pattern>/Database</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DM Device</servlet-name>
<url-pattern>/Device</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DM Message</servlet-name>
<url-pattern>/Message</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>DM GlobalSetting</servlet-name>
<url-pattern>/GlobalSetting</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>600</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<login-config>
<realm-name>Device-Monitor</realm-name>
</login-config>
</web-app>
After downloading and reviewing the pertinent the Tomcat source files as well as reading the javadocs and examining/comparing the context.xml and web.xml files between this projector and those that worked, I found that the following in my web.xml file was causing the issue.
<login-config>
<realm-name>Device-Monitor</realm-name>
</login-config>
After removing this login-config element my application started without issue.
It is odd to note that this did not cause an issue in my development environment under Tomcat 6.0 and Java 1.7.
I get 404 error in my browser, after I start my tomcat :
I type in localhost:8080/mvc/hello or localhost:8080/mvc/hello.jsp
But if I type in localhost:8080, it is normal, can access:
In my springmvc-servlet.xml:
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd">
<!-- scan the package and the sub package -->
<context:component-scan base-package="com.ypd.springmvcdemo"/>
<!-- don't handle the static resource -->
<mvc:default-servlet-handler />
<!-- if you use annotation you must configure following setting -->
<mvc:annotation-driven />
<!-- configure the InternalResourceViewResolver -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="internalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
And in my MVCController.java:
#Controller
#RequestMapping("/mvc")
public class MVCController {
#RequestMapping("/hello")
public String hello() {
return "hello";
}
}
In my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<!--configure the setting of springmvcDispatcherServlet and configure the mapping-->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc-servlet.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
This is my page of hello.jsp:
(I am sorry about the springmvc-servlet.xml's position, I have locate it to under the resource library)
UPDATE - 1:
I am so sorry about it, there is a mistake when I post this snapshot, in my issue project, the web folder has no blue dot on it.See my answer I find the issue with it.
Update image:
So, where is the mistake?
EDIT
My hello.jsp:
<%# page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
Hello, world, jack loly!
</body>
</html>
EDIT
Logs looks like correct:
[2017-03-20 03:06:48,255] Artifact SpringMVCDemo:war exploded: Server is not connected. Deploy is not available.
Connected to the target VM, address: '127.0.0.1:51764', transport: 'socket'
20-Mar-2017 15:06:50.080 info [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.0.M17
20-Mar-2017 15:06:50.085 info [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 10 2017 20:59:20 UTC
20-Mar-2017 15:06:50.085 info [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.0.0
20-Mar-2017 15:06:50.085 info [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Mac OS X
20-Mar-2017 15:06:50.088 info [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.12.2
20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86_64
20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_121-b13
20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /Users/jack/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat_9_0_0_M17_SpringMVCDemo
20-Mar-2017 15:06:50.090 info [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /Users/jack/Library/Tomcat9
20-Mar-2017 15:06:50.091 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/Users/jack/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat_9_0_0_M17_SpringMVCDemo/conf/logging.properties
20-Mar-2017 15:06:50.091 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
20-Mar-2017 15:06:50.091 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:51764,suspend=y,server=n
20-Mar-2017 15:06:50.091 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
20-Mar-2017 15:06:50.092 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/Users/jack/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat_9_0_0_M17_SpringMVCDemo
20-Mar-2017 15:06:50.094 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/Users/jack/Library/Tomcat9
20-Mar-2017 15:06:50.094 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/Users/jack/Library/Tomcat9/temp
20-Mar-2017 15:06:50.094 info [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/jack/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
20-Mar-2017 15:06:50.527 info [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
20-Mar-2017 15:06:50.560 info [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
20-Mar-2017 15:06:50.563 info [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
20-Mar-2017 15:06:50.565 info [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
20-Mar-2017 15:06:50.581 info [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1455 ms
20-Mar-2017 15:06:50.709 info [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
20-Mar-2017 15:06:50.709 info [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.0.M17
20-Mar-2017 15:06:50.745 info [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080]
20-Mar-2017 15:06:50.766 info [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009]
20-Mar-2017 15:06:50.769 info [main] org.apache.catalina.startup.Catalina.start Server startup in 187 ms
Connected to server
[2017-03-20 03:06:51,046] Artifact SpringMVCDemo:war exploded: Artifact is being deployed, please wait...
[2017-03-20 03:06:51,751] Artifact SpringMVCDemo:war exploded: Artifact is deployed successfully
[2017-03-20 03:06:51,751] Artifact SpringMVCDemo:war exploded: Deploy took 705 milliseconds
20-Mar-2017 15:07:00.750 info [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /Users/jack/Library/Tomcat9/webapps/manager
20-Mar-2017 15:07:00.802 info [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /Users/jack/Library/Tomcat9/webapps/manager has finished in 52 ms
EDIT
My tomcat deployment config:
EDIT -2
I think your tomcat deployment configuration is not all okay. your application context should be the context from where you are going to load your application and tell tomcat to dispatch all request within that context.
e.g. your Application Context: could be /helloApp. Now when you will start tomcat, your application would be loaded at localhost:8080/helloApp/. And this is your application root context. Now if you hit at localhost:8080/helloApp/mvc/hello, you are expected to see your content.
Put your springmvc-servlet.xml file in the WEB-INF and change lines of web.xml
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc-servlet.xml</param-value>
</init-param>
To
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springmvc-servlet.xml</param-value>
</init-param>
There are couple of things to notice.
No project name specified in url
URL should be : http://localhost:8080/SpringMVCDemo/mvc/hello
Why are you mentioning two RequestMapping(mvc,hello) for only one page.You can remove #RequestMapping(value="/mvc") and keep #RequestMapping("/hello") on hello() method.
Update:
add load-on-startup in web.xml
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
At last, I find the issue I was lost. See my question -> UPDATE -1
No blue dot on it means Web Source Dictory is incorrect. See below image I find the issue.
So I delete the red directory, and then re-choose the web directory:
Then in my project, I can see the blue dot on web directory now:
And then I restart tomcat, I success:
I am making a simple program of spring actually I am getting fine result when I run the program on eclipse (eclipse default browser).But when I run the same url on my browser it say resource not available .
Here is my images .
Here is my code
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<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" id="WebApp_ID" version="2.5">
<display-name>FirstWebProject</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>crunchify</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>crunchify</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
![crunchify-servlet.xml][2]
<?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="com.crunchify.controller" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
package com.crunchify.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
#Controller
public class CrunchifyHelloWorld {
#RequestMapping("/welcome")
public ModelAndView helloWorld() {
String message = "<br><div align='center'>" + "<h1>Hello World, Spring 3.2.1 Example by Crunchify.com<h1> <br>";
message += "<a href='http://crunchify.com/category/java-web-development-tutorial/'>More Examples</a>";
return new ModelAndView("welcome", "message", message);
}
}
![enter code here][4]
![<html>
<head>
<title>Spring 3.2.1 MVC Series: Index - Crunchify.com</title>
</head>
<body>
<br>
<div align='center'>
<h2>
Your 1st Spring MCV Example <br> <br>
Click here to See Welcome Message...
</h2>
<br> by Crunchify.com
</div>
</body>
</html>][5]
13:25:00,259 INFO [AbstractJBossASServerBase] Server Configuration:
JBOSS_HOME URL: file:/F:/naveendata/setupfile/jboss-6.0.0.M1/
Bootstrap: $JBOSS_HOME\server/default/conf/bootstrap.xml
Common Base: $JBOSS_HOME\common/
Common Library: $JBOSS_HOME\common/lib/
Server Name: default
Server Base: $JBOSS_HOME\server/
Server Library: $JBOSS_HOME\server/default/lib/
Server Config: $JBOSS_HOME\server/default/conf/
Server Home: $JBOSS_HOME\server/default/
Server Data: $JBOSS_HOME\server/default/data/
Server Log: $JBOSS_HOME\server/default/log/
Server Temp: $JBOSS_HOME\server/default/tmp/
13:25:00,266 INFO [AbstractServer] Starting: JBossAS [6.0.0.M1 (build: SVNTag=JBoss_6_0_0_M1 date=200912040958)]
13:25:00,507 INFO [AbstractMCServerBase] Starting Microcontainer, Main bootstrapURL=file:/F:/naveendata/setupfile/jboss-6.0.0.M1/server/default/conf/bootstrap.xml
13:25:00,771 INFO [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]
13:25:00,773 INFO [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]
13:25:00,897 INFO [CopyMechanism] VFS temp dir: F:\naveendata\setupfile\jboss-6.0.0.M1\server\default\tmp
13:25:00,898 INFO [ZipEntryContext] VFS force nested jars copy-mode is enabled.
13:25:01,329 INFO [ServerInfo] Java version: 1.7.0_25,Oracle Corporation
13:25:01,329 INFO [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
13:25:01,329 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 23.25-b01,Oracle Corporation
13:25:01,329 INFO [ServerInfo] OS-System: Windows 7 6.1,x86
13:25:01,329 INFO [ServerInfo] VM arguments: -Dprogram.name=run.bat -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dfile.encoding=Cp1252
13:25:01,346 INFO [JMXKernel] Legacy JMX core initialized
13:25:02,690 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
13:25:02,729 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
13:25:04,779 INFO [AbstractServerConfig] JBoss Web Services - Native Server
13:25:04,779 INFO [AbstractServerConfig] 3.2.1.GA
13:25:08,154 INFO [LogNotificationListener] Adding notification listener for logging mbean "jboss.system:service=Logging,type=Log4jService" to server org.jboss.mx.server.MBeanServerImpl#430f4[ defaultDomain='null' ]
13:25:13,978 INFO [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1090/jmxconnector
13:25:14,038 INFO [MailService] Mail Service bound to java:/Mail
13:25:14,996 WARN [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
13:25:15,083 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version - tag:JBOSSTS_4_6_1_GA) - JBoss Inc.
13:25:15,083 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
13:25:15,245 INFO [TransactionManagerService] Initializing recovery manager
13:25:15,310 INFO [TransactionManagerService] Recovery manager configured
13:25:15,310 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
13:25:15,324 INFO [TransactionManagerService] Starting transaction recovery manager
13:25:15,880 INFO [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Program Files\Java\jre6\bin;;H:\setupfile\eclipse;;.
13:25:15,911 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
13:25:15,914 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:25:15,924 INFO [StandardService] Starting service jboss.web
13:25:15,925 INFO [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.6.GA
13:25:15,951 INFO [Catalina] Server startup in 36 ms
13:25:15,962 INFO [TomcatDeployment] deploy, ctxPath=/invoker
13:25:16,233 INFO [TomcatDeployment] deploy, ctxPath=/jbossws
13:25:16,249 INFO [TomcatDeployment] deploy, ctxPath=/web-console
13:25:16,411 INFO [RARDeployment] Required license terms exist, view vfszip:/F:/naveendata/setupfile/jboss-6.0.0.M1/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
13:25:16,417 INFO [RARDeployment] Required license terms exist, view vfszip:/F:/naveendata/setupfile/jboss-6.0.0.M1/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
13:25:16,422 INFO [RARDeployment] Required license terms exist, view vfszip:/F:/naveendata/setupfile/jboss-6.0.0.M1/server/default/deploy/jms-ra.rar/META-INF/ra.xml
13:25:16,428 INFO [RARDeployment] Required license terms exist, view vfszip:/F:/naveendata/setupfile/jboss-6.0.0.M1/server/default/deploy/mail-ra.rar/META-INF/ra.xml
13:25:16,439 INFO [RARDeployment] Required license terms exist, view vfszip:/F:/naveendata/setupfile/jboss-6.0.0.M1/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
13:25:16,478 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: Thread-2
13:25:16,493 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
13:25:16,495 INFO [RAMJobStore] RAMJobStore initialized.
13:25:16,495 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
13:25:16,495 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
13:25:16,495 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
13:25:16,574 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=firstGroupAdminConsoleDS' to JNDI name 'java:firstGroupAdminConsoleDS'
13:25:16,593 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=firstGroupRailAppDS' to JNDI name 'java:firstGroupRailAppDS'
13:25:17,177 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
13:25:17,369 INFO [ServerPeer] JBoss Messaging 1.4.3.GA server [0] started
13:25:17,434 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:25:17,434 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory#498624 started
13:25:17,434 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:25:17,434 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory#134d4c started
13:25:17,435 INFO [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
13:25:17,435 INFO [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
13:25:17,435 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:25:17,435 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory#1025dc5 started
13:25:17,443 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:25:17,444 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:25:17,488 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
13:25:17,559 INFO [TomcatDeployment] deploy, ctxPath=/admin-console
13:25:17,616 ERROR [MyfacesConfig] Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.
13:25:17,777 WARN [LocaleUtils] Locale name in faces-config.xml null or empty, setting locale to default locale : en_US
13:25:19,218 INFO [TomcatDeployment] deploy, ctxPath=/FirstWebProject
13:25:19,294 INFO [[/FirstWebProject]] Initializing Spring FrameworkServlet 'crunchify'
13:25:19,650 INFO [TomcatDeployment] deploy, ctxPath=/
13:25:19,675 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console
13:25:19,704 INFO [TomcatDeployment] deploy, ctxPath=/zmeu
13:25:19,738 INFO [ProfileServiceBootstrap] Loading profile: ProfileKey#b167ca[domain=default, server=default, name=default]
13:25:19,744 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
13:25:19,756 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:25:19,760 INFO [AbstractServer] JBossAS [6.0.0.M1 (build: SVNTag=JBoss_6_0_0_M1 date=200912040958)] Started in 19s:493ms
13:25:35,794 WARN [PageNotFound] No mapping found for HTTP request with URI [/FirstWebProject/] in DispatcherServlet with name 'crunchify'
13:25:46,241 WARN [PageNotFound] No mapping found for HTTP request with URI [/FirstWebProject/index] in DispatcherServlet with name 'crunchify'
13:26:50,674 WARN [PageNotFound] No mapping found for HTTP request with URI [/FirstWebProject/] in DispatcherServlet with name 'crunchify'