[ 
https://issues.apache.org/jira/browse/BEANUTILS-327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743233#action_12743233
 ] 

David Schlenk commented on BEANUTILS-327:
-----------------------------------------

I can across this today and did the same fix and then found it here. Woohoo. 
Anyway, that problems would it cause? I'm not a reflection expert by any means 
but from what I can tell there doesn't seem to be much functional difference 
between the two methods, especially when using the 3 parameter version of 
Class.forName where you define the class loader to use and use false so that 
the class is not instantiated until it's actually used. 

In any event I've tested it with this fix in a standalone single threaded 
console application and a web application running on jboss 4.0.x using tomcat55 
for the servlet container and it works fine in either environment. 

> JDBCDynaClass throws class not found exception under java6
> ----------------------------------------------------------
>
>                 Key: BEANUTILS-327
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-327
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: DynaBean
>    Affects Versions: 1.8.0
>         Environment: Windows XP
> Suse Linux
> Java6
>            Reporter: Sascha Riemann
>
> Using ResulsetDynaClass with a byte array (e.g. varbinary) throws a class not 
> found exception.
> Doing some research on the web, i found the following entry  
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6516909,
> Patching the JDBCDynaClass was quiet easy.
>  protected Class loadClass(String className) throws SQLException {
>         try {
>             ClassLoader cl = Thread.currentThread().getContextClassLoader();
>             if (cl == null) {
>                     cl = this.getClass().getClassLoader();
>             }
>             // return (cl.loadClass(className));
>             // FIX: for 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6516909
>             return (Class.forName(className, false, cl));
>         } catch (Exception e) {
>             throw new SQLException(
>                     "Cannot load column class '" + className + "': " + e);
>         }
>     }

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

Reply via email to