commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <j...@apache.org>
Subject [jira] Updated: (BEANUTILS-157) Beanutils's describe() method cannot determine reader methods for anonymous class
Date Fri, 06 Jul 2007 12:10:06 GMT

     [ https://issues.apache.org/jira/browse/BEANUTILS-157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Niall Pemberton updated BEANUTILS-157:
--------------------------------------

             Assignee: Niall Pemberton
             Priority: Minor  (was: Major)
    Affects Version/s: 1.6.1
              Summary: Beanutils's describe() method cannot determine reader methods for anonymous
class  (was: [beanutils] 1.6.1 cannot determine reader methods for anonymous class)

> Beanutils's describe() method cannot determine reader methods for anonymous class
> ---------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-157
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-157
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: Bean / Property Utils
>    Affects Versions: 1.6.1
>         Environment: Operating System: Windows XP
> Platform: PC
>            Reporter: Thorbjørn Ravn Andersen
>            Assignee: Niall Pemberton
>            Priority: Minor
>             Fix For: 1.8.0
>
>
> 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?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
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