You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Stephane Landelle (JIRA)" <ji...@apache.org> on 2008/08/04 10:55:45 UTC

[jira] Created: (JCR-1703) Oracle JNDI DataSource support

Oracle JNDI DataSource support
------------------------------

                 Key: JCR-1703
                 URL: https://issues.apache.org/jira/browse/JCR-1703
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: core 1.4.5
            Reporter: Stephane Landelle


When org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory tries to get a connection from a JNDI Datasource without login and pasword, if no user/password are specified, they re retrieved as empty strings, not null, so it tries to do a ds.getConnection(user, password), which fails. Please complete the test line 66 as :
if ((user == null || user.length() > 0) && (password == null || password.length() > 0)) {

Sincerely,

Stéphane Landelle

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


[jira] Resolved: (JCR-1703) Oracle JNDI DataSource support

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller resolved JCR-1703.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5

Committed in revision 697717 (trunk).
I'm not sure if it should be applied to 1.4.6 as well.

> Oracle JNDI DataSource support
> ------------------------------
>
>                 Key: JCR-1703
>                 URL: https://issues.apache.org/jira/browse/JCR-1703
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.5
>            Reporter: Stephane Landelle
>            Assignee: Thomas Mueller
>             Fix For: 1.5
>
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> When org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory tries to get a connection from a JNDI Datasource without login and pasword, if no user/password are specified, they re retrieved as empty strings, not null, so it tries to do a ds.getConnection(user, password), which fails. Please complete the test line 66 as :
> if ((user == null || user.length() > 0) && (password == null || password.length() > 0)) {
> Sincerely,
> Stéphane Landelle

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


[jira] Commented: (JCR-1703) Oracle JNDI DataSource support

Posted by "Stephane Landelle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623746#action_12623746 ] 

Stephane Landelle commented on JCR-1703:
----------------------------------------

Hello,

Here is my repository config :
<?xml version="1.0" encoding="ISO-8859-1"?>
<Repository>
    <FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
        <param name="driver" value="javax.naming.InitialContext" />
        <param name="url" value="jcrDS" />
        <param name="schema" value="oracle" />
        <param name="schemaObjectPrefix" value="J_R_FS_" />
    </FileSystem>
    <Security appName="Jackrabbit">
        <AccessManager
class="org.apache.jackrabbit.core.security.SimpleAccessManager" />
        <LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule" />
        <SecurityManager
class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
workspaceName="security">
            <!-- <param name="config" value="${rep.home}/security.xml"/> -->
        </SecurityManager>
    </Security>
    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"
/>
    <Workspace name="${wsp.name}">
        <FileSystem
class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="jcrDS" />
            <param name="schema" value="oracle" />
            <param name="schemaObjectPrefix" value="J_FS_${wsp.name}_" />
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="jcrDS" />
            <param name="schema" value="oracle" />
            <param name="schemaObjectPrefix" value="J_PM_${wsp.name}_" />
            <param name="externalBLOBs" value="false" />
        </PersistenceManager>
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index" />
            <param name="useCompoundFile" value="true" />
            <param name="minMergeDocs" value="100" />
            <param name="volatileIdleTime" value="3" />
            <param name="maxMergeDocs" value="100000" />
            <param name="mergeFactor" value="10" />
            <param name="maxFieldLength" value="10000" />
            <param name="bufferSize" value="10" />
            <param name="cacheSize" value="1000" />
            <param name="forceConsistencyCheck" value="false" />
            <param name="autoRepair" value="true" />
            <param name="analyzer"
value="org.apache.lucene.analysis.standard.StandardAnalyzer" />
            <param name="respectDocumentOrder" value="true" />
            <param name="resultFetchSize" value="2147483647" />
            <param name="extractorPoolSize" value="0" />
            <param name="extractorTimeout" value="100" />
            <param name="extractorBackLogSize" value="100" />
            <param name="indexingConfiguration"
value="${rep.home}/indexing-configuration.xml" />
        </SearchIndex>
    </Workspace>
    <Versioning rootPath="${rep.home}/versions">
        <FileSystem
class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="jcrDS" />
            <param name="schema" value="oracle" />
            <param name="schemaObjectPrefix" value="J_V_FS_" />
        </FileSystem>
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="jcrDS" />
            <param name="schema" value="oracle" />
            <param name="schemaObjectPrefix" value="J_V_PM_" />
            <param name="externalBLOBs" value="false" />
        </PersistenceManager>
    </Versioning>
    <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="${rep.home}/repository/index" />
        <param name="useCompoundFile" value="true" />
        <param name="minMergeDocs" value="100" />
        <param name="volatileIdleTime" value="3" />
        <param name="maxMergeDocs" value="100000" />
        <param name="mergeFactor" value="10" />
        <param name="maxFieldLength" value="10000" />
        <param name="bufferSize" value="10" />
        <param name="cacheSize" value="1000" />
        <param name="forceConsistencyCheck" value="false" />
        <param name="autoRepair" value="true" />
        <param name="analyzer"
value="org.apache.lucene.analysis.standard.StandardAnalyzer" />
        <param name="respectDocumentOrder" value="true" />
        <param name="resultFetchSize" value="2147483647" />
        <param name="extractorPoolSize" value="0" />
        <param name="extractorTimeout" value="100" />
        <param name="extractorBackLogSize" value="100" />
        <param name="indexingConfiguration"
value="${rep.home}/indexing-configuration.xml" />
    </SearchIndex>
    <Cluster id="node_webapp" syncDelay="5">
        <Journal
class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">
            <param name="revision" value="${rep.home}/revision" />
            <param name="driver" value="javax.naming.InitialContext" />
            <param name="url" value="jcrDS" />
            <param name="schema" value="oracle" />
            <param name="schemaObjectPrefix" value="J_C_" />
        </Journal>
    </Cluster>
</Repository>

My problem is actually with the
org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager, not the
bundle one.

I just saw a close ticket (JCR-1562) with similar problem. Would it be
possible to apply the same kind of patch?

Sincerely,

Stéphane


2008/8/18 Thomas Mueller (JIRA) <ji...@apache.org>



> Oracle JNDI DataSource support
> ------------------------------
>
>                 Key: JCR-1703
>                 URL: https://issues.apache.org/jira/browse/JCR-1703
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.5
>            Reporter: Stephane Landelle
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> When org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory tries to get a connection from a JNDI Datasource without login and pasword, if no user/password are specified, they re retrieved as empty strings, not null, so it tries to do a ds.getConnection(user, password), which fails. Please complete the test line 66 as :
> if ((user == null || user.length() > 0) && (password == null || password.length() > 0)) {
> Sincerely,
> Stéphane Landelle

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


[jira] Assigned: (JCR-1703) Oracle JNDI DataSource support

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller reassigned JCR-1703:
-----------------------------------

    Assignee: Thomas Mueller

> Oracle JNDI DataSource support
> ------------------------------
>
>                 Key: JCR-1703
>                 URL: https://issues.apache.org/jira/browse/JCR-1703
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.5
>            Reporter: Stephane Landelle
>            Assignee: Thomas Mueller
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> When org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory tries to get a connection from a JNDI Datasource without login and pasword, if no user/password are specified, they re retrieved as empty strings, not null, so it tries to do a ds.getConnection(user, password), which fails. Please complete the test line 66 as :
> if ((user == null || user.length() > 0) && (password == null || password.length() > 0)) {
> Sincerely,
> Stéphane Landelle

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


[jira] Commented: (JCR-1703) Oracle JNDI DataSource support

Posted by "Stephane Landelle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619862#action_12619862 ] 

Stephane Landelle commented on JCR-1703:
----------------------------------------

Oups, I meant :
if ((user == null || user.length() == 0) && (password == null || password.length() == 0)) {

> Oracle JNDI DataSource support
> ------------------------------
>
>                 Key: JCR-1703
>                 URL: https://issues.apache.org/jira/browse/JCR-1703
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.5
>            Reporter: Stephane Landelle
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> When org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory tries to get a connection from a JNDI Datasource without login and pasword, if no user/password are specified, they re retrieved as empty strings, not null, so it tries to do a ds.getConnection(user, password), which fails. Please complete the test line 66 as :
> if ((user == null || user.length() > 0) && (password == null || password.length() > 0)) {
> Sincerely,
> Stéphane Landelle

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


[jira] Commented: (JCR-1703) Oracle JNDI DataSource support

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623409#action_12623409 ] 

Thomas Mueller commented on JCR-1703:
-------------------------------------

If we do that, then an empty ("") user name and password are not supported any longer.

> if no user/password are specified, they re retrieved as empty strings, not null

I could not reproduce this. In my test case, both the user name and password are null:

<DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
    <param name="url" value="jdbc:h2:~/db/datastore"/>
</DataStore>

Could you provide a test case where user name and password are an empty string in this method, without setting the user name and password properties in the repository.xml / workspace.xml?


> Oracle JNDI DataSource support
> ------------------------------
>
>                 Key: JCR-1703
>                 URL: https://issues.apache.org/jira/browse/JCR-1703
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.5
>            Reporter: Stephane Landelle
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> When org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory tries to get a connection from a JNDI Datasource without login and pasword, if no user/password are specified, they re retrieved as empty strings, not null, so it tries to do a ds.getConnection(user, password), which fails. Please complete the test line 66 as :
> if ((user == null || user.length() > 0) && (password == null || password.length() > 0)) {
> Sincerely,
> Stéphane Landelle

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


[jira] Commented: (JCR-1703) Oracle JNDI DataSource support

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629422#action_12629422 ] 

Thomas Mueller commented on JCR-1703:
-------------------------------------

I think you are right. I propose the following change:

===================================================================
--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java	(revision 693399)
+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java	(working copy)
@@ -100,8 +100,6 @@
         schema = "oracle";
         driver = "oracle.jdbc.OracleDriver";
         schemaObjectPrefix = "";
-        user = "";
-        password = "";
         initialized = false;
     }
 


> Oracle JNDI DataSource support
> ------------------------------
>
>                 Key: JCR-1703
>                 URL: https://issues.apache.org/jira/browse/JCR-1703
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: core 1.4.5
>            Reporter: Stephane Landelle
>   Original Estimate: 0.08h
>  Remaining Estimate: 0.08h
>
> When org.apache.jackrabbit.core.persistence.bundle.util.ConnectionFactory tries to get a connection from a JNDI Datasource without login and pasword, if no user/password are specified, they re retrieved as empty strings, not null, so it tries to do a ds.getConnection(user, password), which fails. Please complete the test line 66 as :
> if ((user == null || user.length() > 0) && (password == null || password.length() > 0)) {
> Sincerely,
> Stéphane Landelle

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