2013-10-07 3 views
0

struts2 + jboss 4.2.1로 프로젝트를 구성하려고합니다. 많은 테스트와 시행을했는데 너무 많이 읽었지만 제대로 작동하지 않습니다.오류 Struts 2 struts-default.xml

간단한 페이지 인덱스를 만들고 싶습니다. Jboss에서 클래스 경로 라이브러리를 설정하기 위해 다양한 라이브러리를 변경했지만 아무 것도 시도하지 않았습니다. 항상 같은 오류 :

SEVERE: Dispatcher initialization failed 
Unable to load configuration. - Bean - jar: 

WebContent/WEB-INF/lib/struts2-core-2.1.8.1.jar!/Struts-default.xml: 85:158 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration 
라이브러리

내가 바람둥이와 동일한 프로젝트를 시도 struts2 의 구성에 태그를 추가 한 web.xml 파일에서
common-lang3.jar 
commons-beanutils-1.7.0.jar 
commons-chain-1.2.jar 
commons-fileupload-1.2.1.jar 
commons-io-1.3.2.jar 
commons-logging-1.1.1.jar 
commons-validator.jar 
freemarker-2.3.19.jar 
javassist.jar 
ognl-2.6.11.jar 
servlet-api-6.0.29.jar 
struts2-core-2.1.8.1.jar 
xwork-2.1.3.jar 
xwork-core-2.2.1.jar 

를 사용

문제없이 작동 . jboss에서 프로젝트에있는 lib를 넣으려고했지만 아무 것도 변경되지 않았습니다!

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> 
    <display-name>ViaProva</display-name> 


<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>index.html</welcome-file> 
    <welcome-file>index.htm</welcome-file> 
    <welcome-file>index.jsp</welcome-file> 
    <welcome-file>default.html</welcome-file> 
    <welcome-file>default.htm</welcome-file> 
    <welcome-file>default.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.0//EN" 
"http://struts.apache.org/dtds/struts-2.0.dtd"> 

<struts> 
    <constant name="struts.devMode" value="true" /> 

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

     <action name="addCustomerAction" 
      class="it.niuma.via.action.CustomerAction" method="addCustomer" > 
      <result name="success">pages/customer.jsp</result> 
     </action> 

     <action name="listCustomerAction" 
      class="it.niuma.via.action.CustomerAction" method="listCustomer" > 
      <result name="success">pages/customer.jsp</result> 
     </action> 

    </package> 

</struts> 

사람이 나에게 어떤 제안을 줄 알고 있나요?

+1

왜 도서관 버전이 다른가요? struts2 jar가 동일한 버전이어야 함을 확인하십시오. –

+0

Maven을 사용하여 수동으로 수행하지 않고 프로젝트의 종속성을 관리하십시오. –

+0

전체 스택 추적도 포함합니다. –

답변

0

일반적으로이 오류 메시지는 스트럿츠 단지의 버전 간 충돌을 나타냅니다.

수동으로 항아리를 다운로드하는 대신 Maven을 사용하는 것이 좋습니다. 항아리가 없거나 충돌 등의 문제가 많은 경우 Maven이 해결합니다.