JBoss 6 + Spring 3事务管理器加载错误

时间:2011-09-14 19:24:10

标签: java spring maven jboss

我有一个Spring WS项目,我试图在JBoss 6服务器上托管。它简单地工作,然后开始失败。我之间唯一的变化是在C:\ jboss-6.1.0.Final \ server \ default \ deploy \ ROOT.war文件夹中添加了一些HTML文件。突然间,我的服务器不再能够开始给我这个堆栈跟踪:

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>

这是我的spring 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>

这就是我如何注释我的webservice类

@Component
@WebService(serviceName = "PostAMove")
@SOAPBinding(parameterStyle = ParameterStyle.WRAPPED)
public class PostAMoveService {

我对这个frakkakata事情发疯了!请帮忙!

编辑:这也是一个Maven项目&gt; facepalm&lt;

以下是我的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>

相当肯定他们中的一些是无关紧要的,但那不应该打破它吗?

1 个答案:

答案 0 :(得分:0)

确保jta.jar中没有WEB-INF/lib(或类似名称) - 它应该由JBoss提供。