我有一個Spring WS項目,我試圖在JBoss 6服務器上託管。它短暫地工作,然後開始失敗。我做的唯一更改是將一些HTML文件添加到C:\ jboss-6.1.0.Final \ server \ default \ deploy \ ROOT.war文件夾。突然我的服務器不再能夠開始給我這個堆棧跟蹤:JBoss 6 + Spring 3事務管理器加載錯誤
11:30:52,902 WARN [ClassLoaderManager] Unexpected error during load of:
javax.transaction.TransactionManager: java.lang.LinkageError:
loader constraint violation: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader)
previously initiated loading for a different type with name
"javax/transaction/TransactionManager"
我刪除了文件:仍然失敗,相同的錯誤。
我用我的spring-servlet文件和web.xml文件弄了一口氣,並將我的項目重新導出到jboss:仍然失敗,同樣的錯誤。
我刪除並重新安裝JBoss,並重新導出我的項目:仍然失敗,相同的錯誤。
我搜索谷歌使用堆棧跟蹤,並找到了一個同一個人:一些巴西人試圖建立一個郵件服務器也。他沒有得到任何答覆,也沒有再發表任何消息
這裏是我當前的web.xml文件
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
這是我的春天servlet.xml文件
<!-- Use @Component annotations for bean definitions -->
<context:component-scan base-package="chessgame" />
<!-- Use @Controller annotations for MVC controller definitions -->
<mvc:annotation-driven />
<!-- Ref: http://static.springsource.org/spring/docs/2.5.x/reference/metadata.html#metadata-annotations-required -->
<bean
class="org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor" />
<!-- For making a web service -->
<bean class="org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter">
<property name="baseAddress" value="http://localhost:9876/" />
<property name="bindingType" value="http://schemas.xmlsoap.org/wsdl/soap/http" />
</bean>
<!-- For database -->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@192.168.0.26:1521:orcl" />
<property name="username" value="deepblue" />
<property name="password" value="deepblue" />
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.simple.SimpleJdbcTemplate">
<constructor-arg ref="dataSource" />
</bean>
這是我如何標註我的web服務類
@Component
@WebService(serviceName = "PostAMove")
@SOAPBinding(parameterStyle = ParameterStyle.WRAPPED)
public class PostAMoveService {
我瘋了這個frakkakata的東西!請幫忙!
編輯:這也是一個Maven項目>捂臉<
這裏是我的Maven倉庫聲明。
<repositories>
<!-- Repository for javax.* libraries -->
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
</repository>
<repository>
<id>mesir-repo</id>
<name>Repository hosting the oracle ojdbc14.jar</name>
<url>http://mesir.googlecode.com/svn/trunk/mavenrepo</url>
</repository>
<!-- Repository for hibernate libraries -->
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<!-- What is this ?! : -->
<!-- <repository> <id>java.net.glassfish</id> <name>Repository hosting
the jee6 artifacts</name> <url>http://download.java.net/maven/glassfish</url>
</repository> -->
</repositories>
這裏是我的Maven依賴聲明。
<dependencies>
<!-- Javax libraries -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.sql</groupId>
<artifactId>jdbc-stdext</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<!-- <scope>provided</scope> -->
</dependency>
<!-- Mysql back-end support -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
<!-- JUnit testing support -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<!-- <version>3.8.1</version> -->
<version>4.7</version>
<scope>test</scope>
</dependency>
<!-- Logging support -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<!-- Spring Framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework.version}</version>
<!-- <type>jar</type> <scope>compile</scope> -->
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<scope>runtime</scope>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<!-- <scope>runtime</scope> -->
<!-- <type>jar</type> <scope>compile</scope> -->
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${org.springframework.version}</version>
<!-- <scope>test</scope> -->
<!-- <type>jar</type> <scope>compile</scope> -->
</dependency>
<!-- Miscellaneous -->
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.10</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.5</version>
</dependency>
<!-- For Web Services -->
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>1.5.8</version>
</dependency>
相當肯定,他們中的一些是無關的,但不應該打破它的權利?
沒有WEB-INF/lib目錄。另外我正在將我的.WAR部署到server/default/deploy。這是正確的嗎? –
你不能使用spring而不使用WEB-INF/lib。是的,這是戰爭的適當位置,但在戰爭中,您必須擁有WEB-INF/lib – Bozho
我沒有在任何地方看到lib文件夾。這是一個Maven項目,是否會導致它動態創建? –