Kabir Khan [
http://community.jboss.org/people/kabir.khan%40jboss.com] replied to the
discussion
"Issues using Javassist TypeInfoFactory in other projects"
To view the discussion, visit:
http://community.jboss.org/message/534604#534604
--------------------------------------------------------------
I am also seeing this
java.lang.IllegalArgumentException: Cannot set accessible on method info:
JavassistMethodInfo@5578920a{name=privMain}
at
org.jboss.test.kernel.deployment.support.StaticInjector.injectToMethod(StaticInjector.java:76)
at
org.jboss.test.kernel.deployment.support.StaticInjector.injectToNonPublicMethod(StaticInjector.java:59)
at
org.jboss.test.kernel.deployment.test.BeanContainerStaticTestCase.testStaticInjection(BeanContainerStaticTestCase.java:53)
private void injectToMethod(Class<?> clazz, String method, Object value,
Class<?> signature, boolean isPublic) throws Throwable
{
ClassInfo classInfo = configurator.getClassInfo(clazz);
MethodInfo mi = Config.findMethodInfo(classInfo, method, new
String[]{signature.getName()}, true, isPublic);
if (isPublic == false)
{
// TODO - move this into Reflection?
if (mi instanceof ReflectMethodInfoImpl)
{
ReflectMethodInfoImpl rmi = (ReflectMethodInfoImpl)mi;
Method m = rmi.getMethod();
m.setAccessible(true);
}
else
throw new IllegalArgumentException("Cannot set accessible on method info:
" + mi);
}
mi.invoke(null, new Object[]{value});
}
If we moved the setAccessible() stuff to jboss-reflect as indicated in the comment, we
could manage the accessibility of members there?
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/534604#534604]
Start a new discussion in JBoss Microcontainer Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]