[jboss-user] [JBoss Seam] - Re: NoSuchMethodException when acessing protected methods in

pettersonfp do-not-reply at jboss.com
Fri Jul 20 00:41:56 EDT 2007


Hello again,

I was having a problem in a machine with linux / jboss 4.2.0.GA and seam 2.0.
Now I am in home and the only difference is that I have windows xp.

Instead of NoSuchMethodException now I am getting another one.

Following are the code and the stack trace.

Disregard my previous message.

Thanks,
Petterson

Base.java

  | public class Base {
  | 
  | 	public final void execute() {
  | 		System.out.println("Base->execute");
  | 		doExecute(); // **** the error occurs here
  | 	}
  | 	
  | 	protected void doExecute() {
  | 		System.out.println("Base->doExecute");
  | 	}
  | 	
  | 
  | }
  | 

Derived.java

  | import org.jboss.seam.annotations.Name;
  | 
  | @Name("derived")
  | public class Derived extends Base {
  | 
  | 	@Override
  | 	protected void doExecute() {
  | 		System.out.println("Derived->doExecute");
  | 	}
  | 	
  | }
  | 

testDerived.xhtml

  | <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  |                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  |                 xmlns:s="http://jboss.com/products/seam/taglib"
  |                 xmlns:ui="http://java.sun.com/jsf/facelets"
  |                 xmlns:f="http://java.sun.com/jsf/core"
  |                 xmlns:h="http://java.sun.com/jsf/html"
  |                 xmlns:rich="http://richfaces.ajax4jsf.org/rich"
  |                 template="layout/template.xhtml">
  | 
  | <ui:define name="body">
  |     
  |     <h:messages styleClass="message"/>
  |     
  |     <h:form id="printTest">
  |     
  |         <div class="actionButtons">
  |             <h:commandButton value="Execute" action="#{derived.execute}"/>
  |         </div>
  |           
  |     </h:form>
  | 
  |  </ui:define> 
  | </ui:composition>
  | 
  | 

Stack Trace [partial]

  | Caused by: java.lang.IllegalAccessException: Class org.jboss.seam.util.Reflections can not access a member of class br.com.liax.test.Derived with modifiers "protected"
  | 	at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
  | 	at java.lang.reflect.Method.invoke(Method.java:578)
  | 	at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
  | 	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
  | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
  | 	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
  | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | 	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
  | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  | 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
  | 	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
  | 	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
  | 	at br.com.liax.test.Derived_$$_javassist_0.doExecute(Derived_$$_javassist_0.java)
  | 	at br.com.liax.test.Base.execute(Base.java:8)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:325)
  | 	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:338)
  | 	at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
  | 	at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
  | 	at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
  | 	at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
  | 	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
  | 	... 44 more
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4066026#4066026

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4066026



More information about the jboss-user mailing list