Transformation failed after moving to compilation -target 1.7
sannegrinovero Mar 25, 2014 8:10 PMHi all,
I'm in the process of moving the build of Hibernate Search to Java7. After changing the compilation settings to output classes in the Java 7 format, some of our unit tests using Byteman fail.
It's very easy to reproduce, just checkout my branch BytemanErrorJava7 from Sanne/hibernate-search · GitHub and run "mvn install".
Or from an IDE, just run the JUnit test org.hibernate.search.test.configuration.integration.HibernateSearchSessionFactoryObserverTest , from the orm module, which uses @BMRules.
This is the relevant output:
byteman jar is /home/sanne/.m2/repository/org/jboss/byteman/byteman/2.1.4/byteman-2.1.4.jar 23:44:17,724 (main) WARN DriverManagerConnectionProviderImpl:93 - HHH000402: Using Hibernate built-in connection pool (not for production use!) org.jboss.byteman.agent.Transformer : Saving transformed bytes to ./org/hibernate/internal/SessionFactoryImpl.class 23:44:18,135 (main) INFO Version:43 - HSEARCH000034: Hibernate Search [WORKING] org.jboss.byteman.agent.Transformer : Saving transformed bytes to ./org/hibernate/search/spi/SearchFactoryBuilder.class Exception in thread "Thread-0" java.lang.InternalError at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method) at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:144) at org.jboss.byteman.agent.Retransformer.removeScripts(Retransformer.java:292) at org.jboss.byteman.agent.TransformListener.handleScripts(TransformListener.java:335) at org.jboss.byteman.agent.TransformListener.deleteScripts(TransformListener.java:290) at org.jboss.byteman.agent.TransformListener.handleConnection(TransformListener.java:215) at org.jboss.byteman.agent.TransformListener.run(TransformListener.java:146)
I believe the problem might be the fact that ASM v.3 doesn't support Java7 classes?
I've tried to upgrade Byteman to use ASM 5.0.1.
Since I'm not familiar with the internals of Byteman I was hoping that maybe it would just work; I had to apply a couple of API adjustments and got it to compile, but I wasn't lucky as it fails the Byteman testsuite. I didn't find and ASM update guide, and it's all looking a bit intimidating to figure out on my own .
In case it's interesting my (broken) patch for Byteman to upgrade ASM is on Github too: branch Java7 of Sanne/byteman · GitHub .
I'm attaching the .class file mentioned at line 05 of the above log.
-
SearchFactoryBuilder.class 27.8 KB