鍍金池/ 問答/Java/ struts2環(huán)境搭建,提示找不到action,Caused by: Actio

struts2環(huán)境搭建,提示找不到action,Caused by: Action class [a.b] not found

struts.xml內容

<struts>

<package name="hellodemo"  extends="struts-default" namespace="/">
    <action name="hell" class="a.b">
        <result name="ok">/hello.jsp</result>
    </action>
</package>

</struts>
a.b類
package a;

public class b {

public String execute() {
    return "ok";
}

}

clipboard.png

clipboard.png

報錯信息
嚴重: Dispatcher initialization failed
Unable to load configuration. - action - file:/G:/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts/WEB-INF/classes/struts.xml:8:35
Caused by: Action class [a.b] not found - action - file:/G:/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts/WEB-INF/classes/struts.xml:8:35
求大神幫忙看看,實在找不出錯誤。

回答
編輯回答
臭榴蓮

clipboard.png原來是jdk9和tomcat8.5
出現(xiàn)了截圖這個問題,為解決這個,卸載了jdk9,重裝jdk8,eclipse也不管用了。重裝elicpse。出現(xiàn)了我提問的這個問題,搜了無數(shù)答案,仔細檢查自己的代碼也沒有問題,,第一次提問,也沒人回答,笑哭,最后一個辦法,卸載tomcat安裝tomcat8.0,再次安裝elicpse。ok問題解決了。

2017年11月25日 02:15