com.google.inject.internal.ComputationException:
java.lang.IllegalArgumentException: Cannot find bytecode for class
org.mybatis.guice.datasource.helper.FormattedProvider
at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)
at com.google.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
at com.google.inject.internal.StackTraceElements.forMember(StackTraceElements.java:53)
at com.google.inject.internal.Errors.formatInjectionPoint(Errors.java:635)
at com.google.inject.internal.Errors.formatSource(Errors.java:597)
at com.google.inject.internal.Errors.format(Errors.java:474)
at com.google.inject.CreationException.getMessage(CreationException.java:48)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:267)
at java.lang.Throwable.toString(Throwable.java:344)
at java.lang.String.valueOf(String.java:2615)
at java.io.PrintWriter.print(PrintWriter.java:546)
at java.io.PrintWriter.println(PrintWriter.java:683)
at java.lang.Throwable.printStackTrace(Throwable.java:510)
at org.junit.runner.notification.Failure.getTrace(Failure.java:65)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestListener.testFailure(JUnit4TestListener.java:68)
at org.junit.runner.notification.RunNotifier$4.notifyListener(RunNotifier.java:100)
at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:41)
at org.junit.runner.notification.RunNotifier.fireTestFailure(RunNotifier.java:97)
at org.junit.internal.runners.ErrorReportingRunner.runCause(ErrorReportingRunner.java:57)
at org.junit.internal.runners.ErrorReportingRunner.run(ErrorReportingRunner.java:34)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalArgumentException: Cannot find bytecode
for class org.mybatis.guice.datasource.helper.FormattedProvider
at com.google.inject.internal.Preconditions.checkArgument(Preconditions.java:113)
at com.google.inject.internal.LineNumbers.<init>(LineNumbers.java:57)
at com.google.inject.internal.StackTraceElements$1.apply(StackTraceElements.java:36)
at com.google.inject.internal.StackTraceElements$1.apply(StackTraceElements.java:33)
at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549)
... 26 more
http://people.apache.org/~simonetripodi/
http://www.99soft.org/
Hi all guys,
I need to bind a Provider generated by ASM with injection points
generated on the fly, everything gone fine until injection points
resolution by Guice, and got the errors below; I tried to hack the
com.google.inject.internal.MapMaker class loader, adding the new class
definition, but without success.
Does someone know how guice resolved that issue when enhancing the
classes with AOP?
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To post to this group, send email to google...@googlegroups.com.
To unsubscribe from this group, send email to google-guice...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
public LineNumbers(Class type) throws IOException {
this.type = type;
if (!type.isArray()) {
InputStream in = type.getResourceAsStream("/" +
type.getName().replace('.', '/') + ".class");
Preconditions.checkArgument(in != null, "Cannot find bytecode
for %s", type);
new ClassReader(in).accept(new LineNumberReader(),
ClassReader.SKIP_FRAMES);
}
}
http://people.apache.org/~simonetripodi/
http://www.99soft.org/
http://people.apache.org/~simonetripodi/
http://www.99soft.org/
Hi Stuart!!! :)
I received your reply just after a second I reposted :)
Thanks a lot for your suggestions, I'll try do follow them as well!!!
http://people.apache.org/~simonetripodi/
http://www.99soft.org/
try {
Provider<XXX> myProvider = MyProviderFactory.newProvider(
[some input] ); // that's the component that uses AMS to generate
components on the fly
Binder childBinder = binder.withSource(myProvider);
childBinder.bind(XXX.class).toProvider(myProvider);
} catch (Exception e) {
binder.addError(e);
}
and throws the same exception. What did I do wrong?
Many thanks in advance,
Simo
http://people.apache.org/~simonetripodi/
http://www.99soft.org/
On Wed, Nov 24, 2010 at 3:12 PM, Simone Tripodi
Hi again Stuart,
sorry for the silly question but I tried following your suggestion:
try {
Provider<XXX> myProvider = MyProviderFactory.newProvider(
[some input] ); // that's the component that uses AMS to generate
components on the fly
Binder childBinder = binder.withSource(myProvider);
childBinder.bind(XXX.class).toProvider(myProvider);
} catch (Exception e) {
binder.addError(e);
}
and throws the same exception. What did I do wrong?
try {
Binder childBinder = binder.withSource("[generated]");
Provider<XXX> myProvider = MyProviderFactory.newProvider(
[some input] ); // that's the component that uses AMS to generate
components on the fly
childBinder.bind(XXX.class).toProvider(myProvider);
} catch (Exception e) {
binder.addError(e);
}
http://people.apache.org/~simonetripodi/
http://www.99soft.org/