projoy / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

ASM and CGLIB conflicts when used with Hibernate #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Maven2 project with Hibernate
2. Open in Eclipse (maybe other IDE's too)

What is the expected output? What do you see instead?

When running TestNG tests from Eclipse (using the plugin), received missing
class errors from cglib and asm calls.

What version of the product are you using? On what operating system?

1.1 + 1.2

Please provide any additional information below.

I think the error is just a conflict with the old (1.5.3) version of asm
pulled in by Hibernate. I solved this by excluding the Hibernate
dependencies and adding them explicitly, and then using the
mockito-core.jar (added to a local maven repository).

Note: I may have the wrong ASM/CGLIB version below, but it seems to be
working at the moment.

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate</artifactId>
    <version>3.2.2.ga</version>
    <exclusions>
        <exclusion>
            <groupId>asm</groupId>
            <artifactId>asm</artifactId>
        </exclusion>
        <exclusion>
            <groupId>asm</groupId>
            <artifactId>asm-attrs</artifactId>
        </exclusion>
        <exclusion>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>asm</groupId>
    <artifactId>asm</artifactId>
    <version>2.2.3</version>
</dependency>
<dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib-nodep</artifactId>
    <version>2.1_3</version>
</dependency>

Original issue reported on code.google.com by joe.tre...@gmail.com on 11 Mar 2008 at 10:36

GoogleCodeExporter commented 9 years ago
mockito-core would solve the problem, but we cannot release it to Maven Central
Repository, because of missing dependency of cglib 2.2beta1 .

Original comment by iczechowski@gmail.com on 13 Mar 2008 at 10:48

GoogleCodeExporter commented 9 years ago
Igor, can we downgrade to stable cglib (probably something like: 1.x)?

Original comment by szcze...@gmail.com on 14 Mar 2008 at 1:40

GoogleCodeExporter commented 9 years ago
I'll take a look at it.

Original comment by iczechowski@gmail.com on 14 Mar 2008 at 2:00

GoogleCodeExporter commented 9 years ago

Original comment by iczechowski@gmail.com on 14 Mar 2008 at 2:01

GoogleCodeExporter commented 9 years ago
I've made a request to upload 1.3 core and all package to Maven Central 
repository.
The upload of mockito-core should resolve the issue.
You can track upload process at http://jira.codehaus.org/browse/MAVENUPLOAD-2036

Original comment by iczechowski@gmail.com on 28 Apr 2008 at 6:51

GoogleCodeExporter commented 9 years ago
mockit-all and mockito-core for version 1.3 has been uploaded.
Enjoy.

Original comment by iczechowski@gmail.com on 30 Apr 2008 at 9:10

GoogleCodeExporter commented 9 years ago

Original comment by szcze...@gmail.com on 19 Apr 2009 at 7:40