Letractively / gwtx

Automatically exported from code.google.com/p/gwtx
0 stars 0 forks source link

Introspector.getBeanInfo() does not work #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add <inherits name='com.googlecode.gwtx.Java'/> to projects gwt.xml file
2. Add gwtx-1.5-20081002.jar to the compile script's classpath
3. Call Introspector.getBeanInfo(TestBean.class) - or use whatever class
you like

What is the expected output? What do you see instead?
I would expect that the introspector will return the BeanInfo. In hosted
mode, it's likely using the Introspector from the JDK and works. In
compiled mode, an IntrospectionException is thrown with the message "Class
has not been enabled for introspection in GWT test.client.TestBean"

What version of the product are you using? On what operating system?
GWT 1.5.2, Ubuntu 8.04 x86 32-bit, gwtx-1.5-20081002.jar 

Please provide any additional information below.

The attached project shows the problem.

So exactly HOW should we enable classes for introspection?

Original issue reported on code.google.com by akpr...@gmail.com on 28 Oct 2008 at 7:45

Attachments:

GoogleCodeExporter commented 8 years ago
After a bit of debugging, I modified PropertyDescriptorsGenerator to 1) produce 
valid
Java code, and 2) automatically register the bean info in a static block.

Then in was sufficient to simply call GWT.create(beanClass) to create the
introspector and register the bean info, and subsequent calls to
Introspector.getBeanInfo() worked as expected.

It works, but it's not as "transparent" as I would ideally like to see, since 
you
should not have to do anything in particular to enable BeanInfo support.

My modified PropertyDescriptorGenerator is attached.

Original comment by akpr...@gmail.com on 28 Oct 2008 at 8:56

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for investigating and posting a fix.
This first-drop code was early-experimental-draft with no real test.

Original comment by nicolas....@gmail.com on 28 Oct 2008 at 9:00

GoogleCodeExporter commented 8 years ago

Original comment by nicolas....@gmail.com on 28 Oct 2008 at 9:01

GoogleCodeExporter commented 8 years ago

Original comment by nicolas....@gmail.com on 18 Dec 2008 at 3:25

GoogleCodeExporter commented 8 years ago
I am still getting this error "Class has not been enabled for introspection in 
GWT "
with jar gwtx-1.5.2.jar. Is this patch included in this jar. Do I need to take 
any
step other than calling Introspector.getBeanInfo(MyJavaBean.class)

Original comment by paul.alok on 3 Apr 2009 at 6:43