New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssistedInject needs class load bridging under OSGi #337
Comments
From mcculls on March 30, 2009 03:59:15 I'd like to get this resolved in Guice 2.1 if possible. Labels: Type-Defect Milestone-Release2.1 |
From rwallace1979 on April 15, 2009 21:33:03 There's a minor conflict with the previous patch and trunk. Attaching an updated patch. Attachment: gist |
From limpbizkit on April 26, 2009 14:31:12 (No comment was entered for this change.) Labels: Extension-AssistedInject Priority-Low |
From mcculls on October 30, 2009 21:02:50 Will make sure this patch is up-to-date as part of my general OSGi cleanup for 2.1 Status: Started |
From mcculls on May 04, 2010 03:34:53 DescriptionThis patch updates the newProxyInstance calls in AssistedInject to use the Owner: sberlin Attachment: gist |
From mcculls on May 04, 2010 03:41:40 NOTE: the patch assumes that the internal BytecodeGen class has been made public Index: src/com/google/inject/internal/BytecodeGen.java private static final Logger logger = Logger.getLogger(BytecodeGen.class.getName()); |
From mcculls on May 04, 2010 04:27:44 (No comment was entered for this change.) Labels: -Type-Defect Type-Patch |
From sberlin on May 09, 2010 05:52:27 fixed in r1158 . thanks very much for the patch, Stuart! Status: Fixed |
From Rinsvind on February 15, 2009 08:25:01
AssistedInject implements the factory interfaces by building dynamic
proxies. Under OSGi this creates the same class loading problem as with the
proxies and interceptors that Guice itself generates. So we need the
classloader bridges implemented in com.google.inject.internal.BytecodeGen.
Luckily BytecodeGen is built more as a standalone utility and this makes it
dead simple to solve the problem. I am attaching a 2-liner patch that calls
BytecodeGen during proxy generation to obtain a bridge ClassLoader for the
new proxy.
This patch must be used with Stuart's fragments patch from issue #311 to
get a working assistedinject bundle.
Btw I tried to replace the java.lang.reflect.Proxy with the fancier
BytecodeGen.newEnhancer(). Here I hit a wall because AssistedInject is
build against both the guice-snapshot.jar that contains a JarJar-mangled
cglib and the cglib-snapshot.jar from lib\build. After some toying with the
ant scripts I gave up and settled for just BytecodeGen.getClassLoader().
Finally I propose that BytecodeGen eventually be moved to the spi package
so that all extensions that need to generate proxies can use it.
Attachment: gist
assistedinject-classload.patch
Original issue: http://code.google.com/p/google-guice/issues/detail?id=337
The text was updated successfully, but these errors were encountered: