mvn test failing

100 views
Skip to first unread message

danbaatar

unread,
Apr 27, 2011, 3:40:19 PM4/27/11
to Protocol Buffers
I am trying to compile version 2.3.0 (for compatibility with protoc
installed by system packages under Ubuntu 10.10), and when I try to
run 'mvn package', it fails with 2 errors in the ServiceTest. I will
paste the contents of the appropriate test log at the end of my
message.

Any help would be appreciated.

Thanks.

-------------------------------------------------------------------------------
Test set: com.google.protobuf.ServiceTest
-------------------------------------------------------------------------------
Tests run: 7, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.107
sec <<< FAILURE!
testCallMethod(com.google.protobuf.ServiceTest) Time elapsed: 0.036
sec <<< ERROR!
java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer
at
org.easymock.classextension.internal.MocksClassControl.createProxyFactory(MocksClassControl.java:
35)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:
36)
at com.google.protobuf.ServiceTest.testCallMethod(ServiceTest.java:
83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:
81)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:
62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:
140)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:
127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:
345)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:
1009)
Caused by: java.lang.ClassNotFoundException:
net.sf.cglib.proxy.Enhancer
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 26 more

testGetPrototype(com.google.protobuf.ServiceTest) Time elapsed: 0.001
sec <<< ERROR!
java.lang.NoClassDefFoundError: net/sf/cglib/proxy/Enhancer
at
org.easymock.classextension.internal.MocksClassControl.createProxyFactory(MocksClassControl.java:
35)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:
36)
at com.google.protobuf.ServiceTest.testGetPrototype(ServiceTest.java:
100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:
81)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:
62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:
140)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:
127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:
345)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:
1009)
Caused by: java.lang.ClassNotFoundException:
net.sf.cglib.proxy.Enhancer
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 26 more

Pherl Liu

unread,
Apr 28, 2011, 12:41:50 AM4/28/11
to danbaatar, Protocol Buffers
Looks like a classpath problem for the easy mock..  Could you please double check if net.sf.cglib.proxy.Enhancer is installed and set in the classpath of your environment?


--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.


danbaatar

unread,
Apr 28, 2011, 3:40:43 PM4/28/11
to Protocol Buffers
Thanks for the help. Your comment got me to look into the classpath
issue a little more.

I think I might know what the problem is. For some reason, my
University's network filter refused to download the easy mock library,
and so I had to download the jar file manually. I tried to install it
with this command:
mvn install:install-file -DgroupId=org.easymock -DartifactId=easymock -
Dpackaging=jar -Dversion=2.2 -Dfile=easymockclassextension-2.2.1.jar -
DgeneratePom=true -Dscope=test

but I don't think that is working. I still get ClassNotFound
exceptions, though the class appears to be different. Now it can't
find org/easymock/IArgumentMatcher.

Is it a problem that I have the easymock 2.2.1 jar and the version
specified in the pom is 2.2? Maybe just need to go and learn some
more about maven

--dan
> > org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Surefire Booter.java:
> > org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Surefire Booter.java:
Reply all
Reply to author
Forward
0 new messages