Comments (13)
Ugh, cglib conversion has not been smooth I guess. Am sick as the proverbial dog so probably won't get fixed today :-(
On Jun 13, 2012, at 11:51 AM, Coda [email protected] wrote:
Just ugpraded from 2.34 to 2.36.1, and I'm seeing this error in Dropwizard's unit tests:
org.skife.jdbi.net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at org.skife.jdbi.net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) at org.skife.jdbi.net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) at org.skife.jdbi.net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285) at org.skife.jdbi.v2.sqlobject.SqlObject.buildSqlObject(SqlObject.java:61) at org.skife.jdbi.v2.sqlobject.SqlObjectBuilder.open(SqlObjectBuilder.java:54) at org.skife.jdbi.v2.DBI.open(DBI.java:301) at com.yammer.dropwizard.db.tests.DatabaseTest.sqlObjectsCanAcceptOptionalParams(DatabaseTest.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.skife.jdbi.net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at org.skife.jdbi.net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 34 more Caused by: java.lang.ClassFormatError: Duplicate method name&signature in class file org/skife/jdbi/v2/sqlobject/CloseInternal$$EnhancerByCGLIB$$d17a2f8a at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) ... 40 more
Reply to this email directly or view it on GitHub:
#26
from jdbi.
No worries. Not a pressing issue.
On Wed, Jun 13, 2012 at 11:36 AM, Brian McCallister
[email protected]
wrote:
Ugh, cglib conversion has not been smooth I guess. Am sick as the proverbial dog so probably won't get fixed today :-(
On Jun 13, 2012, at 11:51 AM, Coda [email protected] wrote:
Just ugpraded from 2.34 to 2.36.1, and I'm seeing this error in Dropwizard's unit tests:
org.skife.jdbi.net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at org.skife.jdbi.net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) at org.skife.jdbi.net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) at org.skife.jdbi.net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285) at org.skife.jdbi.v2.sqlobject.SqlObject.buildSqlObject(SqlObject.java:61) at org.skife.jdbi.v2.sqlobject.SqlObjectBuilder.open(SqlObjectBuilder.java:54) at org.skife.jdbi.v2.DBI.open(DBI.java:301) at com.yammer.dropwizard.db.tests.DatabaseTest.sqlObjectsCanAcceptOptionalParams(DatabaseTest.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.skife.jdbi.net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at org.skife.jdbi.net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 34 more Caused by: java.lang.ClassFormatError: Duplicate method name&signature in class file org/skife/jdbi/v2/sqlobject/CloseInternal$$EnhancerByCGLIB$$d17a2f8a at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) ... 40 more
Reply to this email directly or view it on GitHub:
#26
Reply to this email directly or view it on GitHub:
#26 (comment)
Coda Hale
http://codahale.com
from jdbi.
I have replicated this, but only with shaded CGLIB. Will continue to hack at it.
from jdbi.
Okay, looks like the somewhat ancient version of the maven shade plugin I was using had a bug and was converting:
public java.lang.Object newInstance(net.sf.cglib.proxy.Callback);
public java.lang.Object newInstance(net.sf.cglib.proxy.Callback[]);
to
public java.lang.Object newInstance(org.skife.jdbi.cglib.proxy.Callback);
public java.lang.Object newInstance(org.skife.jdbi.cglib.proxy.Callback);
Which clearly won't work. Can you try again with 2.37.1 ?
from jdbi.
Works like a charm.
from jdbi.
I'm seeing this exception, with a different caused by, using JDBI 2.37.1 alongside Dropwizard 0.4.0:
org.skife.jdbi.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
at org.skife.jdbi.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
at org.skife.jdbi.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
at org.skife.jdbi.cglib.proxy.Enhancer.create(Enhancer.java:285)
at org.skife.jdbi.v2.sqlobject.SqlObject.buildSqlObject(SqlObject.java:61)
at org.skife.jdbi.v2.sqlobject.SqlObjectBuilder.onDemand(SqlObjectBuilder.java:68)
at org.skife.jdbi.v2.DBI.onDemand(DBI.java:314)
at com.dropgis.db.LocationsDAOTest.classSetUp(LocationsDAOTest.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:49)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:36)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.skife.jdbi.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
at org.skife.jdbi.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
... 17 more
Caused by: java.lang.IllegalAccessError: class com.dropgis.db.LocationsDAO$$EnhancerByCGLIB$$7656e3ae cannot access its superinterface org.skife.jdbi.v2.sqlobject.CloseInternal
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
... 23 more
Any ideas?
from jdbi.
First, try 2.37.2 and let me know if it still happens.
Caused by: java.lang.IllegalAccessError: class com.dropgis.db.LocationsDAO$$EnhancerByCGLIB$$7656e3ae cannot access its superinterface org.skife.jdbi.v2.sqlobject.CloseInternal
looks interesting. CloseInternal is a package local interface which all sql objects implement.
from jdbi.
I've updated to 2.37.2 but I'm still seeing the same exception and cause by. I can put together a sample project to demonstrate what I'm doing to replicate this if it would be helpful. It's nothing special though, just an abstract class with a single implemented method.
from jdbi.
I have the same problem as doomspork with 2.38.
If I had to guess, then I would presume that the exception is thrown because the class generated by cglib resides in the same package as its original and therefore cannot access the package local interface CloseInternal. The TestClassBasedSqlObject test passes because it resides in the same package as the CloseInternal interface. I've never directly used cglib before, so I might be off.
from jdbi.
Okay, replicated. Sorry about this!
from jdbi.
Just cut 2.38.1 I think this resolves the issue -- I added a test to replicate, and you were exactly correct. Could you confirm if 2.38.1 fixes it for you?
from jdbi.
Thanks a lot, that did the trick!
from jdbi.
Fixed!
from jdbi.
Related Issues (20)
- @Define + optional @BindBean HOT 3
- ConstructorMapper doesn't throw an exception if no record fields at all match any columns in the result set HOT 2
- Using RegisterConstructorMappers throws an IllegalArgumentException "Not a class" HOT 2
- MS SQL Server does not have OutParameters and cursors so would need ResultBearing support on Call HOT 2
- Write some docs on how to add a custom testcontainers database driver
- @BindBean for class with Unit<?> property leads to StackOverflowError HOT 7
- Investigate CycloneDX SBOM plugin
- Investigate repeatable build configuration HOT 2
- Investigate japi for apidiffing HOT 2
- Could not get OUT parameter from statement, ORA-17009: Closed statement with version 3.43.0 HOT 10
- Two Updates in one transaction with failing rollback on exception HOT 1
- Add test for non-default locale and timezone HOT 1
- Memory consumption for generated SqlObject DAO HOT 4
- @UseFreemarkerSqlLocator is ignored when it comes before @UseFreemarkerEngine HOT 5
- Can not set static final field HOT 4
- DAO/SqlObject interface performance HOT 8
- Investigate libyears HOT 2
- JDBI can't find the registered value mapper for a Map<String, MyClass<SomeOtherClass>> return type HOT 4
- Exceptiona are thrown after tests execution, if the database test container is closed prematurely. HOT 14
- Thread-based nesting behavior for managed handles is surprising and not adequately documented HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jdbi.