commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33461] New: - 1.6.1 cannot determine reader methods for anonymous class
Date Wed, 09 Feb 2005 10:38:51 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33461>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33461

           Summary: 1.6.1 cannot determine reader methods for anonymous
                    class
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: thorbjoern@gmail.com


I have the following snippet in a JSP-page which uses BeanUtils 1.6.1 and I get
an exception.

Code snippet (the anonymous class is to get a JavaBean defined in the JSP-page):
---
  List l = new ArrayList();
  for(int i = 1; i < 10; i++) {
    final int i2 = i;
  	 Object o = new Serializable() {
  		String x = "" + i2;
  		String y = "" + (100+i2) ;
  		public String getX() {
  		  return x;
  		}
  		public String getY() {
  		  return y;
  		}  	
  		public String toString() {
  		return getX() + " " + getY();
  		}	
  	};
  	l.add(o);
  	Map map = BeanUtils.describe(o);
 ---
which gives me the following exception:
---

javax.servlet.ServletException: Property 'y' has no getter method
	at
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
	at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
	at org.apache.jsp.main_jsp._jspService(main_jsp.java:257)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
	at com.transaxiom.axsWHSweb.servlet.GetCurrentStock.doPost(GetCurrentStock.java:31)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:534)
---
for what I can see it is the PropertyDescriptor.getReadMethod0 which does not
treat WeakReferences correctly.  The passed property descriptor looks like:
---
this= PropertyDescriptor  (id=2658)
	baseName= null
	bound= false
	classRef= WeakReference  (id=2662)
	constrained= false
	displayName= null
	expert= false
	hidden= false
	name= "y"
	preferred= false
	propertyEditorClassRef= null
	propertyTypeRef= WeakReference  (id=2664)
	readMethodName= "getY"
	readMethodRef= SoftReference  (id=2666)
	shortDescription= null
	table= null
	writeMethodName= null
	writeMethodRef= null
--
but now it is more complex than I can understand.   Any suggestions?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message