You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by "Scott T Weaver (JIRA)" <je...@portals.apache.org> on 2007/09/21 16:52:50 UTC

[jira] Commented: (JS2-593) NullPointerException whent getting database connection in BatchedStatistics

    [ https://issues.apache.org/jira/browse/JS2-593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529447 ] 

Scott T Weaver commented on JS2-593:
------------------------------------

I had this same issue.  The problem is org.apache.jetspeed.components.rdbms.ojb.ConnectionRepositoryEntry.getConnection() does not override org.apache.commons.dbcp.BasicDataSource.getConnection(), which means that it will try to put together a connection pool from jdbc settings  (which may not exist, causing NPEs) totally ignoring the configured JNDI datasource.  The fix is simple, just override the getConnection() and getConnection(String, String) to first check for a pre-configured JNDI datadsource.  If one exists just delegate to that datasource's getConnection() methods, otherwise delegate to org.apache.commons.dbcp.BasicDataSource getConnection() methods.  I have a fix I will be committing shortly.

> NullPointerException whent getting database connection in BatchedStatistics
> ---------------------------------------------------------------------------
>
>                 Key: JS2-593
>                 URL: https://issues.apache.org/jira/browse/JS2-593
>             Project: Jetspeed 2
>          Issue Type: Bug
>          Components: Persistence and DAO
>    Affects Versions: 2.1-dev
>         Environment: Java 1.5
> Ubuntu 6.0.6
>            Reporter: Cédric Mailleux
>         Attachments: Jetspeed2.1-dev.patch
>
>
> When jetspeed call BatchedStatistics I have a NullPointerException on ds.getConnection(), it seems that my Datasource doesn't have a datasource associated, after debugging it seems that in afterPropertiesSet method of class ConnectionRepositoryEntry we do not save the datasource found into de the datasource field of BasicDataSource.
> I made a patch for you you will find it in attachments

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


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org