Results 1 to 2 of 2
  1. #1
    onceuponatime is offline Member
    Join Date
    Dec 2007
    Posts
    1
    Rep Power
    0

    Default HTTP Status 404 - Servlet action is not available

    hi, i'm new to java, when i put http://localhost:8080/.../userloginjsp.do in myEclipse web browser, it shows this message:
    "HTTP Status 404 - Servlet action is not available "
    what's the problem? here's my web.xml and struts config and tomcat log

    //Web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <servlet>
    <servlet-name> action </servlet-name>
    <servlet-class> org.apache.struts.action.ActionServlet </servlet-class>
    <init-param>
    <param-name> config </param-name>
    <param-value> /WEB-INF/struts-config.xml </param-value>
    </init-param>
    <init-param>
    <param-name> debug </param-name>
    <param-value> 3 </param-value>
    </init-param>
    <init-param>
    <param-name> detail </param-name>
    <param-value> 3 </param-value>
    </init-param>
    <load-on-startup> 0 </load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name> action </servlet-name>
    <url-pattern> *.do </url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file> userloginjsp.do </welcome-file>
    </welcome-file-list>
    </web-app>

    //Struts Config:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">

    <struts-config>
    <data-sources>
    <data-source key="bbsDB" type="org.apache.commons.dbcp.BasicDataSource">
    <set-property property="driverClassName" value="org.gjt.mm.mysql.Driver" />
    <set-property property="url" value="jdbc:mysql://localhost:3306/BBS" />
    <set-property property="username" value="root" />
    <set-property property="password" value="root" />
    </data-source>
    </data-sources>
    <form-beans>
    <form-bean name="userLoginForm" type="j2eebbs.user.form.UserLoginForm" />
    <form-bean name="forumform" type="j2eebbs.user.form.ForumForm" />
    <form-bean name="newArticleForm" type="j2eebbs.user.form.NewArticleForm"> </form-bean>
    <form-bean name="topicOfResponseForm" type="j2eebbs.user.form.TopicOfResponseForm" />
    <form-bean name="registrationForm" type="j2eebbs.user.form.RegistrationForm" />

    <form-bean name="adminLoginForm" type="j2eebbs.admin.form.AdminLoginForm" />
    <form-bean name="userManagerForm" type="j2eebbs.admin.form.UserManagerForm" />
    <form-bean name="forumManagerForm" type="j2eebbs.admin.form.ForumManagerForm" />
    <form-bean name="forumidForm" type="j2eebbs.admin.form.ForumidForm" />
    <form-bean name="topicManagerForm" type="j2eebbs.admin.form.TopicManagerForm" />
    </form-beans>
    <global-exceptions />
    <global-forwards>
    <forward name="UserLoginSucceed" path="/user/bbsindex.jsp" />
    <forward name="ToErrorPage" path="/common/messagepage.jsp" />
    <forward name="ToTopicList" path="/user/topiclist.jsp" />
    <forward name="NewArticle" path="/user/newarticle.jsp" />
    <forward name="ToResponseList" path="/user/responselist.jsp" />
    <forward name="ToUserLogin" path="/user/userlogin.jsp" />

    <forward name="ToAdminIndex" path="/admin/adminindex.jsp" />
    <forward name="ToUserManager" path="/admin/usermanager.jsp" />
    <forward name="ToForumManager" path="/admin/forummanager.jsp" />
    <forward name="ToForumEdit" path="/admin/forumedit.jsp" />
    <forward name="ToForumCreate" path="/admin/forumcreate.jsp" />
    <forward name="ToTopicManager" path="/admin/topicmanager.jsp" />
    <forward name="ToAdminLogin" path="/admin/adminlogin.jsp" />
    </global-forwards>
    <action-mappings>
    <action path="/userlogin" type="j2eebbs.user.action.UserLoginAction" name="userLoginForm" scope="session" input="/user/userlogin.jsp" />
    <action path="/topiclist" type="j2eebbs.user.action.TopicListAction" name="forumform" scope="request" input="/common/messagepage.jsp" />
    <action path="/newtopic" type="j2eebbs.user.action.NewTopicAction" input="/common/messagepage.jsp" />
    <action path="/submitarticle" type="j2eebbs.user.action.SubmitArticleAction" name="newArticleForm" validate="true" scope="request" input="/common/messagepage.jsp" />
    <action path="/responselist" type="j2eebbs.user.action.ResponseListAction" name="topicOfResponseForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/submitregistration" type="j2eebbs.user.action.RegistrationAction" name="registrationForm" validate="true" scope="request" input="/common/messagepage.jsp" />
    <action path="/registration" forward="/user/registration.jsp" />
    <action path="/backtoindex" forward="/user/bbsindex.jsp" />
    <action path="/logoff" type="j2eebbs.user.action.LogoffAction" />
    <action path="/userloginjsp" forward="/user/userlogin.jsp" />

    <action path="/adminlogin" type="j2eebbs.admin.action.AdminLoginAction" name="adminLoginForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/usermanager" type="j2eebbs.admin.action.UserManagerAction" input="/common/messagepage.jsp" />
    <action path="/searchuser" type="j2eebbs.admin.action.SearchUserAction" name="userManagerForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/edituser" type="j2eebbs.admin.action.UserEditAction" name="userManagerForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/usereditjsp" forward="/admin/useredit.jsp" />
    <action path="/userdelete" type="j2eebbs.admin.action.UserDeleteAction" name="userManagerForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/forummanager" type="j2eebbs.admin.action.ForumManagerAction" input="/common/messagepage.jsp" />
    <action path="/forumedit" type="j2eebbs.admin.action.ForumEditAction" name="forumManagerForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/forumeditsubmit" type="j2eebbs.admin.action.ForumEditSubmitAction" name="forumManagerForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/forumdelete" type="j2eebbs.admin.action.ForumDeleteAction" name="forumidForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/forumprecreate" type="j2eebbs.admin.action.PrepareToCreateForumAct ion" input="/admin/forummanager.jsp" />
    <action path="/forumcreate" type="j2eebbs.admin.action.ForumCreateAction" name="forumManagerForm" scope="request" input="/admin/forummanager.jsp" />
    <action path="/topicmanager" forward="/admin/topicmanager.jsp" />
    <action path="/topicdelete" type="j2eebbs.admin.action.TopicDeleteAction" name="topicManagerForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/topicsearch" type="j2eebbs.admin.action.TopicSearchAction" name="topicManagerForm" scope="request" input="/common/messagepage.jsp" />
    <action path="/adminlogoff" type="j2eebbs.admin.action.AdminLogoffAction" />
    <action path="/backtoadminindex" forward="/admin/adminindex.jsp" />
    <action path="/adminloginjsp" forward="/admin/adminlogin.jsp" />

    </action-mappings>
    <message-resources parameter="j2eebbs.ApplicationResources_zh" />
    </struts-config>

    2007-12-09 10:15:14 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRul e: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterR ule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingR ule: Redirect URL: http://jakarta.apache.org]]
    2007-12-09 10:15:15 StandardContext[/ch12]Marking servlet action as unavailable
    2007-12-09 10:15:15 StandardContext[/ch12]Servlet /ch12 threw load() exception
    javax.servlet.UnavailableException: Initializing application data source noticemanagerDB
    at org.apache.struts.action.ActionServlet.initModuleD ataSources(ActionServlet.java:812)
    at org.apache.struts.action.ActionServlet.init(Action Servlet.java:335)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1029)
    at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:862)
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4013)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4357)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:823)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDeployer.java:277)
    at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:832)
    at org.apache.catalina.startup.HostConfig.deployDirec tories(HostConfig.java:701)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:432)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:349)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:480)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)

    2007-12-09 10:15:15 StandardContext[/ch15]Marking servlet action as unavailable
    2007-12-09 10:15:15 StandardContext[/ch15]Servlet /ch15 threw load() exception
    javax.servlet.UnavailableException: Initializing application data source bbsDB
    at org.apache.struts.action.ActionServlet.initModuleD ataSources(ActionServlet.java:812)
    at org.apache.struts.action.ActionServlet.init(Action Servlet.java:335)
    at javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1029)
    at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:862)
    at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4013)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4357)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:823)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
    at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDeployer.java:277)
    at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:832)
    at org.apache.catalina.startup.HostConfig.deployDirec tories(HostConfig.java:701)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:432)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:349)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:480)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)

    2007-12-09 10:15:15 StandardContext[/jsp-examples]ContextListener: contextInitialized()
    2007-12-09 10:15:15 StandardContext[/jsp-examples]SessionListener: contextInitialized()
    2007-12-09 10:15:15 StandardContext[/servlets-examples]ContextListener: contextInitialized()
    2007-12-09 10:15:15 StandardContext[/servlets-examples]SessionListener: contextInitialized()
    2007-12-09 10:15:35 StandardWrapperValve[action]: Servlet action is currently unavailable

    thanks a lot!!!

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default

    I think the url-pattern should begin with a forward slash. So in your case it would be /*.do.

Similar Threads

  1. Applet with scrolling status line
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-10-2008, 02:53 PM
  2. Run RCP action from outside of the Eclipse RCP
    By leonbandas in forum Eclipse
    Replies: 1
    Last Post: 01-07-2008, 07:15 AM
  3. Replies: 1
    Last Post: 08-07-2007, 03:47 PM
  4. Status Code 404
    By tommy in forum Java Servlet
    Replies: 1
    Last Post: 08-06-2007, 08:52 PM
  5. Hide hyperlink address on status bar
    By simon in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-24-2007, 10:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •