Hi All, I'm new to solr and I don't have much experience in java. I'm trying to setup two environments with configuration files that mirror each other so that it's easy to copy files across after changes have been made. The problem is that they both access different sql servers. So I want to separate the data source from the data-import.xml.
I'm trying to do that with JNDI following this doc http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html I put the datasource as a resource in my /etc/tomcat6/Catalina/localhost/solr.xml (Context) <Resource name="jdbc/DATABASENAME" auth="Container" type="JdbcDataSource" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://SQLSERVERNAME;databaseName=DATABASENAME;responseBuffering=adaptive;" user="USERNAME" password="PASSWORD" /> and the resource ref in /var/lib/tomcat6/webapps/solr/WEB-INF/web.xml <resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/DATABASENAME</res-ref-name> <res-type>JdbcDataSource</res-type> <res-auth>Container</res-auth> </resource-ref> Then I changed the data-config.xml to <dataSource jndiName="java:comp/env/jdbc/DATABASENAME" type="JdbcDataSource" user="" password=""/> I restart the server and try to do a delta import and I get the following: SEVERE: Delta Import Failed org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: select 1 as report_id Processing Document # 1 at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:72) at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:253) at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:210) at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:39) at org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:59) at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextModifiedRowKey(SqlEntityProcessor.java:84) at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextModifiedRowKey(EntityProcessorWrapper.java:262) at org.apache.solr.handler.dataimport.DocBuilder.collectDelta(DocBuilder.java:893) at org.apache.solr.handler.dataimport.DocBuilder.doDelta(DocBuilder.java:285) at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:179) at org.apache.solr.handler.dataimport.DataImporter.doDeltaImport(DataImporter.java:390) at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:429) at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:408) Caused by: javax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321) at org.apache.naming.NamingContext.lookup(NamingContext.java:793) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContext.lookup(NamingContext.java:781) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContext.lookup(NamingContext.java:781) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContext.lookup(NamingContext.java:781) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152) at javax.naming.InitialContext.lookup(InitialContext.java:409) at org.apache.solr.handler.dataimport.JdbcDataSource$1.call(JdbcDataSource.java:140) at org.apache.solr.handler.dataimport.JdbcDataSource$1.call(JdbcDataSource.java:128) at org.apache.solr.handler.dataimport.JdbcDataSource.getConnection(JdbcDataSource.java:363) at org.apache.solr.handler.dataimport.JdbcDataSource.access$200(JdbcDataSource.java:39) at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:240) ... 11 more I've tried a couple of different alterations, I've only really succeeded in changing the error I get. Anyone know how fix this issue? I'm kind of lost here. Stephen