Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Development Java (http://www.linux-archive.org/fedora-development-java/)
-   -   Trouble building jmock 2.5.1 (http://www.linux-archive.org/fedora-development-java/524833-trouble-building-jmock-2-5-1-a.html)

Orion Poplawski 05-11-2011 04:45 AM

Trouble building jmock 2.5.1
 
I'm looking at packaging jmock 2.5.1. Package is here:

http://www.cora.nwra.com/~orion/fedora/jmock-2.5.1-1.fc15.src.rpm

Build log:

http://www.cora.nwra.com/~orion/fedora/rpmbuild.log

Error is during the tests:

[junit] Testcase:
testCanMockTypesFromADynamicClassLoader(org.jmock. test.unit.lib.JavaReflectionImposteriserTests):
Caused an ERROR
[junit] Invalid superclass index 0 in class file $UniqueTypeName$
[junit] java.lang.ClassFormatError: Invalid superclass index 0 in
class file $UniqueTypeName$
[junit] at java.lang.ClassLoader.defineClass1(Native Method)
[junit] at java.lang.ClassLoader.defineClass(ClassLoader.java :634)
[junit] at java.lang.ClassLoader.defineClass(ClassLoader.java :480)
[junit] at
org.jmock.test.unit.support.SyntheticEmptyInterfac eClassLoader.synthesiseInterface(SyntheticEmptyInt erfaceClassLoader.java:43)
[junit] at
org.jmock.test.unit.support.SyntheticEmptyInterfac eClassLoader.findClass(SyntheticEmptyInterfaceClas sLoader.java:25)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66)
[junit] at
org.jmock.test.unit.lib.JavaReflectionImposteriser Tests.testCanMockTypesFromADynamicClassLoader(Java ReflectionImposteriserTests.java:38)

I have no idea about this. I've applied two patches. One to use
objectweb classes directly rather than from cglib, and one derived from
the 2.6.0-RC2 release to support java 1.6.

Any help would be appreciated.

--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion@cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Alexander Kurtakov 05-11-2011 05:52 AM

Trouble building jmock 2.5.1
 
On 08:49:36 AM Wednesday, May 11, 2011 Orion Poplawski wrote:
> I'm looking at packaging jmock 2.5.1. Package is here:
>
> http://www.cora.nwra.com/~orion/fedora/jmock-2.5.1-1.fc15.src.rpm
>
> Build log:
>
> http://www.cora.nwra.com/~orion/fedora/rpmbuild.log
>
> Error is during the tests:
>
> [junit] Testcase:
> testCanMockTypesFromADynamicClassLoader(org.jmock. test.unit.lib.JavaReflect
> ionImposteriserTests): Caused an ERROR
> [junit] Invalid superclass index 0 in class file $UniqueTypeName$
> [junit] java.lang.ClassFormatError: Invalid superclass index 0 in
> class file $UniqueTypeName$
> [junit] at java.lang.ClassLoader.defineClass1(Native Method)
> [junit] at java.lang.ClassLoader.defineClass(ClassLoader.java :634)
> [junit] at java.lang.ClassLoader.defineClass(ClassLoader.java :480)
> [junit] at
> org.jmock.test.unit.support.SyntheticEmptyInterfac eClassLoader.synthesiseIn
> terface(SyntheticEmptyInterfaceClassLoader.java:43 ) [junit] at
> org.jmock.test.unit.support.SyntheticEmptyInterfac eClassLoader.findClass(Sy
> ntheticEmptyInterfaceClassLoader.java:25) [junit] at
> java.lang.ClassLoader.loadClass(ClassLoader.java:3 21) [junit] at
> java.lang.ClassLoader.loadClass(ClassLoader.java:2 66) [junit] at
> org.jmock.test.unit.lib.JavaReflectionImposteriser Tests.testCanMockTypesFro
> mADynamicClassLoader(JavaReflectionImposteriserTes ts.java:38)
>
> I have no idea about this. I've applied two patches. One to use
> objectweb classes directly rather than from cglib, and one derived from
> the 2.6.0-RC2 release to support java 1.6.

It looks like the given test case doesn't support the class format used. Could
it be that your java 1.6 patch missed some test cases?
As jmock hasn't been in Fedora before I would have chosen 2.6.0-RC2 if it is
supposed to handle java 1.6 classes

Alex

>
> Any help would be appreciated.
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Guido Grazioli 05-11-2011 12:00 PM

Trouble building jmock 2.5.1
 
> On 08:49:36 AM Wednesday, May 11, 2011 Orion Poplawski wrote:
>> Error is during the tests:
>>
>> * * *[junit] Testcase:
>> testCanMockTypesFromADynamicClassLoader(org.jmock. test.unit.lib.JavaReflect
>> ionImposteriserTests): Caused an ERROR
>> * * *[junit] Invalid superclass index 0 in class file $UniqueTypeName$
>> * * *[junit] java.lang.ClassFormatError: Invalid superclass index 0 in
>> class file $UniqueTypeName$
>> * * *[junit] * * at java.lang.ClassLoader.defineClass1(Native Method)
>> * * *[junit] * * at java.lang.ClassLoader.defineClass(ClassLoader.java :634)
>> * * *[junit] * * at java.lang.ClassLoader.defineClass(ClassLoader.java :480)
>> * * *[junit] * * at
>> org.jmock.test.unit.support.SyntheticEmptyInterfac eClassLoader.synthesiseIn
>> terface(SyntheticEmptyInterfaceClassLoader.java:43 ) [junit] * * at
>> org.jmock.test.unit.support.SyntheticEmptyInterfac eClassLoader.findClass(Sy
>> ntheticEmptyInterfaceClassLoader.java:25) [junit] * * at
>> java.lang.ClassLoader.loadClass(ClassLoader.java:3 21) [junit] * * at
>> java.lang.ClassLoader.loadClass(ClassLoader.java:2 66) [junit] * * at
>> org.jmock.test.unit.lib.JavaReflectionImposteriser Tests.testCanMockTypesFro
>> mADynamicClassLoader(JavaReflectionImposteriserTes ts.java:38)
>>
>> I have no idea about this. *I've applied two patches. *One to use
>> objectweb classes directly rather than from cglib, and one derived from
>> the 2.6.0-RC2 release to support java 1.6.

I think the problem depends on the version of asm you are using; the error
is thrown on a call to a cglib method which your patch reroutes directly
to asm.

--
Guido Grazioli <guido.grazioli@gmail.com>
Via Parri 11 48011 - Alfonsine (RA)
Mobile: +39 347 1017202 (10-18)
Key FP = 7040 F398 0DED A737 7337* DAE1 12DC A698 5E81 2278
Linked in: http://www.linkedin.com/in/guidograzioli
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel

Orion Poplawski 05-11-2011 03:13 PM

Trouble building jmock 2.5.1
 
On 05/11/2011 06:00 AM, Guido Grazioli wrote:
>> On 08:49:36 AM Wednesday, May 11, 2011 Orion Poplawski wrote:
>>> Error is during the tests:
>>>
>>> [junit] Testcase:
>>> testCanMockTypesFromADynamicClassLoader(org.jmock. test.unit.lib.JavaReflect
>>> ionImposteriserTests): Caused an ERROR
>>> [junit] Invalid superclass index 0 in class file $UniqueTypeName$
>>> [junit] java.lang.ClassFormatError: Invalid superclass index 0 in
>>> class file $UniqueTypeName$
>>> [junit] at java.lang.ClassLoader.defineClass1(Native Method)
>>> [junit] at java.lang.ClassLoader.defineClass(ClassLoader.java :634)
>>> [junit] at java.lang.ClassLoader.defineClass(ClassLoader.java :480)
>>> [junit] at
>>> org.jmock.test.unit.support.SyntheticEmptyInterfac eClassLoader.synthesiseIn
>>> terface(SyntheticEmptyInterfaceClassLoader.java:43 ) [junit] at
>>> org.jmock.test.unit.support.SyntheticEmptyInterfac eClassLoader.findClass(Sy
>>> ntheticEmptyInterfaceClassLoader.java:25) [junit] at
>>> java.lang.ClassLoader.loadClass(ClassLoader.java:3 21) [junit] at
>>> java.lang.ClassLoader.loadClass(ClassLoader.java:2 66) [junit] at
>>> org.jmock.test.unit.lib.JavaReflectionImposteriser Tests.testCanMockTypesFro
>>> mADynamicClassLoader(JavaReflectionImposteriserTes ts.java:38)
>>>
>>> I have no idea about this. I've applied two patches. One to use
>>> objectweb classes directly rather than from cglib, and one derived from
>>> the 2.6.0-RC2 release to support java 1.6.
>
> I think the problem depends on the version of asm you are using; the error
> is thrown on a call to a cglib method which your patch reroutes directly
> to asm.
>

Probably. It appears that cglib out in the wild simply rebundles asm (via
jarjar I think). On Fedora it dosn't, hence the need to use the original
objectweb-asm namespace. 2.5.1 use cglib 2.1_3. F15 has cglib 2.2.

--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion@cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com
--
java-devel mailing list
java-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/java-devel


All times are GMT. The time now is 07:28 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.