dev@glassfish.java.net

Re: Workaround for craeting MySQL DataSource in prelude GA

From: Anissa Lam <Anissa.Lam_at_Sun.COM>
Date: Fri, 31 Oct 2008 15:40:26 -0700

Hi Lance,

Theoretically this bug will show up during the creation of connection
pool with any JDBC drivers installed. The issue is in the object type
of the property that was passed to the Admin Console by the connector
runtime. Admin Console was expecting a v3 PropertyConfig object but is
also able to handle the case where the object is either a NULL or String
type.
For all the other driver that you mentioned, first property which was
obtained by introspection either doesn't have a default value, or the
value is String type. So, the issue doesn't show up, which is really
just by luck.
For MySQL case, the first property has a default value of type Boolean,
and thus triggers the bug.

thanks
Anissa.


Lance J. Andersen wrote:
> BTW, I did try a few other JDBC drivers this morning (postgresql and
> Oracle thin and Sybase jConnect) and I only see the problem with
> MySQL? Just wondering if you could explain why this one was the only
> one to appear to have a problem?
>
> regards
>
> Ludovic Champenois wrote:
>> Lance Andersen wrote:
>>> Hi Anissa,
>>>
>>> Thank you for the quick turnaround on this issue.
>> Yes, thanks Anissa. It's good to see there is a workaround...
>> Maybe worth adding in the FAQ if we have one, or release notes.
>>
>> Ludo
>>
>>
>>>
>>> Regards
>>> Lance
>>> On Oct 31, 2008, at 2:01 AM, Anissa Lam wrote:
>>>
>>>>
>>>> Thanks Lance for filing the issue.
>>>>
>>>> I have fixed Issue 6671
>>>> <https://glassfish.dev.java.net/issues/show_bug.cgi?id=6671> where
>>>> you cannot create a MySQL Connection pool if the driver is
>>>> present. The fix is checked in to the trunk for build 29.
>>>> For anyone who is using GlassFish v3 Prelude release, here is the
>>>> workaround:
>>>>
>>>> When creating the connection pool, just leave the Database Vendor
>>>> dropdown empty. This is not a required field and the info is
>>>> for pre-filling the datasource className for you in the 2nd page.
>>>>
>>>> In the 2nd page, fill in the datasource className accordingly.
>>>>
>>>> *Resource Type*
>>>> *Datasource Classname*
>>>> javax.sql.ConnectionPoolDataSource
>>>> com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
>>>> javax.sql.DataSource
>>>> com.mysql.jdbc.jdbc2.optional.MysqlDataSource
>>>> javax.sql.XADataSource
>>>> com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
>>>>
>>>>
>>>> You will have to fill in the property table with the correct
>>>> property name and value pair.
>>>>
>>>> thanks.
>>>> Anissa
>>>>
>>>>> Just wondering if I am the only person encountering a problem
>>>>> creating a MySQL connection pool as I am getting an Exception
>>>>> on prelude GA (I am on XP) via the admin gui
>>>>>
>>>>>
>>>>> Via the admin gui, I added the following entries for the
>>>>> Connection pool
>>>>>
>>>>> Name: Mysql-testdb-pool
>>>>> Resource: javax.sql.DataSource
>>>>> DataBase Vendor: MySQL
>>>>>
>>>>> And when I hit the next button, i get the following error
>>>>>
>>>>>
>>>>> Note I do not see this for a JavaDB pool.
>>>>>
>>>>> -lance
>>>>>
>>>>> HTTP Status 500 -
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> *type* Exception report
>>>>> *message*
>>>>> *description*The server encountered an internal error () that
>>>>> prevented it from fulfilling this request.
>>>>> *exception* javax.servlet.ServletException:
>>>>> java.lang.reflect.InvocationTargetException while attempting to
>>>>> process a 'command' event for 'nextButton'.
>>>>> *root cause* java.lang.RuntimeException:
>>>>> java.lang.reflect.InvocationTargetException while attempting to
>>>>> process a 'command' event for 'nextButton'.
>>>>> *root cause* java.lang.reflect.InvocationTargetException
>>>>> *root cause* java.lang.RuntimeException:
>>>>> java.lang.reflect.InvocationTargetException while attempting to
>>>>> process a 'beforeCreate' event for 'page1'.
>>>>> *root cause* java.lang.reflect.InvocationTargetException
>>>>> *root cause* java.lang.ClassCastException: java.lang.Boolean
>>>>> cannot be cast to com.sun.appserv.management.config.PropertyConfig
>>>>> *note* _The full stack traces of the exception and its root
>>>>> causes are available in the GlassFish/v3 logs._
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> <mailto:dev-unsubscribe_at_glassfish.dev.java.net> For additional
>>>> commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>> <mailto:dev-help_at_glassfish.dev.java.net>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>