[jira] Created: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

View: New views
9 Messages — Rating Filter:   Alert me  

[jira] Created: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
----------------------------------------------------------------------------------------------

                 Key: JMOCK-197
                 URL: http://jira.codehaus.org/browse/JMOCK-197
             Project: jMock
          Issue Type: Bug
    Affects Versions: 1.2.0
            Reporter: Ryan C. Payne


In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
        at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
        at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
        at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
        at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
        at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
        at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
        at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
        at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
        at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
        at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
        at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
        at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
        at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
        at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
        at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
        at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
        at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
        at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
        at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
        ... 58 more

Research led me to the following:
  http://www.gg3721.com/list/50/44427.html 
and the followup
  http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=143569#action_143569 ]

Ryan C. Payne commented on JMOCK-197:
-------------------------------------

Is there any workaround to get this to work again, short of rolling back to jMock 1.1.0 or breaking out the static nested class into it's own file?

> Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
> ----------------------------------------------------------------------------------------------
>
>                 Key: JMOCK-197
>                 URL: http://jira.codehaus.org/browse/JMOCK-197
>             Project: jMock
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Ryan C. Payne
>
> In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
> net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
> at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
> at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
> at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
> at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
> Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
> ... 58 more
> Research led me to the following:
>   http://www.gg3721.com/list/50/44427.html 
> and the followup
>   http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=143577#action_143577 ]

Nat Pryce commented on JMOCK-197:
---------------------------------

Is the static nested class public?

If not, can you work around the problem by making it public?


> Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
> ----------------------------------------------------------------------------------------------
>
>                 Key: JMOCK-197
>                 URL: http://jira.codehaus.org/browse/JMOCK-197
>             Project: jMock
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Ryan C. Payne
>
> In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
> net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
> at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
> at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
> at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
> at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
> Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
> ... 58 more
> Research led me to the following:
>   http://www.gg3721.com/list/50/44427.html 
> and the followup
>   http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=143632#action_143632 ]

Ryan C. Payne commented on JMOCK-197:
-------------------------------------

Yes, the static nested class is indeed public.

> Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
> ----------------------------------------------------------------------------------------------
>
>                 Key: JMOCK-197
>                 URL: http://jira.codehaus.org/browse/JMOCK-197
>             Project: jMock
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Ryan C. Payne
>
> In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
> net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
> at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
> at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
> at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
> at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
> Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
> ... 58 more
> Research led me to the following:
>   http://www.gg3721.com/list/50/44427.html 
> and the followup
>   http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nat Pryce updated JMOCK-197:
----------------------------

    Component/s: Library

> Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
> ----------------------------------------------------------------------------------------------
>
>                 Key: JMOCK-197
>                 URL: http://jira.codehaus.org/browse/JMOCK-197
>             Project: jMock
>          Issue Type: Bug
>          Components: Library
>    Affects Versions: 1.2.0
>            Reporter: Ryan C. Payne
>
> In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
> net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
> at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
> at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
> at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
> at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
> Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
> ... 58 more
> Research led me to the following:
>   http://www.gg3721.com/list/50/44427.html 
> and the followup
>   http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144402#action_144402 ]

Nat Pryce commented on JMOCK-197:
---------------------------------

If you could give us a small, self-contained JUnit test that demonstrates the problem, that would be a great help in tracking this down.

> Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
> ----------------------------------------------------------------------------------------------
>
>                 Key: JMOCK-197
>                 URL: http://jira.codehaus.org/browse/JMOCK-197
>             Project: jMock
>          Issue Type: Bug
>          Components: Library
>    Affects Versions: 1.2.0
>            Reporter: Ryan C. Payne
>
> In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
> net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
> at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
> at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
> at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
> at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
> Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
> ... 58 more
> Research led me to the following:
>   http://www.gg3721.com/list/50/44427.html 
> and the followup
>   http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144403#action_144403 ]

Ryan C. Payne commented on JMOCK-197:
-------------------------------------

Sure thing. I will whip that up this afternoon and attach it to the JIRA.


> Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
> ----------------------------------------------------------------------------------------------
>
>                 Key: JMOCK-197
>                 URL: http://jira.codehaus.org/browse/JMOCK-197
>             Project: jMock
>          Issue Type: Bug
>          Components: Library
>    Affects Versions: 1.2.0
>            Reporter: Ryan C. Payne
>
> In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
> net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
> at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
> at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
> at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
> at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
> Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
> ... 58 more
> Research led me to the following:
>   http://www.gg3721.com/list/50/44427.html 
> and the followup
>   http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Commented: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=144554#action_144554 ]

Nat Pryce commented on JMOCK-197:
---------------------------------

Great! Thanks.

> Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
> ----------------------------------------------------------------------------------------------
>
>                 Key: JMOCK-197
>                 URL: http://jira.codehaus.org/browse/JMOCK-197
>             Project: jMock
>          Issue Type: Bug
>          Components: Library
>    Affects Versions: 1.2.0
>            Reporter: Ryan C. Payne
>
> In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
> net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
> at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
> at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
> at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
> at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
> Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
> ... 58 more
> Research led me to the following:
>   http://www.gg3721.com/list/50/44427.html 
> and the followup
>   http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nat Pryce updated JMOCK-197:
----------------------------

    Component/s:     (was: JMock 2.x.x Library)
                 JMock 1.x.x Library

> Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
> ----------------------------------------------------------------------------------------------
>
>                 Key: JMOCK-197
>                 URL: http://jira.codehaus.org/browse/JMOCK-197
>             Project: jMock
>          Issue Type: Bug
>          Components: JMock 1.x.x Library
>    Affects Versions: 1.2.0
>            Reporter: Ryan C. Payne
>
> In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
> net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError-->tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
> at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
> at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
> at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
> at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
> at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:63)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:46)
> at org.jmock.cglib.CGLIBCoreMock.<init>(CGLIBCoreMock.java:35)
> at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
> at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
> at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
> Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
> at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(<generated>)
> at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(<generated>)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:280)
> at com.mycompany.core.util.DataPage$DataPageDefinition.<init>(DataPage.java:267)
> at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.<init>(<generated>)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
> ... 58 more
> Research led me to the following:
>   http://www.gg3721.com/list/50/44427.html 
> and the followup
>   http://www.gg3721.com/list/50/44774.html

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email