[ 
https://issues.apache.org/jira/browse/SOLR-1058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695167#action_12695167
 ] 

Jason Shepherd edited comment on SOLR-1058 at 4/2/09 4:25 PM:
--------------------------------------------------------------

I made one small changed as follows. I have uploaded the changes.

I used the Jndi source by adding the following to my data-config.xml

<dataSource type="JdbcDataSource" jndiName="jndiName" user="username" 
password="password"/>

Changed 
from :

@@ -111,7 +113,9 @@
         throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Could 
not load driver: " + driver, e);
       }
     } else {
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Driver 
must be specified");
+      if(jndiName != null){
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Driver 
must be specified");
+      }
     }
 
     String s = initProps.getProperty("maxRows");



to:

@@ -111,7 +113,9 @@
         throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Could 
not load driver: " + driver, e);
       }
     } else {
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Driver 
must be specified");
+      if(jndiName == null){
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Driver 
must be specified");
+      }
     }
 
     String s = initProps.getProperty("maxRows");

      was (Author: jasinner):
    Changed 
from :

@@ -111,7 +113,9 @@
         throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Could 
not load driver: " + driver, e);
       }
     } else {
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Driver 
must be specified");
+      if(jndiName != null){
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Driver 
must be specified");
+      }
     }
 
     String s = initProps.getProperty("maxRows");



to:

@@ -111,7 +113,9 @@
         throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Could 
not load driver: " + driver, e);
       }
     } else {
-      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Driver 
must be specified");
+      if(jndiName == null){
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Driver 
must be specified");
+      }
     }
 
     String s = initProps.getProperty("maxRows");
  
> JNDI DataImporterHandler
> ------------------------
>
>                 Key: SOLR-1058
>                 URL: https://issues.apache.org/jira/browse/SOLR-1058
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>         Environment: Java Servlet Contaner, for example JBoss, or Tomcat
>            Reporter: Jason Shepherd
>            Assignee: Shalin Shekhar Mangar
>             Fix For: 1.4
>
>         Attachments: SOLR-1058.patch, SOLR-1058.patch, SOLR-1058.patch
>
>
> Please make the Callable<Connection> factory field of the JdbcDataSource a 
> protected field.
> Follow the discussion on the thread linked below, to enable the use of JNDI 
> lookup for a JdbcDataSource this field will need to be set by a subclass 
> (JndiJdbcDataSource).
> http://www.nabble.com/DataImportHandler-that-uses-JNDI-lookup-tt22408996.html

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