- PR -

Actionクラス ClassNotFoundExceptionについて

1
投稿者投稿内容
会議室デビュー日: 2008/10/12
投稿数: 2
投稿日時: 2008-10-12 18:29
初めて投稿させていただきます。
eclipse3.2でstruts1.3.8を使ってWebアプリケーションを学習しているのですが、
tomcatを起動し、ブラウザ画面にて 「HTTPステータス 500 -」 が表示され悩んでいます。やりたいことは、"hello.do"からHelloActionへ、findForward("hoge") で、jsp画面を表示させたいのですが。
以下、詳細です。

コンソール
-------------------------------------------------------------------------------
2008/10/12 16:46:48 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
情報: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\\Program Files\\Java\\jre1.6.0\\bin;.;C:\\Windows\\Sun\\Java\\bin;C:\\Windows\\system32;C:\\Windows;C:\\oraclexe\\app\\oracle\\product\\10.2.0\\server\\bin;C:\\PROGRA~1\\JUSTSY~1\\JSLIB32;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Program Files\\DigiOn\\DiXiM Media Client for Media Center;C:\\Program Files\\Common Files\\Roxio Shared\\DLLShared\\;C:\\Program Files\\Common Files\\Roxio Shared\\9.0\\DLLShared\\;C:\\Program Files\\Common Files\\Sony Shared\\FeliCaLibrary;C:\\Program Files\\Common Files\\Ulead Systems\\MPEG;C:\\Program Files\\Edy\\Edy Library;C:\\Program Files\\Microsoft SQL Server\\90\\Tools\\binn;D:\\apache-ant-1.6.5\\bin;C:\\Program Files\\Java\\jdk1.5.0_12\\bin;C:\\Program Files\\Microsoft SQL Server\\90\\Tools\\binn\\
2008/10/12 16:46:48 org.apache.coyote.http11.Http11BaseProtocol init
情報: Coyote HTTP/1.1を http-8080 で初期化します
2008/10/12 16:46:48 org.apache.catalina.startup.Catalina load
情報: Initialization processed in 1127 ms
2008/10/12 16:46:49 org.apache.catalina.core.StandardService start
情報: サービス Catalina を起動します
2008/10/12 16:46:49 org.apache.catalina.core.StandardEngine start
情報: Starting Servlet Engine: Apache Tomcat/5.5.27
2008/10/12 16:46:49 org.apache.catalina.core.StandardHost start
情報: XML検証は無効です
2008/10/12 16:46:49 org.apache.struts.action.ActionServlet initChain
情報: Loading chain catalog from jar:file:/D:/WorkSpace3.2.2/struts/WEB-INF/lib/struts-core-1.3.8.jar!/org/apache/struts/chain/chain-config.xml
2008/10/12 16:46:50 org.apache.struts.validator.ValidatorPlugIn initResources
情報: Loading validation rules file from '/org/apache/struts/validator/validator-rules.xml'
2008/10/12 16:46:50 org.apache.struts.validator.ValidatorPlugIn initResources
情報: Loading validation rules file from '/WEB-INF/validation.xml'
2008/10/12 16:46:51 org.apache.catalina.startup.HostConfig deployWAR
情報: Webアプリケーションアーカイブ struts-blank-1.3.8.war を配備します
2008/10/12 16:46:52 org.apache.struts.action.ActionServlet initChain
情報: Loading chain catalog from jar:file:/D:/apache-tomcat-5.5.27/apache-tomcat-5.5.27/webapps/struts-blank-1.3.8/WEB-INF/lib/struts-core-1.3.8.jar!/org/apache/struts/chain/chain-config.xml
2008/10/12 16:46:53 org.apache.struts.validator.ValidatorPlugIn initResources
情報: Loading validation rules file from '/org/apache/struts/validator/validator-rules.xml'
2008/10/12 16:46:53 org.apache.struts.validator.ValidatorPlugIn initResources
情報: Loading validation rules file from '/WEB-INF/validation.xml'
2008/10/12 16:46:54 org.apache.catalina.core.ApplicationContext log
情報: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2008/10/12 16:46:54 org.apache.catalina.core.ApplicationContext log
情報: ContextListener: contextInitialized()
2008/10/12 16:46:54 org.apache.catalina.core.ApplicationContext log
情報: SessionListener: contextInitialized()
2008/10/12 16:46:54 org.apache.catalina.core.ApplicationContext log
情報: ContextListener: contextInitialized()
2008/10/12 16:46:54 org.apache.catalina.core.ApplicationContext log
情報: SessionListener: contextInitialized()
2008/10/12 16:46:55 org.apache.coyote.http11.Http11BaseProtocol start
情報: Coyote HTTP/1.1を http-8080 で起動します
2008/10/12 16:46:55 org.apache.jk.common.ChannelSocket init
情報: JK: ajp13 listening on /0.0.0.0:8009
2008/10/12 16:46:55 org.apache.jk.server.JkMain start
情報: Jk running ID=0 time=0/47 config=null
2008/10/12 16:46:55 org.apache.catalina.storeconfig.StoreLoader load
情報: Find registry server-registry.xml at classpath resource
2008/10/12 16:46:55 org.apache.catalina.startup.Catalina start
情報: Server startup in 6676 ms
2008/10/12 16:47:45 org.apache.struts.chain.ComposableRequestProcessor init
情報: Initializing composable request processor for module prefix ''
2008/10/12 16:47:45 org.apache.struts.chain.commands.servlet.CreateAction createAction
情報: Initialize action of type: java.HelloAction
2008/10/12 16:47:45 org.apache.struts.chain.commands.AbstractExceptionHandler execute
警告: Unhandled exception
java.lang.ClassNotFoundException: java.HelloAction
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
at org.apache.struts.chain.commands.util.ClassUtils.getApplicationClass(ClassUtils.java:54)
at org.apache.struts.chain.commands.util.ClassUtils.getApplicationInstance(ClassUtils.java:71)
at org.apache.struts.chain.commands.servlet.CreateAction.createAction(CreateAction.java:98)
at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:68)
at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:90)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
2008/10/12 16:47:45 org.apache.struts.chain.commands.ExceptionCatcher postprocess
警告: Exception from exceptionCommand 'servlet-exception'
java.lang.ClassNotFoundException: java.HelloAction
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
at org.apache.struts.chain.commands.util.ClassUtils.getApplicationClass(ClassUtils.java:54)
at org.apache.struts.chain.commands.util.ClassUtils.getApplicationInstance(ClassUtils.java:71)
at org.apache.struts.chain.commands.servlet.CreateAction.createAction(CreateAction.java:98)
at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:68)
at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:90)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
2008/10/12 16:47:45 org.apache.catalina.core.StandardWrapperValve invoke
致命的: サーブレット action のServlet.service()が例外を投げました
java.lang.ClassNotFoundException: java.HelloAction
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
at org.apache.struts.chain.commands.util.ClassUtils.getApplicationClass(ClassUtils.java:54)
at org.apache.struts.chain.commands.util.ClassUtils.getApplicationInstance(ClassUtils.java:71)
at org.apache.struts.chain.commands.servlet.CreateAction.createAction(CreateAction.java:98)
at org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:68)
at org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:90)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
-------------------------------------------------------------------------------

ブラウザ
-------------------------------------------------------------------------------
type 例外レポート

メッセージ

説明 The server encountered an internal error () that prevented it from fulfilling this request.

例外

javax.servlet.ServletException: java.HelloAction
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


原因

java.lang.ClassNotFoundException: java.HelloAction
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
org.apache.struts.chain.commands.util.ClassUtils.getApplicationClass(ClassUtils.java:54)
org.apache.struts.chain.commands.util.ClassUtils.getApplicationInstance(ClassUtils.java:71)
org.apache.struts.chain.commands.servlet.CreateAction.createAction(CreateAction.java:98)
org.apache.struts.chain.commands.servlet.CreateAction.getAction(CreateAction.java:68)
org.apache.struts.chain.commands.AbstractCreateAction.execute(AbstractCreateAction.java:90)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
-------------------------------------------------------------------------------

struts-config(action-mappings内)
-------------------------------------------------------------------------------
<action-mappings>
<action path="/hello" type="java.HelloAction">
<forward name="hoge" path="/hello.jsp"/>
</action>
</action-mappings>
-------------------------------------------------------------------------------

コンソールにて、ClassNotFoundException がでており、ActionClassがないと言っているのですが、Actionを継承して、execute()のオーバーライドは確認しています。
struts-configでも、記述にミスがないと思うのですが。
eclipseの設定なのでしょうか?ご教授、宜しくお願いします。
ぴあちゃん
ぬし
会議室デビュー日: 2008/02/07
投稿数: 287
投稿日時: 2008-10-12 21:15
HelloAction.java が無いのでは?

会議室デビュー日: 2008/10/12
投稿数: 2
投稿日時: 2008-10-12 22:52
コメントありがとうございます。
struts-config のアクションサーブレットを指定しているヵ所のパッケージの"java.…"のところを削除して、尚且つディレクトリのパッケージのjavaを削除して実行したら、解決しました。
何故だかはわかりません。
どこの、なんの設定なのかも検討もつきません。
できれば、ご教授を宜しくお願いします。

山本 裕介
ぬし
会議室デビュー日: 2003/05/22
投稿数: 2415
お住まい・勤務地: 恵比寿
投稿日時: 2008-10-13 00:02
Tomcat にサーブレットのサンプルプログラムが付属していますよね?

何が違うのか比べてみてはいかがでしょう。
1

スキルアップ/キャリアアップ(JOB@IT)