At 05:27 �� 3/1/2002 +0200, you wrote: >At 06:49 �� 2/1/2002 -0800, John McNally wrote: >>I have looked at the source for PropertyDescriptor (PD) and Introspector >>and do not see where the problem might be. I have sun's jdk 1.3.0. you >>might want to look for yourself. > >Yeap, you'r right... Under 1.3.1_01 there is no problem... There is >something wrong with 1.2.2. Thank you for your help. >
More info about that: PropertyDescriptor (PD) in 1.2.2 is buggy. I did some source checking, and I discovered that the PD in 1.2.2 assumes that for a given property there is one setter and one getter. On the other hand, PD in 1.3.x has the correct logic. It assumes that for a given property there should be at least one getter and there might be multiple getters. It then first tries to find the qualified getter, learns the return type of the getter and therefore the data type of the property and then it searches the class for a setter with one argument of the given data type. Anyway, the behaviour of PD in 1.3.x is correct, BUT that means that the current implementation of TurbineIntakeService is working properly only with 1.3.x JRE's. I think that this should, from now, be somewhere stated ... perhaps in the Intake HOWTO. As for me, since my project is 1.2.2 based and I can't upgrade to a newer JRE due to some restrictions I have to patch the TurbineIntakeService :( Best Regards Filippos Slavik PS: John, thanks very much for your help and feedback :) >>PD should only throw that exception in >>the case where you have >> >>Foo getFoo() >> >>and the only setter it is able to find is >> >>void setFoo(Bar foo) >> >> >>if it can find a >> >>void setFoo(Foo foo) >> >>it will be the one selected. >> >>john mcnally >> >>Filippos Slavik wrote: >> > >> > At 06:16 �� 2/1/2002 -0800, you wrote: >> > >PropertyDescriptor contains the logic to determine the correct setter >> > >according to the return type of the getter, so it should not be a >> > >problem. What is the exception? stacktrace? >> > >> > [Thu Jan 03 04:21:34 GMT+02:00 2002] -- ERROR -- >> > Exception: java.beans.IntrospectionException: type mismatch >> > between read and write methods >> > Stack Trace follows: >> > java.beans.IntrospectionException: type mismatch between read and >> > write methods >> > java.lang.Throwable(java.lang.String) >> > java.lang.Exception(java.lang.String) >> > java.beans.IntrospectionException(java.lang.String) >> > void java.beans.PropertyDescriptor.findPropertyType() >> > java.beans.PropertyDescriptor(java.lang.String, java.lang.Class) >> > java.lang.reflect.Method >> > >> >org.apache.turbine.services.intake.TurbineIntakeService.getFieldSetter(java.lang.String, >> > java.lang.String) >> > java.lang.reflect.Method >> > >> org.apache.turbine.services.intake.TurbineIntake.getFieldSetter(java.lang.String, >> > java.lang.String) >> > >> >org.apache.turbine.services.intake.model.Field(org.apache.turbine.services.intake.xmlmodel.XmlField, >> > org.apache.turbine.services.intake.model.Group) >> > >> >org.apache.turbine.services.intake.model.NumberKeyField(org.apache.turbine.services.intake.xmlmodel.XmlField, >> > org.apache.turbine.services.intake.model.Group) >> > org.apache.turbine.services.intake.model.Field >> > >> >org.apache.turbine.services.intake.model.FieldFactory$5.getInstance(org.apache.turbine.services.intake.xmlmodel.XmlField, >> > org.apache.turbine.services.intake.model.Group) >> > org.apache.turbine.services.intake.model.Field >> > >> >org.apache.turbine.services.intake.model.FieldFactory.getInstance(org.apache.turbine.services.intake.xmlmodel.XmlField, >> > org.apache.turbine.services.intake.model.Group) >> > >> >org.apache.turbine.services.intake.model.Group(org.apache.turbine.services.intake.xmlmodel.XmlGroup) >> > org.apache.turbine.services.intake.model.Group >> > >> org.apache.turbine.services.intake.TurbineIntakeService.getGroup(java.lang.String) >> > org.apache.turbine.services.intake.model.Group >> > >> org.apache.turbine.services.intake.TurbineIntake.getGroup(java.lang.String) >> > void >> > org.apache.turbine.services.intake.IntakeTool.init(java.lang.Object) >> > void >> > >> >org.apache.turbine.services.pull.TurbinePullService.populateWithRequestTools(org.apache.velocity.context.Context, >> > org.apache.turbine.util.RunData) >> > void >> > >> >org.apache.turbine.services.pull.TurbinePullService.populateContext(org.apache.velocity.context.Context, >> > org.apache.turbine.util.RunData) >> > void >> > >> >org.apache.turbine.services.pull.TurbinePull.populateContext(org.apache.velocity.context.Context, >> > org.apache.turbine.util.RunData) >> > org.apache.velocity.context.Context >> > >> >org.apache.turbine.services.velocity.TurbineVelocityService.getContext(org.apache.turbine.util.RunData) >> > org.apache.velocity.context.Context >> > >> >org.apache.turbine.services.velocity.TurbineVelocity.getContext(org.apache.turbine.util.RunData) >> > void >> > >> >org.apache.turbine.util.velocity.VelocityActionEvent.perform(org.apache.turbine.util.RunData) >> > void >> > >> >org.apache.turbine.modules.actions.VelocityAction.perform(org.apache.turbine.util.RunData) >> > void >> > >> org.apache.turbine.modules.ActionLoader.exec(org.apache.turbine.util.RunData, >> > java.lang.String) >> > void >> > org.apache.turbine.Turbine.doGet(javax.servlet.http.HttpServletRequest, >> > javax.servlet.http.HttpServletResponse) >> > void >> > >> javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, >> > javax.servlet.http.HttpServletResponse) >> > void >> > javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, >> > javax.servlet.ServletResponse) >> > void >> > >> org.apache.tomcat.core.ServletWrapper.doService(org.apache.tomcat.core.Request, >> > org.apache.tomcat.core.Response) >> > void >> > org.apache.tomcat.core.Handler.service(org.apache.tomcat.core.Request, >> > org.apache.tomcat.core.Response) >> > void >> > >> org.apache.tomcat.core.ServletWrapper.service(org.apache.tomcat.core.Request, >> > org.apache.tomcat.core.Response) >> > void >> > >> >org.apache.tomcat.core.ContextManager.internalService(org.apache.tomcat.core.Request, >> > org.apache.tomcat.core.Response) >> > void >> > >> org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request, >> > org.apache.tomcat.core.Response) >> > void >> > >> >org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection, >> > java.lang.Object []) >> > void >> > org.apache.tomcat.service.TcpWorkerThread.runIt(java.lang.Object []) >> > void org.apache.tomcat.util.ThreadPool$ControlRunnable.run() >> > void java.lang.Thread.run() >> > >> > JRE 1.2.2 :) >> > >> > Best Regards >> > Filippos Slavik >> > >> > >john mcnally >> > > >> > >Filippos Slavik wrote: >> > > > >> > > > At 05:49 �� 2/1/2002 -0800, you wrote: >> > > > >See the archives. A reasonable though not ideal fix is in >> cvs. And the >> > > > >problem is not with PropertyDescriptor, I am pretty sure it >> contains the >> > > > >correct logic. The bug occurs in BeanInfo or Introspector. >> > > > >> > > > Can you bee a bit more precise ? I 'm using Turbine 2 CVS HEAD >> (should't be >> > > > the fix there ?) >> > > > >> > > > I got the exception in the following line: >> > > > >> > > > pd = new PropertyDescriptor(propName, Class.forName(className)); >> > > > >> > > > in the ::getFieldSetter of TurbineIntakeService.. >> > > > >> > > > >john mcnally >> > > > >> > > > Best Regards >> > > > Filippos Slavik >> > > > >> > > > >Filippos Slavik wrote: >> > > > > > >> > > > > > Dear all I have the following problem with >> TurbineIntakeService (2.x, >> > > > > > version 1.3) >> > > > > > >> > > > > > I have the following table column defined in my database xml file: >> > > > > > >> > > > > > <column javaName="DiskPlatformID" >> name="DIGITAL_LARGE_DISKPLATFORM_ID" >> > > > > > type="INTEGER"/> >> > > > > > >> > > > > > Torque (the one distirbuted with TDK2.1) generates in the Base OM >> > > object >> > > > > > one getter: >> > > > > > >> > > > > > public NumberKey getDiskPlatformID() >> > > > > > >> > > > > > and two setters: >> > > > > > >> > > > > > public void setDiskPlatformID(NumberKey v ) throws Exception >> > > > > > public void setDiskPlatformID(String v ) throws Exception >> > > > > > >> > > > > > So far so good. My inputs.xml contains an entry to handle the >> above >> > > field: >> > > > > > >> > > > > > <field name="DiskPlatformID" key="diskplatformid" type="NumberKey" >> > > > > > mapToProperty="DiskPlatformID"/> >> > > > > > >> > > > > > The problem is that TurbineIntakeService fails to select the >> > > correct (?) >> > > > > > setter for the concrete field/property. From the exception >> thrown the >> > > > > > reason is obvious. The IntakseService uses the >> > > > > > java.bean.PropertyDescriptor class to get the setter and >> getter for the >> > > > > > property, but it fails since there are two setters for the >> property >> > > with >> > > > > > different parameter types. >> > > > > > >> > > > > > I'm stuck :( Due to this exception I'm not able to map my "form >> > > data" to >> > > > > > the appropriate OM instances and store them to the database >> > > backend. Once >> > > > > > again let me state that I'm using turbine 2.x CVS HEAD (TDK2.1 >> for the >> > > > > > generation of OM sources) - JRE 1.2.2 (Visual Age 4.0 for Java)... >> > > > > > >> > > > > > Any help ? :) >> > > > > > >> > > > > > Thanks :) >> > > > > > Slavikos >> > > > > > >> > > > > > ################################################################ >> > > > > > Filippos Slavik >> > > > > > FORTHnet R&D, Heraklion, Greece >> > > > > > e-mail : [EMAIL PROTECTED] >> > > > > > phone : (+3) 081 391230 >> > > > > > ################################################################ >> > > > > > >> > > > > > "The software said 'runs on Win95 or better,' so I installed it >> > > > > > on Linux..." >> > > > > > >> > > > > > -- >> > > > > > To unsubscribe, >> > > > > e-mail: <mailto:[EMAIL PROTECTED]> >> > > > > > For additional commands, e-mail: >> > > > > <mailto:[EMAIL PROTECTED]> >> > > > > >> > > > >-- >> > > > >To unsubscribe, >> > > e-mail: <mailto:[EMAIL PROTECTED]> >> > > > >For additional commands, e-mail: >> > > <mailto:[EMAIL PROTECTED]> >> > > > >> > > > ################################################################ >> > > > Filippos Slavik >> > > > FORTHnet R&D, Heraklion, Greece >> > > > e-mail : [EMAIL PROTECTED] >> > > > phone : (+3) 081 391230 >> > > > ################################################################ >> > > > >> > > > "The software said 'runs on Win95 or better,' so I installed it >> > > > on Linux..." >> > > > >> > > > -- >> > > > To unsubscribe, >> > > e-mail: <mailto:[EMAIL PROTECTED]> >> > > > For additional commands, e-mail: >> > > <mailto:[EMAIL PROTECTED]> >> > > >> > >-- >> > >To unsubscribe, >> e-mail: <mailto:[EMAIL PROTECTED]> >> > >For additional commands, e-mail: >> <mailto:[EMAIL PROTECTED]> >> > >> > ################################################################ >> > Filippos Slavik >> > FORTHnet R&D, Heraklion, Greece >> > e-mail : [EMAIL PROTECTED] >> > phone : (+3) 081 391230 >> > ################################################################ >> > >> > "The software said 'runs on Win95 or better,' so I installed it >> > on Linux..." >> > >> > -- >> > To unsubscribe, >> e-mail: <mailto:[EMAIL PROTECTED]> >> > For additional commands, e-mail: >> <mailto:[EMAIL PROTECTED]> >> >>-- >>To unsubscribe, >>e-mail: <mailto:[EMAIL PROTECTED]> >>For additional commands, e-mail: >><mailto:[EMAIL PROTECTED]> > > >################################################################ >Filippos Slavik >FORTHnet R&D, Heraklion, Greece >e-mail : [EMAIL PROTECTED] >phone : (+3) 081 391230 >################################################################ > >"The software said 'runs on Win95 or better,' so I installed it >on Linux..." > > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > ################################################################ Filippos Slavik FORTHnet R&D, Heraklion, Greece e-mail : [EMAIL PROTECTED] phone : (+3) 081 391230 ################################################################ "The software said 'runs on Win95 or better,' so I installed it on Linux..." -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
