2016-10-14 53 views
0

私はstrutsを初めて使用しています。私は持っています。要求されたリソースは、TomcatでStrutsアプリケーションを実行している間、利用可能なエラーではありません。Struts2.5.2:要求されたリソースは利用できません

私のディレクトリ構造は次のとおりです。

My directory structure is

struts.xml

<?xml version="1.0" encoding="UTF-8"?> 

<!DOCTYPE struts PUBLIC 
     "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" 
     "http://struts.apache.org/dtds/struts-2.5.dtd"> 

<struts> 
<package name ="user_curd" namespace="/" extends ="struts-default" > 
     <global-results> 
      <!-- 下面定义的结果对所有的Action都有效 --> 
      <result name ="exception"> /error.jsp </result> 
     </global-results> 

     <global-exception-mappings> 
      <!-- 指Action抛出Exception异常时,转入名为exception的结果。 --> 
      <exception-mapping exception ="java.lang.Exception" result="exception" /> 
     </global-exception-mappings> 

     <action name ="test" class ="helloworld.TestAction"> 
     </action> 
</package> 
</struts> 

web.xmlの

<web-app id="MyStrutsApp" version="2.4" 
    xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 

<!--为Struts2定义一个过滤器 --> 
    <filter> 
     <filter-name>struts2</filter-name> 
     <filter-class> 
     org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter 
     </filter-class> 
    </filter> 
    <filter-mapping> 
     <filter-name>struts2</filter-name> 
     <url-pattern>/*</url-pattern> 
    </filter-mapping> 
</web-app> 

出力

J:\apache-tomcat-8.0.35\bin\catalina.bat run 
[2016-10-14 09:36:25,278] Artifact ssh_test:war exploded: Server is not connected. Deploy is not available. 
Using CATALINA_BASE: "C:\Users\m\.IntelliJIdea2016.2\system\tomcat\Tomcat_8_0_35_ssh_test" 
Using CATALINA_HOME: "J:\apache-tomcat-8.0.35" 
Using CATALINA_TMPDIR: "J:\apache-tomcat-8.0.35\temp" 
Using JRE_HOME:  "F:\java\jdk" 
Using CLASSPATH:  "J:\apache-tomcat-8.0.35\bin\bootstrap.jar;J:\apache-tomcat-8.0.35\bin\tomcat-juli.jar" 
14-Oct-2016 21:36:26.572 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:  Apache Tomcat/8.0.35 
14-Oct-2016 21:36:26.573 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:   May 11 2016 21:57:08 UTC 
14-Oct-2016 21:36:26.573 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:   8.0.35.0 
14-Oct-2016 21:36:26.573 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:    Windows 10 
14-Oct-2016 21:36:26.573 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:   10.0 
14-Oct-2016 21:36:26.573 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:   amd64 
14-Oct-2016 21:36:26.573 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:    F:\java\jdk\jre 
14-Oct-2016 21:36:26.574 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:   1.8.0_77-b03 
14-Oct-2016 21:36:26.574 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:   Oracle Corporation 
14-Oct-2016 21:36:26.574 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:   C:\Users\m\.IntelliJIdea2016.2\system\tomcat\Tomcat_8_0_35_ssh_test 
14-Oct-2016 21:36:26.574 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:   J:\apache-tomcat-8.0.35 
14-Oct-2016 21:36:26.574 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote= 
14-Oct-2016 21:36:26.574 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099 
14-Oct-2016 21:36:26.574 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\m\.IntelliJIdea2016.2\system\tomcat\Tomcat_8_0_35_ssh_test\conf\logging.properties 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=J:\apache-tomcat-8.0.35\endorsed 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\m\.IntelliJIdea2016.2\system\tomcat\Tomcat_8_0_35_ssh_test 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=J:\apache-tomcat-8.0.35 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=J:\apache-tomcat-8.0.35\temp 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.2.7 using APR version 1.5.2. 
14-Oct-2016 21:36:26.575 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 
14-Oct-2016 21:36:27.300 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.2h 3 May 2016) 
14-Oct-2016 21:36:27.403 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8080"] 
14-Oct-2016 21:36:27.410 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"] 
14-Oct-2016 21:36:27.412 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1082 ms 
14-Oct-2016 21:36:27.431 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina 
14-Oct-2016 21:36:27.431 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.35 
14-Oct-2016 21:36:27.441 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-apr-8080"] 
14-Oct-2016 21:36:27.451 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-apr-8009"] 
14-Oct-2016 21:36:27.455 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 42 ms 
Connected to server 
[2016-10-14 09:36:27,924] Artifact ssh_test:war exploded: Artifact is being deployed, please wait... 
14-Oct-2016 21:36:28.887 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. 
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... 
[2016-10-14 09:36:29,855] Artifact ssh_test:war exploded: Artifact is deployed successfully 
[2016-10-14 09:36:29,855] Artifact ssh_test:war exploded: Deploy took 1,931 milliseconds 
14-Oct-2016 21:36:37.449 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory J:\apache-tomcat-8.0.35\webapps\manager 
14-Oct-2016 21:36:37.534 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory J:\apache-tomcat-8.0.35\webapps\manager has finished in 84 ms 

注: 1.struts 2.5.2

2. lib

3.Tomacat 8.0.35

+0

どのようなリソースですか?また、コード内のこれらの象形文字を英語に翻訳します。 –

+0

私は問題を解決しました。ありがとうございます。 – junwuhui

答えて

0

問題は、アクションメソッドです。私はこの問題を解決するためにparamメソッド= "excute"を追加します。

<action name ="test" method="excute" class ="helloworld.TestAction"> 
+0

デフォルトのメソッド 'execute'に入力ミスがあります。 –

関連する問題