严重:调度程序初始化失败无法加载配置。 - action - file:

时间:2016-11-25 01:22:22

标签: struts2 weblogic

我是Struts2的新手(版本struts-2.3.4,我使用了所有的依赖jar)。我开发了一个应用程序,并尝试在Weblogic 9.2服务器中部署它。它显示错误"严重:调度程序初始化失败无法加载配置。 - 行动 - 档案"然后是我粘贴的线条

此代码适用于Jboss,但不适用于Weblogic。那么,可能是什么错误呢?这是什么解决方案?

SEVERE: Dispatcher initialization failed
Unable to load configuration. - action - file:/users/capstat/tiv/bea/user_projects/domains/UATTIV/autodeploy/xmlconversion.war/WEB-INF/classes/struts.xml:19:57
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:309)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:88)
    at weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:56)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1618)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2761)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:889)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:333)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:181)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:358)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:52)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:186)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: Action class [Login] not found - action - file:/users/capstat/tiv/bea/user_projects/domains/UATTIV/autodeploy/xmlconversion.war/WEB-INF/classes/struts.xml:19:57
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:434)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:378)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:495)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:286)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:234)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
    ... 40 more
<Nov 24, 2016 11:46:19 AM CET> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
Unable to load configuration. - action - file:/users/capstat/tiv/bea/user_projects/domains/UATTIV/autodeploy/xmlconversion.war/WEB-INF/classes/struts.xml:19:57
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:450)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:309)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    Truncated. see log file for complete stacktrace
Unable to load configuration. - action - file:/users/capstat/tiv/bea/user_projects/domains/UATTIV/autodeploy/xmlconversion.war/WEB-INF/classes/struts.xml:19:57
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    Truncated. see log file for complete stacktrace
Action class [Login] not found - action - file:/users/capstat/tiv/bea/user_projects/domains/UATTIV/autodeploy/xmlconversion.war/WEB-INF/classes/struts.xml:19:57
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:434)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:378)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:495)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:286)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
    Truncated. see log file for complete stacktrace

在这种情况下可能出现什么问题???

的web.xml:

<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN' 'http://java.sun.com/j2ee/dtds/web-app_2.2.dtd'>

<web-app>

<filter>
<filter-name>struts2</filter-name> 
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> 
</filter>

<filter-mapping>
<filter-name>struts2</filter-name> 
<url-pattern>/*</url-pattern> 
</filter-mapping>

<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>

struts.xml中:

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>  

<constant name="struts.enable.DynamicMethodInvocation" value="false" /> 
<constant name="struts.devMode" value="false" />

<package name="default" namespace="/" extends="struts-default">

<global-exception-mappings>  
<exception-mapping result="myresult" exception="java.lang.Exception"></exception-mapping>  
</global-exception-mappings>

<action name="loginUser" class="Login" method="execute">
<result name="input">login.jsp</result>
<result name="success">all_pages.jsp</result>
</action>

</package>  

</struts>

Login.class:

import com.opensymphony.xwork2.ActionSupport;

public class Login extends ActionSupport{

    private static final long serialVersionUID = 1L;
    private String name;
       private String password;

       public String execute() 
       {
           return SUCCESS;
       }
       public String getName() {
           return name;
       }
       public void setName(String name) {
           this.name = name;
       }
       public String getPassword() {
           return password;
       }
       public void setPassword(String password) {
           this.password = password;
       }

       public void validate()
       {
          if (name == null || name.trim().equals(""))
          {
             addFieldError("name","Please Provide");
          }
          if (password== null || password.trim().equals(""))
          {
             addFieldError("password","Please Provide");
          }
       }
    }

0 个答案:

没有答案