Spring HelloWorld - The requested resource is not available.

0

Próbuję uruchomić przykład hello worlda z http://www.tutorialspoint.com[...]g_mvc_hello_world_example.htm. Dostaję błąd:The requested resource is not available. Gdzieś na stackoverflow znalazłem o tym problemie, tutaj link do filmiku na yt

6:52, zmieniłem ustawienia tomcata, ale dalej to nie pomogło. Jedynie co zmieniałem jeszcze to port z 8080 na 8008, bo 8080 miałem zajęty, ale to chyba nie w tym problem. Prosty hello world, a tu takie problemy, to dalej chyba może być tylko jeszcze trudniej.

<?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-4.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">

<context:component-scan base-package="com.tuturialspoint"></context:component-scan>

   <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name="prefix" value="/WEB-INF/jsp/" />
      <property name="suffix" value=".jsp" />
   </bean>
</beans> 
<?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" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>HelloWeb</display-name>
   <servlet>
      <servlet-name>HelloWeb</servlet-name>
      <servlet-class>
         org.springframework.web.servlet.DispatcherServlet
      </servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
      <servlet-name>HelloWeb</servlet-name>
      <url-pattern>/</url-pattern>
   </servlet-mapping>
</web-app>

<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>HelloWeb</groupId>
  <artifactId>HelloWeb</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>4.0.6.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>4.0.6.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>4.0.6.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>4.0.6.RELEASE</version>
    </dependency>
  </dependencies>
</project>
package com.tuturialspoint;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/hello")
public class HelloController {

    @RequestMapping(method = RequestMethod.GET)
    public String printHello(ModelMap model){
        model.addAttribute("message", "Hello Spring MVC Framework!");
        return "hello";
    }

} 

Projekt:springmvc.PNG

1

daj to co Ci wywala aplikacja w logach.

0

sie 21, 2014 2:44:04 PM org.apache.catalina.core.AprLifecycleListener init
INFO: 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\jre8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;E:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;E:\adt-bundle-windows-x86_64-20140702\sdk\tools;E:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools;E:\adt-bundle-windows-x86_64-20140702\sdk\build-tools;E:\Program Files\Java\jdk1.8.0_05;.
sie 21, 2014 2:44:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWeb' did not find a matching property.
sie 21, 2014 2:44:05 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8008"]
sie 21, 2014 2:44:05 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
sie 21, 2014 2:44:05 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1024 ms
sie 21, 2014 2:44:05 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
sie 21, 2014 2:44:05 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
sie 21, 2014 2:44:07 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
sie 21, 2014 2:44:08 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [219] milliseconds.
sie 21, 2014 2:44:08 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'HelloWeb'
sie 21, 2014 2:44:08 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'HelloWeb': initialization started
sie 21, 2014 2:44:08 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'HelloWeb-servlet': startup date [Thu Aug 21 14:44:08 CEST 2014]; root of context hierarchy
sie 21, 2014 2:44:08 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]
sie 21, 2014 2:44:08 PM org.springframework.web.servlet.DispatcherServlet initServletBean
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:343)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]
    at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:329)
    ... 28 more

sie 21, 2014 2:44:08 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:343)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]
    at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:329)
    ... 28 more

sie 21, 2014 2:44:08 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /HelloWeb threw load() exception
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]
    at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:329)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
    at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

sie 21, 2014 2:44:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\docs
sie 21, 2014 2:44:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\docs has finished in 79 ms
sie 21, 2014 2:44:08 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\examples
sie 21, 2014 2:44:09 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
sie 21, 2014 2:44:09 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
sie 21, 2014 2:44:09 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', '[email protected]')
sie 21, 2014 2:44:09 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\examples has finished in 581 ms
sie 21, 2014 2:44:09 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\host-manager
sie 21, 2014 2:44:09 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\host-manager has finished in 110 ms
sie 21, 2014 2:44:09 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\manager
sie 21, 2014 2:44:09 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\manager has finished in 171 ms
sie 21, 2014 2:44:09 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\ROOT
sie 21, 2014 2:44:09 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\ROOT has finished in 47 ms
sie 21, 2014 2:44:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8008"]
sie 21, 2014 2:44:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
sie 21, 2014 2:44:09 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4094 ms
0

Springowy context ma być wewnątrz WEB-INF a nie obok. BTW nazwanie kontekstu servlet to jakiś mindfuck. Tam nie ma żadnego servletu...

0

Ok, przeniosłem @Shalom tak jak napisałeś, ale dalej "The requested resource is not available".


sie 21, 2014 3:21:38 PM org.apache.catalina.core.AprLifecycleListener init
INFO: 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\jre8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;E:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;E:\adt-bundle-windows-x86_64-20140702\sdk\tools;E:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools;E:\adt-bundle-windows-x86_64-20140702\sdk\build-tools;E:\Program Files\Java\jdk1.8.0_05;.
sie 21, 2014 3:21:38 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWeb' did not find a matching property.
sie 21, 2014 3:21:39 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8008"]
sie 21, 2014 3:21:39 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
sie 21, 2014 3:21:39 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1107 ms
sie 21, 2014 3:21:39 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
sie 21, 2014 3:21:39 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
sie 21, 2014 3:21:41 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
sie 21, 2014 3:21:41 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [178] milliseconds.
sie 21, 2014 3:21:41 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'HelloWeb'
sie 21, 2014 3:21:41 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'HelloWeb': initialization started
sie 21, 2014 3:21:41 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'HelloWeb-servlet': startup date [Thu Aug 21 15:21:41 CEST 2014]; root of context hierarchy
sie 21, 2014 3:21:41 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]
sie 21, 2014 3:21:42 PM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/hello] onto handler 'helloController'
sie 21, 2014 3:21:42 PM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/hello.*] onto handler 'helloController'
sie 21, 2014 3:21:42 PM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/hello/] onto handler 'helloController'
sie 21, 2014 3:21:42 PM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'HelloWeb': initialization completed in 913 ms
sie 21, 2014 3:21:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\docs
sie 21, 2014 3:21:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\docs has finished in 85 ms
sie 21, 2014 3:21:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\examples
sie 21, 2014 3:21:43 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
sie 21, 2014 3:21:43 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
sie 21, 2014 3:21:43 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', '[email protected]')
sie 21, 2014 3:21:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\examples has finished in 620 ms
sie 21, 2014 3:21:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\host-manager
sie 21, 2014 3:21:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\host-manager has finished in 92 ms
sie 21, 2014 3:21:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\manager
sie 21, 2014 3:21:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\manager has finished in 88 ms
sie 21, 2014 3:21:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory E:\apache-tomcat-7.0.54\webapps\ROOT
sie 21, 2014 3:21:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory E:\apache-tomcat-7.0.54\webapps\ROOT has finished in 60 ms
sie 21, 2014 3:21:43 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8008"]
sie 21, 2014 3:21:43 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
sie 21, 2014 3:21:43 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4495 ms

@niezdecydowany oj przydała by się taka wtyczka.

Mi się rzuca w oczy tylko takie ostrzeżenie.

WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWeb' did not find a matching property.
sie 21, 2014 3:21:39 PM org.apache.coyote.AbstractProtocol init 
1

Ale co ty próbujesz odpalić? Na pewno http://localhost:8080/hello? Bo innego adresu nie mapujesz.

0

Ok dzięki wielkie @Shalom. Nie doczytałem tego: Once you are done with creating source and configuration files, export your application. Right click on your application and use Export > WAR File option and save your HelloWeb.war file in Tomcat's webapps folder.W eclipse miałem otwarty plik hello.jsp, klikałem run, pojawiało się okno z wyborem serwera, tomcat startował i w eclipse otwierała się strona http://localhost:8008/HelloWeb/WEB-INF/jsp/hello.jsp i dlatego dalej pisało: The requested resource is not available. Np. VS projekt ASP.NET klikałem run i uruchamiał się od razu w przeglądarce to co powinno być. Teraz wpisałem w przeglądarce http://localhost:8008/HelloWeb/hello i działa. Jeszcze raz dzięki.

0

Coś kłamiesz. Jak zrobisz w eclipse normalnie run on server to powinno ci otworzyć zwykle http://localhost:8080/NazwaAplikacji/. Coś czuje że sam taki adres z głupa wpisałeś...

1

No oczywiście że źle klikasz coś. Kliknij prawym klawiszem na aplikację (z menu po lewej stronie) i tam daj Run On Server. Bo teraz to masz otwarty plik jsp i na nim próbujesz wykonać akcje "run on server" toteż to właśnie eclipse robi. Poza tym jak już masz aplikację ustawioną na tomacacie to jego wystartowanie automatycznie startuje też aplikacje...

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0