2
votes

I always try to use the latest jars/apis in my Spring project. We had a Spring 4.2.4.RELEASE and then I upgraded to 4.3.0. Everything builds and compiles just fine ... however, when I try to run my unit tests, I was getting an error message. I did trace it down to Spring-WS-Core and Spring-WS-Core-Test 2.3.0 pulls in: Spring-core, web, webmvc, beans 4.0.9.

Has anyone else seen this before? Do I have to go back to Spring 4.2?

Thanks!

1
Can you post your error message?bpachev
There were multiple issues, but they all stemmed from the unit tests. I could build/compile my app to a JAR, but when I run unit tests, the Application Context xml file refused to load correctly. One of the first issues in org.springframework.beans was that EventListenerFactory was not found. I know from looking at this that that was implemented in Spring 4.1, so if spring-beans 4.0.9 was loaded, then that class correctly would not have been found. Once I started to add exclusions to spring-ws-core and spring-ws-test, then the errors started to go away.tjholmes66

1 Answers

2
votes

I downgraded my app to 4.2.7.RELEASE which was the latest before Spring 4.3.0, and this did not help. Ultimately, I had to update my maven dependencies as follows:

    <!-- Spring SOAP Client Dependencies -->
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-core</artifactId>
        <version>${spring.ws.core.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-expression</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- Spring SOAP Client TEST Dependencies -->
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-ws-test</artifactId>
        <version>${spring.ws.core.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-expression</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Why Spring Web-Services (for SOAP web-services) still uses Spring 4.0.9 and has not been updated yet to use Spring 4.2.x or 4.3.0 is beyond me. That seems like an oversight.

The symptoms of this problem is that I was getting ClassDefNotFound errors in various spring.framework packages. I think I have this problem resolved.