[ 
https://issues.apache.org/jira/browse/GERONIMO-3051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12486145
 ] 

Paul McMahan commented on GERONIMO-3051:
----------------------------------------

JSTL is not the culprit, at least not directly.  It uses the TCCL to load the 
driver classes.  The setDataSource tag completes successfully.  Its the 
subsequent calls that try to run queries on the db that fail.

The problem is that JSTL relies on java.sql.DriverManager#getConnection() to 
set up its connections to the database.  That method does *not* use the TCCL to 
load drivers.   Instead it determines the classloader of whoever called it and 
uses that classloader to try to load the driver.  In this case the caller is 
JSTL and its classloader is the jee specs config classloader, which obviously 
does not have the derby classes.

The javadoc for this getConnection() method says:
{quote}
When the method getConnection is called, the DriverManager will attempt to 
locate a suitable driver from amongst those loaded at initialization and those 
loaded explicitly using the same classloader as the current applet or 
application.
{quote}

I don't understand the rationale for this design (security?) but I think it 
forces Geronimo to move the JSTL classes to the default env for webapps since 
that is where the database drivers will most likely be loaded from.   From that 
perspective the patch looks right, except I would also like to understand why 
the JSTL deps are added to the deployers.

> DB Viewer portlet error
> -----------------------
>
>                 Key: GERONIMO-3051
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3051
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: console, databases
>    Affects Versions: 2.0-M4
>         Environment: embedded Derby databases
>            Reporter: Hernan Cunico
>         Attachments: GERONIMO-3051.patch
>
>
> There is a problem when trying to view an embedded Derby database.
> I am able to successfully create a new DB with the DB manager and a new entry 
> appears in the DB Viewer but when I try to view that DB from the DB Viewer I 
> get a portlet error.
> When I check the logs I get this:
> 09:57:02,421 ERROR [listTables_jsp]] Servlet.service() for servlet 
> jsp.WEB_002dINF.view.internaldb.listTables_jsp threw exception
> javax.servlet.ServletException: javax.servlet.jsp.JspTagException: Error 
> getting connection: "java.sql.SQLException: No suitable driver"
> ...
> 09:57:02,421 ERROR [[DBViewer]] Servlet.service() for servlet DBViewer threw 
> exception
> javax.servlet.ServletException
> ...
> 09:57:02,453 ERROR [PortletInvokerImpl] PortletInvokerImpl.render() - Error 
> while dispatching portlet.
> javax.portlet.PortletException
> ...
> With the exception of the "SystemDatabase" all the other databases created on 
> the embedded Derby are also unaccessible from other applications.

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