cancel
Showing results for 
Search instead for 
Did you mean: 

problems running unit tests created for Design project

georgeflorentin
Champ in-the-making
Champ in-the-making
I've downloaded Activiti 5.1 and installed the Eclipse Activiti Designer plugin into Eclipse Helios. I created a simple diagram and created a unit test. When trying to run the unit test using JUnit 4.1 I get the stack trace below. In the JUnit logging window I see this message:

SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.

In response to another post on this forum, I tried explicitly adding a dependency in my POM file for slf4j:
<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-jdk14</artifactId>
   <version>1.5.6</version>
   </dependency>

Then mvn eclipse:clean and mvn eclipse:eclipse but this had no affect.

I *think* I've got some version mismatch on slf4j jars but don't know for sure.

Any ideas?
——-


java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
   at net.sf.cglib.core.DebuggingClassWriter.<init>(DebuggingClassWriter.java:47)
   at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30)
   at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24)
   at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
   at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144)
   at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116)
   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.<clinit>(Enhancer.java:69)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:191)
   at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:91)
   at org.apache.ibatis.io.Resources.classForName(Resources.java:229)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.safeCglibCheck(XMLConfigBuilder.java:171)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.settingsElement(XMLConfigBuilder.java:159)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:66)
   at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:55)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:389)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:244)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:221)
   at org.activiti.engine.impl.test.TestHelper.getProcessEngine(TestHelper.java:211)
   at org.activiti.engine.test.ActivitiRule.initializeProcessEngine(ActivitiRule.java:104)
   at org.activiti.engine.test.ActivitiRule.starting(ActivitiRule.java:96)
   at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:46)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Looks like a version mismatch between the asm we use and the asm that cglib expects. What version of cglib do you see in the dependency-tree (mvn dependency:tree).

Moving this thread to the Activiti Designer-forum.

Cheers

trademak
Star Contributor
Star Contributor
Hi,

Did you create a new Activiti project in the Designer?
You also executed the mvn eclipse:eclipse command on the project?
Did you change the generated pom.xml?

I haven't experienced any problems with slf4j therefore all these questions.

Best regards,

georgeflorentin
Champ in-the-making
Champ in-the-making
Guys, thx for the quick reply.  I solved the problem. I went back and created a new simple diagram and generated the unit test class. When I run this as a Junit through Eclipse, I get an error about a missing class related to registering a Spring bean (org/springframework/beans/factory/support/BeanDefinitionRegistry) . Previously, to solve that problem I had included all the libraries from activiti-5.1\setup\files\dependencies\libs and I picked up an inappropriate version of an slf4j jar file.

I added the same jars as are referenced in the activiti-engine-examples project and the unit test finds all its jars and runs to completion.

Perhaps there's a maven step I previously missed that would have solved the initial problem with not finding the springframework jar? I'll reread doc and see if this was all user error Smiley Happy