Recently after upgrading to Java 8 I've started to see warnings from guice
AOP in my glassfish logs:
[2014-11-05T13:18:01.197+0100] [glassfish 4.0] [WARNING] []
[com.google.inject.internal.ProxyFactory] [tid: _ThreadID=19
_ThreadName=http-listener-1(1)] [timeMillis: 1415189881197] [levelValue:
900] [[
Method [public com.gwtplatform.dispatch.rpc.shared.Result
SendUserMessageHandler.execute(com.gwtplatform.dispatch.rpc.shared.Action)
throws com.gwtplatform.dispatch.shared.ActionException] is synthetic and is
being intercepted by [TransactionalInterceptor@3b17ed63]. This could
indicate a bug. The method may be intercepted twice, or may not be
intercepted at all.]]
I have a custom @Transaction annotation in subclasses of
AbstractActionHandler. I've modified my code and the warnings are gone, but
I'm concerned that there could be other issues as well. Do you know if
there are any changes in java 8 which would cause these warnings to appear?
The code didn't change at all between java 7 and 8 upgrade.
My current code which excludes synthetic methods:
public class ServerModule extends AbstractModule {
private static final class TransactionMethodMatcher extends
AbstractMatcher<Method> {
@Override
public boolean matches(final Method method) {
return method.isAnnotationPresent(Transaction.class) && !method.
isSynthetic();
}
@Override
protected final void configure() {
final TransactionalInterceptor transactionalInterceptor = new
TransactionalInterceptor();
bindInterceptor(Matchers.subclassesOf(AbstractActionHandler.class),
new TransactionMethodMatcher(), transactionalInterceptor);
bind(TransactionalInterceptor.class).toInstance(
transactionalInterceptor);
requestInjection(transactionalInterceptor);
}
}
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/5af71528-f8cb-41ae-9ac6-f09f02b955e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.