You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Hugues Pisapia <hu...@gmail.com> on 2007/04/26 18:18:03 UTC

cobertura and hibernate?

Hi Folks,

I'm running a strange probleme here where I have a project running
hibernate/spring that I try to measure the unit test coverage with
cobertura.

- When the Unit Test are run with 'mvn test', all seems fine and the tests pass
- When I run 'mvn cobertura:cobertura' to instrument the classes , run
the tests and generate the report, not a singe test pass and I have
LazyInitialization exceptions like that:
ERROR  <init>, could not initialize proxy - the owning Session was closed
org.hibernate.LazyInitializationException: could not initialize proxy
- the owning Session was closed
        at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:60)
        at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:140)
...

I went through the post to this list and to internet and found that
the problem might be because of the asm lib 1.5.3 required by
hibernate. But adding the dependancy to the pom dopes not make it. I
also upgraded both the surefire plugin and the cobertura plugin to
respectively 2.3 and 2.0, but this did not help either.

Any clue?
Thanks !

-- 
Hugues
----------
e: hugues@labarben.org
jid: huguespisapia@im.apinc.org
Fight Multiple Sclerosis - http://odyssee-espoir.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: cobertura and hibernate?

Posted by Hugues Pisapia <hu...@labarben.org>.
Apparently, using the cobertura plugin 2.1 fixes this issue.
Funny enough is that it's still a problem on the plugin's JIRA:
http://jira.codehaus.org/browse/MCOBERTURA-54

- Hugues


2007/4/26, Hugues Pisapia <hu...@gmail.com>:
> Hi Folks,
>
> I'm running a strange probleme here where I have a project running
> hibernate/spring that I try to measure the unit test coverage with
> cobertura.
>
> - When the Unit Test are run with 'mvn test', all seems fine and the tests pass
> - When I run 'mvn cobertura:cobertura' to instrument the classes , run
> the tests and generate the report, not a singe test pass and I have
> LazyInitialization exceptions like that:
> ERROR  <init>, could not initialize proxy - the owning Session was closed
> org.hibernate.LazyInitializationException: could not initialize proxy
> - the owning Session was closed
>         at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:60)
>         at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
>         at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:140)
> ...
>
> I went through the post to this list and to internet and found that
> the problem might be because of the asm lib 1.5.3 required by
> hibernate. But adding the dependancy to the pom dopes not make it. I
> also upgraded both the surefire plugin and the cobertura plugin to
> respectively 2.3 and 2.0, but this did not help either.
>
> Any clue?
> Thanks !
>
> --
> Hugues
> ----------
> e: hugues@labarben.org
> jid: huguespisapia@im.apinc.org
> Fight Multiple Sclerosis - http://odyssee-espoir.com
>


-- 
Hugues
----------
e: hugues@labarben.org
jid: huguespisapia@im.apinc.org
Fight Multiple Sclerosis - http://odyssee-espoir.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org