You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mick Knutson <mi...@gmail.com> on 2008/05/08 02:00:32 UTC

[m2] Issue with asm Dependancy and cxf

I keep getting the following errors:
*Caused by: java.lang.NoSuchMethodError:
org.objectweb.asm.ClassVisitor.visit(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
*
*    at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:63)*

The standard fix talks about cgi-full already having the asm classes in it.
This means I need to exclude asm in my build I assume.
So I have:
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-full</artifactId>
            <version>2.0.2</version>
            *<exclusions>
                <exclusion>
                    <groupId>asm</groupId>
                    <artifactId>asm</artifactId>
                </exclusion>
            </exclusions>*
        </dependency>

But I still get asm 1.5.3, 2.2.1 and 2.2.3 downloaded.

Now when I look at my REPO and try to see what depends upon asm, I find that
hibernate needs 1.5.3, and cobertura needs 2.2.1, and spring-2.5.2 needs
2.2.3

So should I just add excludes for asm on hibernate and cobertura?


-- 
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---

Re: [m2] Issue with asm Dependancy and cxf

Posted by Mick Knutson <mi...@gmail.com>.
I did that.

*Here is the plugin:*
        *<dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>${hibernate.version}</version>
            <scope>compile</scope>
            <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>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>2.1_3</version>
        </dependency>


*Here is the error now*


<![CDATA[org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
*'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0'
defined in class path resource [applicationContext-jpa.xml]: Initialization
of bean failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'entityManagerFactory' defined in class path resource
[applicationContext-jpa.xml]: Invocation of init method failed; nested
exception is java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
    at java.security.AccessController.doPrivileged(Native Method)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375)
    at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
    at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
    at
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
    at
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:597)
    at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:366)
    at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:96)
    at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:44)
    at
org.springframework.test.context.TestContext.buildApplicationContext(TestContext.java:198)
    at
org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:233)
    at
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:126)
    at
org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:85)
    at
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:277)
    at
org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance(AbstractTestNGSpringContextTests.java:117)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
    at
org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
    at
org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
    at org.testng.TestRunner.runWorkers(TestRunner.java:689)
    at org.testng.TestRunner.privateRun(TestRunner.java:566)
    at org.testng.TestRunner.run(TestRunner.java:466)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
    at org.testng.SuiteRunner.run(SuiteRunner.java:191)
    at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
    at org.testng.TestNG.run(TestNG.java:701)
    at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
    at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
    at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
    at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'entityManagerFactory' defined in class path
resource [applicationContext-jpa.xml]: Invocation of init method failed;
nested exception is java.lang.NoClassDefFoundError:
org/objectweb/asm/CodeVisitor
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1302)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:463)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
    at java.security.AccessController.doPrivileged(Native Method)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375)
    at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
    at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:184)
    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
    at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:309)
    at
org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:270)
    at
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:122)
    at
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.&lt;init&gt;(PersistenceExceptionTranslationInterceptor.java:78)
    at
org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.&lt;init&gt;(PersistenceExceptionTranslationAdvisor.java:70)
    at
org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:97)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1290)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:463)
    ... 48 more
Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
    at
net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:165)
    at
net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
    at
net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
    at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
    at net.sf.cglib.proxy.Enhancer.&lt;clinit&gt;(Enhancer.java:69)
    at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)
    at
org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
    at
org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
    at
org.hibernate.tuple.entity.AbstractEntityTuplizer.&lt;init&gt;(AbstractEntityTuplizer.java:135)
    at
org.hibernate.tuple.entity.PojoEntityTuplizer.&lt;init&gt;(PojoEntityTuplizer.java:55)
    at
org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.&lt;init&gt;(EntityEntityModeToTuplizerMapping.java:56)
    at
org.hibernate.tuple.entity.EntityMetamodel.&lt;init&gt;(EntityMetamodel.java:302)
    at
org.hibernate.persister.entity.AbstractEntityPersister.&lt;init&gt;(AbstractEntityPersister.java:434)
    at
org.hibernate.persister.entity.SingleTableEntityPersister.&lt;init&gt;(SingleTableEntityPersister.java:109)
    at
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
    at
org.hibernate.impl.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:226)
    at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
    at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
    at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
    at
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
    at
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:227)
    at
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:281)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1333)
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1299)
    ... 65 more
Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.CodeVisitor
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    ... 92 more
]]>
*



On Wed, May 7, 2008 at 5:41 PM, Daniel Kulp <dk...@apache.org> wrote:

>
>
> The fix for this normally is to exclude both asm and cglib from the
> hibernate dependency and then add cglib-nodeps as a dependency to your
> project.   Thus, hibernate will use the cglib-nodeps stuff which includes
> the masked version it requires.
>
> The cobertura and spring deps are fine.   CXF will work with any 2.x or
> 3.x
> version of asm so pulling that in is fine.
>
> Dan Kulp
>
>
>
>
> Mick Knutson-4 wrote:
> >
> > I keep getting the following errors:
> > *Caused by: java.lang.NoSuchMethodError:
> >
> org.objectweb.asm.ClassVisitor.visit(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
> > *
> > *    at
> net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:63)*
> >
> > The standard fix talks about cgi-full already having the asm classes in
> > it.
> > This means I need to exclude asm in my build I assume.
> > So I have:
> >         <dependency>
> >             <groupId>cglib</groupId>
> >             <artifactId>cglib-full</artifactId>
> >             <version>2.0.2</version>
> >             *<exclusions>
> >                 <exclusion>
> >                     <groupId>asm</groupId>
> >                     <artifactId>asm</artifactId>
> >                 </exclusion>
> >             </exclusions>*
> >         </dependency>
> >
> > But I still get asm 1.5.3, 2.2.1 and 2.2.3 downloaded.
> >
> > Now when I look at my REPO and try to see what depends upon asm, I find
> > that
> > hibernate needs 1.5.3, and cobertura needs 2.2.1, and spring-2.5.2 needs
> > 2.2.3
> >
> > So should I just add excludes for asm on hibernate and cobertura?
> >
> >
> > --
> > Thanks,
> > Mick Knutson
> >
> > http://www.baselogic.com
> > http://www.blincmagazine.com
> > http://www.linkedin.com/in/mickknutson
> > http://www.djmick.com
> > http://www.myspace.com/mickknutson
> > http://www.myspace.com/BLiNCMagazine
> > http://tahoe.baselogic.com
> > ---
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-m2--Issue-with-asm-Dependancy-and-cxf-tp17117334p17117618.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---

Re: [m2] Issue with asm Dependancy and cxf

Posted by Daniel Kulp <dk...@apache.org>.

The fix for this normally is to exclude both asm and cglib from the
hibernate dependency and then add cglib-nodeps as a dependency to your
project.   Thus, hibernate will use the cglib-nodeps stuff which includes
the masked version it requires.

The cobertura and spring deps are fine.   CXF will work with any 2.x or 3.x
version of asm so pulling that in is fine.  

Dan Kulp




Mick Knutson-4 wrote:
> 
> I keep getting the following errors:
> *Caused by: java.lang.NoSuchMethodError:
> org.objectweb.asm.ClassVisitor.visit(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
> *
> *    at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:63)*
> 
> The standard fix talks about cgi-full already having the asm classes in
> it.
> This means I need to exclude asm in my build I assume.
> So I have:
>         <dependency>
>             <groupId>cglib</groupId>
>             <artifactId>cglib-full</artifactId>
>             <version>2.0.2</version>
>             *<exclusions>
>                 <exclusion>
>                     <groupId>asm</groupId>
>                     <artifactId>asm</artifactId>
>                 </exclusion>
>             </exclusions>*
>         </dependency>
> 
> But I still get asm 1.5.3, 2.2.1 and 2.2.3 downloaded.
> 
> Now when I look at my REPO and try to see what depends upon asm, I find
> that
> hibernate needs 1.5.3, and cobertura needs 2.2.1, and spring-2.5.2 needs
> 2.2.3
> 
> So should I just add excludes for asm on hibernate and cobertura?
> 
> 
> -- 
> Thanks,
> Mick Knutson
> 
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.linkedin.com/in/mickknutson
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/BLiNCMagazine
> http://tahoe.baselogic.com
> ---
> 
> 

-- 
View this message in context: http://www.nabble.com/-m2--Issue-with-asm-Dependancy-and-cxf-tp17117334p17117618.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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