1

我正在使用 spring 源 dm 服务器版本 2.0.0。我在 spring/struts/hibernate 中开发了一个应用程序。当我在 spring dm 服务器中运行我的应用程序时

它给了我这样的错误:

HTTP 状态 503 - Servlet 操作当前不可用类型:状态报告消息:Servlet 操作当前不可用

描述:请求的服务(Servlet 操作当前不可用)当前不可用。

我的 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"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<!-- Action Servlet Configuration -->
<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>2</load-on-startup>
</servlet>

<!--  Spring Framework context Loader -->
<servlet>
    <servlet-name>context</servlet-name>
    <servlet-class>
        org.springframework.web.context.ContextLoaderServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<!--  Spring Framework context config location -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/applicationContext*.xml
    </param-value>
</context-param>

<!--TODO Prevent direct calls to *.jsp -->

<!-- Action Servlet Mapping -->
<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.htm</url-pattern>
</servlet-mapping>

<!-- The Welcome File List -->
<welcome-file-list>
    <welcome-file>start.jsp</welcome-file>
</welcome-file-list>

<!-- Define the basename for a resource bundle for I18N -->
<context-param>
    <param-name>
        javax.servlet.jsp.jstl.fmt.localizationContext
    </param-name>
    <param-value>
        com.patni.temgt.web.ApplicationResources
    </param-value>
</context-param>

<resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/SettleTest</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

struts-config.xml 是:


<form-beans>
    <form-bean name="timeEntryForm"
        type="com.patni.temgt.web.CreateTimeEntryActionForm" />
    <form-bean name="expenseEntryForm"
        type="com.patni.temgt.web.CreateExpenseEntryActionForm" />          
    <form-bean name="timeEntryReportForm"
        type="com.patni.temgt.web.TimeEntryReportActionForm" />
    <form-bean name="adminCostingCodeForm"
        type="com.patni.temgt.web.AdminCostingCodeActionForm" />
    <form-bean name="loginForm"
        type="com.patni.temgt.web.LoginActionForm" />
    <form-bean name="adminEnvironmentVariableForm"
        type="com.patni.temgt.web.AdminEnvironmentVariableActionForm" />
    <form-bean name="adminEmployeeForm"
        type="com.patni.temgt.web.AdminEmployeeActionForm" />
    <form-bean name="adminContactDetailForm"
        type="com.patni.temgt.web.AdminContactDetailActionForm" />
    <form-bean name="adminApplicationUserForm"
        type="com.patni.temgt.web.AdminApplicationUserActionForm" />
    <form-bean name="adminUserRoleForm"
        type="com.patni.temgt.web.AdminUserRoleActionForm" />
    <form-bean name="myCostingCodeForm"
        type="com.patni.temgt.web.MyCostingCodeActionForm" />
</form-beans>

<global-forwards>
    <forward name="login" path="/WEB-INF/jsp/login.jsp" />
</global-forwards>

<action-mappings>

    <action path="/timeEntry"
        type="com.patni.temgt.web.CreateTimeEntryAction"
        name="timeEntryForm" scope="session" validate="false"
        input="/WEB-INF/jsp/timeEntry.jsp">
        <forward name="success" path="/WEB-INF/jsp/timeEntry.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/timeEntry.jsp" />            
    </action>

    <action path="/expenseEntry"
        type="com.patni.temgt.web.CreateExpenseEntryAction"
        name="expenseEntryForm" scope="session" validate="false"
        input="/WEB-INF/jsp/expenseEntry.jsp">
        <forward name="success" path="/WEB-INF/jsp/expenseEntry.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/expenseEntry.jsp" />
        <forward name="list" path="/WEB-INF/jsp/expenseList.jsp" />
        <forward name="approvallist" path="/expenseApproval.htm?action=list" redirect="true" />         
    </action>   

    <action path="/expenseApproval"
        type="com.patni.temgt.web.ExpenseApprovalAction"
        name="expenseEntryForm" scope="session" validate="false"
        input="/WEB-INF/jsp/expenseApprovalList.jsp">                   
        <forward name="approvallist" path="/WEB-INF/jsp/expenseApprovalList.jsp" />
    </action>               

    <action path="/adminCostingCode"
        type="com.patni.temgt.web.AdminCostingCodeAction"
        name="adminCostingCodeForm" scope="session" validate="false"
        input="/WEB-INF/jsp/adminCostingCode.jsp">
        <forward name="success" path="/WEB-INF/jsp/adminCostingCode.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/adminCostingCode.jsp" />
    </action>

    <action path="/login"
        type="com.patni.temgt.web.LoginAction"
        name="loginForm" scope="session" validate="false"
        input="/WEB-INF/jsp/login.jsp">
        <forward name="mainPage" redirect="true"
            path="/settleMain.htm" />
    </action>

    <action path="/settleMain"
        type="com.patni.temgt.web.SettleMainAction">
        <forward name="success" path="/WEB-INF/jsp/settleMain.jsp" />
    </action>

    <action path="/adminEnvironmentVariable"
        type="com.patni.temgt.web.AdminEnvironmentVariableAction"
        name="adminEnvironmentVariableForm" scope="session"
        input="/WEB-INF/jsp/adminEnvironmentVariable.jsp">
        <forward name="success"
            path="/WEB-INF/jsp/adminEnvironmentVariable.jsp" />
        <forward name="invalid"
            path="/WEB-INF/jsp/adminEnvironmentVariable.jsp" />
    </action>

    <action path="/adminEmployee"
        type="com.patni.temgt.web.AdminEmployeeAction"
        name="adminEmployeeForm" scope="request"
        input="/WEB-INF/jsp/adminEmployee.jsp">
        <forward name="success" path="/WEB-INF/jsp/adminEmployee.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/adminEmployee.jsp" />
    </action>

    <action path="/adminContactDetail"
        type="com.patni.temgt.web.AdminContactDetailAction"
        name="adminContactDetailForm" scope="request"
        input="/WEB-INF/jsp/adminContactDetail.jsp">
        <forward name="employee" path="/adminEmployee.htm" />
        <forward name="company" path="/adminCompany.htm" />
        <forward name="success" path="/WEB-INF/jsp/adminContactDetail.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/adminContactDetail.jsp" />
    </action>

    <action path="/adminApplicationUser"
        type="com.patni.temgt.web.AdminApplicationUserAction"
        name="adminApplicationUserForm" scope="request"
        input="/WEB-INF/jsp/adminApplicationUser.jsp">
        <forward name="success" path="/WEB-INF/jsp/adminApplicationUser.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/adminApplicationUser.jsp" />
    </action>

    <action path="/adminUserRole"
        type="com.patni.temgt.web.AdminUserRoleAction"
        name="adminUserRoleForm" scope="request"
        input="/WEB-INF/jsp/adminUserRole.jsp">
        <forward name="success" path="/WEB-INF/jsp/adminUserRole.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/adminUserRole.jsp" />
    </action>

    <action path="/timeEntryReporting"
        type="com.patni.temgt.web.TimeEntryReportAction"
        name="timeEntryReportForm" scope="request"
        input="/WEB-INF/jsp/timeEntryReporting.jsp">
        <forward name="success" path="/WEB-INF/jsp/timeEntryReporting.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/timeEntryReporting.jsp" />
    </action>

    <action path="/myCostingCodes"
        type="com.patni.temgt.web.MyCostingCodeAction"
        name="myCostingCodeForm" scope="request"
        input="/WEB-INF/jsp/myCostingCodes.jsp" parameter="method">

        <forward name="success" path="/WEB-INF/jsp/myCostingCodes.jsp" />
        <forward name="invalid" path="/WEB-INF/jsp/myCostingCodes.jsp" />
    </action>

</action-mappings>

<controller>
    <set-property property="processorClass"
        value="org.springframework.web.struts.DelegatingRequestProcessor" />
</controller>

<!-- ========== Message Resources Definitions =========================== -->
<!--    Will look for a properties file 
    com.patni.temgt.web.ApplicationResources.properties" -->
<message-resources
    parameter="com.patni.temgt.web.ApplicationResources" />

<!--  Start the Spring Web Context plugin for Struts -->
<plug-in
    className="org.springframework.web.struts.ContextLoaderPlugIn">
    <set-property property="contextConfigLocation"
        value="/WEB-INF/action-servlet.xml" />
</plug-in>


这可能是什么原因?

4

1 回答 1

1

这意味着由“action” org.apache.struts.action.ActionServlet标识的 servlet未能初始化,可能是由于配置问题或类路径上缺少类。

应用程序服务器的控制台或日志文件中应该会打印一个异常。它可能会指出问题所在。

于 2010-03-01T01:59:36.983 回答