Struts2ネタを続けます・・・
2年前
struts2のstruts.xmlを書かない方式で「はまった」こと・・・あれこれ
http://blog.goo.ne.jp/xmldtp/e/b6905d8e6bd9aedfc47ec8c34b87455a
を書いたけど、最近やったら、さらにはまったんで、つけたし・・
(つけたしということで、前回4までだったから、今回は5から)
■はまった点5:そもそもstruts2-convention-plugin-2.3.15.1.jarがない
・現象
はまった点1で、struts2-convention-plugin-2.3.15.1.jarを使っているが、
そもそも、そのjarがない
・対応
ここにある
http://mvnrepository.com/artifact/org.apache.struts/struts2-convention-plugin/2.3.15.1
■はまった点6:Resultのアノテーションでlocationがでてこないでエラー
・現象
Resultのアノテーションでlocationがでてこないでエラーになり
valueとかをいれようとする
・理由
importしているものがちがっている
・対策
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
をインポートすること。
■はまった点7:Tomcatが立ち上がらない
・現象
たちあげようとすると、以下のエラー
9 17, 2015 3:42:34 午後 org.apache.catalina.core.StandardContext filterStart
重大: フィルタ struts2 の起動中の例外です
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerBuilder$4
File: ContainerBuilder.java
Method: create
Line: 132 - com/opensymphony/xwork2/inject/ContainerBuilder.java:132:-1
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:501)
(以下省略)
・理由
Jarのバージョンが違う(ふるい)
・対策
struts2-convention-plugin-2.3.15.1.jarをダウンロードして来いとあれほど・・・
■はまった点8:Tomcatが立ち上がらない part2
・現象
たちあげようとすると、以下のエラー
9 17, 2015 4:04:10 午後 org.apache.catalina.core.StandardContext filterStart
重大: フィルタ struts2 の起動中の例外です
Unable to load configuration. - bean - jar:file:/C:/Users/epson-w7/Desktop/pleiades-e4.3-ultimate-jre_20130926/pleiades/tomcat/7/webapps/test2/WEB-INF/lib/struts2-convention-plugin-2.3.16.jar!/struts-plugin.xml:30:137
(以下省略)
・理由
WEB-INFの下に(バージョン違いで)struts2-convention-pluginが2個以上いる
・対策
struts2-convention-pluginは1個にする
(実は、「struts2-convention-plugin-2.3.15.1.jarをダウンロードして来いとあれほど・・・」
言っていたが、2.3.15.1の必要はなく、2.3.16でもOK)
とりあえず、こんなところ
2年前
struts2のstruts.xmlを書かない方式で「はまった」こと・・・あれこれ
http://blog.goo.ne.jp/xmldtp/e/b6905d8e6bd9aedfc47ec8c34b87455a
を書いたけど、最近やったら、さらにはまったんで、つけたし・・
(つけたしということで、前回4までだったから、今回は5から)
■はまった点5:そもそもstruts2-convention-plugin-2.3.15.1.jarがない
・現象
はまった点1で、struts2-convention-plugin-2.3.15.1.jarを使っているが、
そもそも、そのjarがない
・対応
ここにある
http://mvnrepository.com/artifact/org.apache.struts/struts2-convention-plugin/2.3.15.1
■はまった点6:Resultのアノテーションでlocationがでてこないでエラー
・現象
Resultのアノテーションでlocationがでてこないでエラーになり
valueとかをいれようとする
・理由
importしているものがちがっている
・対策
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
をインポートすること。
■はまった点7:Tomcatが立ち上がらない
・現象
たちあげようとすると、以下のエラー
9 17, 2015 3:42:34 午後 org.apache.catalina.core.StandardContext filterStart
重大: フィルタ struts2 の起動中の例外です
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerBuilder$4
File: ContainerBuilder.java
Method: create
Line: 132 - com/opensymphony/xwork2/inject/ContainerBuilder.java:132:-1
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:501)
(以下省略)
・理由
Jarのバージョンが違う(ふるい)
・対策
struts2-convention-plugin-2.3.15.1.jarをダウンロードして来いとあれほど・・・
■はまった点8:Tomcatが立ち上がらない part2
・現象
たちあげようとすると、以下のエラー
9 17, 2015 4:04:10 午後 org.apache.catalina.core.StandardContext filterStart
重大: フィルタ struts2 の起動中の例外です
Unable to load configuration. - bean - jar:file:/C:/Users/epson-w7/Desktop/pleiades-e4.3-ultimate-jre_20130926/pleiades/tomcat/7/webapps/test2/WEB-INF/lib/struts2-convention-plugin-2.3.16.jar!/struts-plugin.xml:30:137
(以下省略)
・理由
WEB-INFの下に(バージョン違いで)struts2-convention-pluginが2個以上いる
・対策
struts2-convention-pluginは1個にする
(実は、「struts2-convention-plugin-2.3.15.1.jarをダウンロードして来いとあれほど・・・」
言っていたが、2.3.15.1の必要はなく、2.3.16でもOK)
とりあえず、こんなところ