You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Vincenzo Vitale <vi...@gmail.com> on 2007/09/12 16:04:59 UTC

Hibernate and cxf 2.01 problem.

Hi,

in my project I use Hibernate 3.2.4.sp1 and with cxf 2.0.1-incubator I get
the exception:

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'sessionFactory' defined in class path resource [
oasis-db-context.xml]: Invocation of init method failed; nested exception is
java.lang.NoClassDefFoundError
Caused by:
java.lang.NoClassDefFoundError
    at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(
CGLIBLazyInitializer.java :117)

when the server starts.

Here I have red it could be for the asm library but also excluding it in the
pom file the problem persist.

I solved it just using cxf 2.0-incubator but maybe there is another solution
using the last cxf release.


Someone with the same problem?



Ciao,
V.

Re: Hibernate and cxf 2.01 problem.

Posted by Daniel Kulp <dk...@apache.org>.
Yea.   Unfortunately, there are ASM version conflicts between CXF and 
Hibernate.   For 2.0.2, we've fixed them all by allowing CXF to work 
with both 2.x and 3.x or use reflection instead of ASM if 1.5 is found.   
2.0.2 is being voted on now:

http://people.apache.org/~dkulp/stage_cxf/2.0.2-incubator-take1/

Dan


On Thursday 13 September 2007, Vincenzo Vitale wrote:
> Thanks Juan, this solved the problem with the 2.0.1-incubator version.
>
> Now my cxf dependencies are:
>
>         <!--
>             Web Services framework.
>         -->
>         <dependency>
>             <groupId>org.apache.cxf</groupId>
>             <artifactId>cxf-rt-frontend-jaxws</artifactId>
>             <version>${cxf.version}</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>asm</groupId>
>                     <artifactId>asm</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.cxf</groupId>
>             <artifactId>cxf-rt-transports-http</artifactId>
>             <version>${cxf.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.cxf</groupId>
>             <artifactId>cxf-rt-bindings-soap</artifactId>
>             <version>${cxf.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>asm</groupId>
>             <artifactId>asm-all</artifactId>
>             <version>3.0</version>
>         </dependency>
>         <dependency>
>             <groupId>cglib</groupId>
>             <artifactId>cglib-nodep</artifactId>
>             <version>2.1_3</version>
>         </dependency>
>
>
> Now Jetty starts correctly but when I try to call a service using the
> Spring+Hibernate service layer I get the exception:
>
> Sep 13, 2007 10:20:41 AM
> org.apache.cxf.phase.PhaseInterceptorChaindoIntercept INFO:
> Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault:
> org.springframework.util.ClassUtils.getMostSpe
> cificMethod(Ljava/lang/reflect/Method;Ljava/lang/Class;)Ljava/lang/ref
>lect/Metho d;
>
>
> Someone with the same problem?
>
>
>
> Thanks,
> Vicio.
>
> On 9/12/07, Juan José Vázquez Delgado <ju...@gmail.com> wrote:
> > I had to add this dependencies:
> >
> > <dependency>
> >                 <groupId>asm</groupId>
> >                 <artifactId>asm-all</artifactId>
> >                 <version>3.0</version>
> >             </dependency>
> >             <dependency>
> >                 <groupId>cglib</groupId>
> >                 <artifactId>cglib-nodep</artifactId>
> >                 <version>2.1_3</version>
> >             </dependency>
> >
> > On 9/12/07, Vincenzo Vitale <vi...@gmail.com> wrote:
> > > Hi,
> > >
> > > in my project I use Hibernate 3.2.4.sp1 and with cxf
> > > 2.0.1-incubator I
> >
> > get
> >
> > > the exception:
> > >
> > > org.springframework.beans.factory.BeanCreationException: Error
> > > creating bean
> > > with name 'sessionFactory' defined in class path resource [
> > > oasis-db-context.xml]: Invocation of init method failed; nested
> >
> > exception
> >
> > > is
> > > java.lang.NoClassDefFoundError
> > > Caused by:
> > > java.lang.NoClassDefFoundError
> > >     at
> >
> > org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory
> >
> > > (
> > > CGLIBLazyInitializer.java :117)
> > >
> > > when the server starts.
> > >
> > > Here I have red it could be for the asm library but also excluding
> > > it in the
> > > pom file the problem persist.
> > >
> > > I solved it just using cxf 2.0-incubator but maybe there is
> > > another solution
> > > using the last cxf release.
> > >
> > >
> > > Someone with the same problem?
> > >
> > >
> > >
> > > Ciao,
> > > V.



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: Hibernate and cxf 2.01 problem.

Posted by Vincenzo Vitale <vi...@gmail.com>.
Thanks Juan, this solved the problem with the 2.0.1-incubator version.

Now my cxf dependencies are:

        <!--
            Web Services framework.
        -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>asm</groupId>
                    <artifactId>asm</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-bindings-soap</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>asm</groupId>
            <artifactId>asm-all</artifactId>
            <version>3.0</version>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>2.1_3</version>
        </dependency>


Now Jetty starts correctly but when I try to call a service using the
Spring+Hibernate service layer I get the exception:

Sep 13, 2007 10:20:41 AM org.apache.cxf.phase.PhaseInterceptorChaindoIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault:
org.springframework.util.ClassUtils.getMostSpe
cificMethod(Ljava/lang/reflect/Method;Ljava/lang/Class;)Ljava/lang/reflect/Metho
d;


Someone with the same problem?



Thanks,
Vicio.



On 9/12/07, Juan José Vázquez Delgado <ju...@gmail.com> wrote:
>
> I had to add this dependencies:
>
> <dependency>
>                 <groupId>asm</groupId>
>                 <artifactId>asm-all</artifactId>
>                 <version>3.0</version>
>             </dependency>
>             <dependency>
>                 <groupId>cglib</groupId>
>                 <artifactId>cglib-nodep</artifactId>
>                 <version>2.1_3</version>
>             </dependency>
>
> On 9/12/07, Vincenzo Vitale <vi...@gmail.com> wrote:
> >
> > Hi,
> >
> > in my project I use Hibernate 3.2.4.sp1 and with cxf 2.0.1-incubator I
> get
> > the exception:
> >
> > org.springframework.beans.factory.BeanCreationException: Error creating
> > bean
> > with name 'sessionFactory' defined in class path resource [
> > oasis-db-context.xml]: Invocation of init method failed; nested
> exception
> > is
> > java.lang.NoClassDefFoundError
> > Caused by:
> > java.lang.NoClassDefFoundError
> >     at
> org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory
> > (
> > CGLIBLazyInitializer.java :117)
> >
> > when the server starts.
> >
> > Here I have red it could be for the asm library but also excluding it in
> > the
> > pom file the problem persist.
> >
> > I solved it just using cxf 2.0-incubator but maybe there is another
> > solution
> > using the last cxf release.
> >
> >
> > Someone with the same problem?
> >
> >
> >
> > Ciao,
> > V.
> >
>

Re: Hibernate and cxf 2.01 problem.

Posted by Juan José Vázquez Delgado <ju...@gmail.com>.
I had to add this dependencies:

<dependency>
                <groupId>asm</groupId>
                <artifactId>asm-all</artifactId>
                <version>3.0</version>
            </dependency>
            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib-nodep</artifactId>
                <version>2.1_3</version>
            </dependency>

On 9/12/07, Vincenzo Vitale <vi...@gmail.com> wrote:
>
> Hi,
>
> in my project I use Hibernate 3.2.4.sp1 and with cxf 2.0.1-incubator I get
> the exception:
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean
> with name 'sessionFactory' defined in class path resource [
> oasis-db-context.xml]: Invocation of init method failed; nested exception
> is
> java.lang.NoClassDefFoundError
> Caused by:
> java.lang.NoClassDefFoundError
>     at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory
> (
> CGLIBLazyInitializer.java :117)
>
> when the server starts.
>
> Here I have red it could be for the asm library but also excluding it in
> the
> pom file the problem persist.
>
> I solved it just using cxf 2.0-incubator but maybe there is another
> solution
> using the last cxf release.
>
>
> Someone with the same problem?
>
>
>
> Ciao,
> V.
>