<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: ASM version incompatibilities, using Spring @Autowired with Hibernate</title>
	<atom:link href="http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/</link>
	<description>The voice of SpringSource</description>
	<pubDate>Sun, 12 Oct 2008 08:48:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Josh Mahowald</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-75705</link>
		<dc:creator>Josh Mahowald</dc:creator>
		<pubDate>Tue, 04 Dec 2007 21:03:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-75705</guid>
		<description>Just a FYI

Unfortunately, solution 3 won't work for me, and my guess would be most people, if you are using dynamic languages, as GroovyScriptFactory uses the GroovyClassLoader, which comes in a different jar (groovy jar of course), which still uses the old org.objectweb.asm pagkage, rather than the new spring org.springframework.asm package</description>
		<content:encoded><![CDATA[<p>Just a FYI</p>
<p>Unfortunately, solution 3 won&#039;t work for me, and my guess would be most people, if you are using dynamic languages, as GroovyScriptFactory uses the GroovyClassLoader, which comes in a different jar (groovy jar of course), which still uses the old org.objectweb.asm pagkage, rather than the new spring org.springframework.asm package</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-57558</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 25 Oct 2007 10:40:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-57558</guid>
		<description>Hmm, you can not post XML here. Here is my XML code from the end of the posting:

[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]cglib[/groupId]
  [artifactId]cglib-nodep[/artifactId]
  [version]2.1_3[/version]
[/dependency]
[dependency]</description>
		<content:encoded><![CDATA[<p>Hmm, you can not post XML here. Here is my XML code from the end of the posting:</p>
<p>[dependency]<br />
  [groupId]org.hibernate[/groupId]<br />
  [artifactId]hibernate[/artifactId]<br />
  [version][3.2.2.ga][/version]<br />
  [exclusions]<br />
    [exclusion]<br />
      [groupId]asm[/groupId]<br />
      [artifactId]asm[/artifactId]<br />
    [/exclusion]<br />
    [exclusion]<br />
      [groupId]asm[/groupId]<br />
      [artifactId]asm-attrs[/artifactId]<br />
    [/exclusion]<br />
    [exclusion]<br />
      [groupId]cglib[/groupId]<br />
      [artifactId]cglib[/artifactId]<br />
    [/exclusion]<br />
  [/exclusions]<br />
[/dependency]<br />
[dependency]<br />
  [groupId]cglib[/groupId]<br />
  [artifactId]cglib-nodep[/artifactId]<br />
  [version]2.1_3[/version]<br />
[/dependency]<br />
[dependency]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-57557</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 25 Oct 2007 10:38:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-57557</guid>
		<description>I tried solution No 1 but cglib (which is used by hibernate) uses old classes and methods from asm which are not present in asm-2.2.3. So i got an java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor from hibernate initialisation.

I solved this by using cglib-nodep-2.1_3 from maven repository, instead of cglib from the hibernate dependencies, see: http://mvnrepository.com/artifact/cglib/cglib-nodep/2.1_3


 org.hibernate
 hibernate
 [3.2.2.ga]
 
   
     asm
     asm
   
   
     asm
     asm-attrs
   
   
     cglib
     cglib
   
 


  cglib
  cglib-nodep
  2.1_3


cglib-nodep contains asm classes but they are in different packages as in the asm jars.</description>
		<content:encoded><![CDATA[<p>I tried solution No 1 but cglib (which is used by hibernate) uses old classes and methods from asm which are not present in asm-2.2.3. So i got an java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor from hibernate initialisation.</p>
<p>I solved this by using cglib-nodep-2.1_3 from maven repository, instead of cglib from the hibernate dependencies, see: <a href="http://mvnrepository.com/artifact/cglib/cglib-nodep/2.1_3" rel="nofollow">http://mvnrepository.com/artifact/cglib/cglib-nodep/2.1_3</a></p>
<p> org.hibernate<br />
 hibernate<br />
 [3.2.2.ga]</p>
<p>     asm<br />
     asm</p>
<p>     asm<br />
     asm-attrs</p>
<p>     cglib<br />
     cglib</p>
<p>  cglib<br />
  cglib-nodep<br />
  2.1_3</p>
<p>cglib-nodep contains asm classes but they are in different packages as in the asm jars.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: softengg</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-28436</link>
		<dc:creator>softengg</dc:creator>
		<pubDate>Wed, 20 Jun 2007 10:09:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-28436</guid>
		<description>Hi, i have tried soln # 1 but it does not resolve my problem. My detailed problem is here on spring forum http://forum.springframework.org/showthread.php?p=127012#poststop and someone from there refereed me here. Any help would be great!

On difference is that I had to include dependency on javaassist as I was getting error that its not inclasspath. After adding it get the exception (details on above URL, summary is here). Here are first few lines from the exception stack trace. 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [META-INF/applicationContext-jpaCommon.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javassist.bytecode.ClassFile.getName()Ljava/lang/String;
Caused by: java.lang.NoSuchMethodError: javassist.bytecode.ClassFile.getName()Ljava/lang/String;
	at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:652)
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:350)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)</description>
		<content:encoded><![CDATA[<p>Hi, i have tried soln # 1 but it does not resolve my problem. My detailed problem is here on spring forum <a href="http://forum.springframework.org/showthread.php?p=127012#poststop" rel="nofollow">http://forum.springframework.org/showthread.php?p=127012#poststop</a> and someone from there refereed me here. Any help would be great!</p>
<p>On difference is that I had to include dependency on javaassist as I was getting error that its not inclasspath. After adding it get the exception (details on above URL, summary is here). Here are first few lines from the exception stack trace.<br />
org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#039;entityManagerFactory&#039; defined in class path resource [META-INF/applicationContext-jpaCommon.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javassist.bytecode.ClassFile.getName()Ljava/lang/String;<br />
Caused by: java.lang.NoSuchMethodError: javassist.bytecode.ClassFile.getName()Ljava/lang/String;<br />
	at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:652)<br />
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:350)<br />
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)<br />
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218)<br />
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: softengg</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-28434</link>
		<dc:creator>softengg</dc:creator>
		<pubDate>Wed, 20 Jun 2007 09:53:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-28434</guid>
		<description>Hi, 
I am having problems running a very basic JUnit test case via Maven2. The application uses spring-framework-2.1-m1 release, and test case extends from org.springframework.test.jpa.AbstractJpaTests, uses org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean as entityManagerFactory, and uses
org.springframework.orm.jpa.vendor.HibernateJpaVen dorAdapter as jpaVendorAdapter propery for entityManagerFactory. Complete issue is here http://forum.springframework.org/showthread.php?p=127012#poststop. I have tried your outlined solution, but the exception is same. Any help would be great!

Below are few lines from stack trace, 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [META-INF/applicationContext-jpaCommon.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javassist.bytecode.ClassFile.getName()Ljava/lang/String;
Caused by: java.lang.NoSuchMethodError: javassist.bytecode.ClassFile.getName()Ljava/lang/String;
	at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:652)
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:350)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am having problems running a very basic JUnit test case via Maven2. The application uses spring-framework-2.1-m1 release, and test case extends from org.springframework.test.jpa.AbstractJpaTests, uses org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean as entityManagerFactory, and uses<br />
org.springframework.orm.jpa.vendor.HibernateJpaVen dorAdapter as jpaVendorAdapter propery for entityManagerFactory. Complete issue is here <a href="http://forum.springframework.org/showthread.php?p=127012#poststop" rel="nofollow">http://forum.springframework.org/showthread.php?p=127012#poststop</a>. I have tried your outlined solution, but the exception is same. Any help would be great!</p>
<p>Below are few lines from stack trace,<br />
org.springframework.beans.factory.BeanCreationException: Error creating bean with name &#039;entityManagerFactory&#039; defined in class path resource [META-INF/applicationContext-jpaCommon.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javassist.bytecode.ClassFile.getName()Ljava/lang/String;<br />
Caused by: java.lang.NoSuchMethodError: javassist.bytecode.ClassFile.getName()Ljava/lang/String;<br />
	at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:652)<br />
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:350)<br />
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)<br />
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218)<br />
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)<br />
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toby&#8217;s Epril :: Entries :: Toby์? ๋ฏธํฌ๋?ฐ์?ด - 2007๋ 6์ 12์?ผ</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26872</link>
		<dc:creator>Toby&#8217;s Epril :: Entries :: Toby์? ๋ฏธํฌ๋?ฐ์?ด - 2007๋ 6์ 12์?ผ</dc:creator>
		<pubDate>Tue, 12 Jun 2007 19:31:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26872</guid>
		<description>[...] ์ข์ข ๋๋ฅผ ๊ณจ์น์ํ๊ฒ ํ๋ ์?์กด์ฑ ์คํ๊ฒํฐ ์ค์  8์ 16๋ถ [...]</description>
		<content:encoded><![CDATA[<p>[...] ์ข์ข ๋๋ฅผ ๊ณจ์น์ํ๊ฒ ํ๋ ์?์กด์ฑ ์คํ๊ฒํฐ ์ค์  8์ 16๋ถ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Sampaleanu</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26725</link>
		<dc:creator>Colin Sampaleanu</dc:creator>
		<pubDate>Mon, 11 Jun 2007 22:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26725</guid>
		<description>I was talking to Eugene Kuleshov (one of the ASM committers) about this, and he said that basically it's a given that ASM has to change on a regular basis to support new JDK features, so the expectation is in fact that you will basically fork a specific version into your package structure, ala cglib_nodep...

So this basically means that the idea of versioning ASM in a simple fashion with Maven, where 3.0 can replace 2.0, is completely unrealistic. It also means 2.0 and 3.0 can not live side by side. Realistically, unless you assume no other app/lib than yours will ever use ASM, it means you have to fork it into your own app/lib.

I don't really think this is a great strategy. I think it would have been realistic to change the base asm package each time it changed in an incompatible fashion. So we'd be up to ASM 33 by now, but so what?</description>
		<content:encoded><![CDATA[<p>I was talking to Eugene Kuleshov (one of the ASM committers) about this, and he said that basically it&#039;s a given that ASM has to change on a regular basis to support new JDK features, so the expectation is in fact that you will basically fork a specific version into your package structure, ala cglib_nodep&#8230;</p>
<p>So this basically means that the idea of versioning ASM in a simple fashion with Maven, where 3.0 can replace 2.0, is completely unrealistic. It also means 2.0 and 3.0 can not live side by side. Realistically, unless you assume no other app/lib than yours will ever use ASM, it means you have to fork it into your own app/lib.</p>
<p>I don&#039;t really think this is a great strategy. I think it would have been realistic to change the base asm package each time it changed in an incompatible fashion. So we&#039;d be up to ASM 33 by now, but so what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Lee</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26689</link>
		<dc:creator>Bob Lee</dc:creator>
		<pubDate>Mon, 11 Jun 2007 16:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26689</guid>
		<description>Guice gets around this by using jarjar to repackage ASM inside of our jar at build time. That does suck that ASM broke backward compatibility like that. Why not create a new package named "asm2"?</description>
		<content:encoded><![CDATA[<p>Guice gets around this by using jarjar to repackage ASM inside of our jar at build time. That does suck that ASM broke backward compatibility like that. Why not create a new package named &#034;asm2&#034;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tetsuo</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26687</link>
		<dc:creator>Tetsuo</dc:creator>
		<pubDate>Mon, 11 Jun 2007 16:06:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26687</guid>
		<description>For what I've seen in other projects, they usually create a fork with the specific version of ASM they use, and add it to their own codebase, probably to avoid this instability of the API. Why don't you do the same?</description>
		<content:encoded><![CDATA[<p>For what I&#039;ve seen in other projects, they usually create a fork with the specific version of ASM they use, and add it to their own codebase, probably to avoid this instability of the API. Why don&#039;t you do the same?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Corby Page</title>
		<link>http://blog.springsource.com/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26673</link>
		<dc:creator>Corby Page</dc:creator>
		<pubDate>Mon, 11 Jun 2007 14:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/#comment-26673</guid>
		<description>Thanks for doing a prominent write-up on this. This issue has existed for a couple of years with the AOP stuff, and is always challenging for people who are hitting it for the first time.</description>
		<content:encoded><![CDATA[<p>Thanks for doing a prominent write-up on this. This issue has existed for a couple of years with the AOP stuff, and is always challenging for people who are hitting it for the first time.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
