On Tue, Jan 22, 2013 at 04:03:08PM +0100, [email protected] wrote: > today i configured my Tomcat to serve a JNDI Resource > To do that i read the very ugly tomcat documentation and found that > link > http://dspace.2283337.n4.nabble.com/I-note-that-db-jndi-is-still-undocumented-in-3-x-td4658214.html > I activated the db.jndi = jdbc/dspace configuration in dspace.cfg > I added the following lines in my context.xml and the applications > solr, oai and xmlui are working well. > > <Resource > name="jdbc/dspace" > auth="Container" > type="javax.sql.DataSource" > driverClassName="org.postgresql.Driver" > url="jdbc:postgresql://127.0.0.1:5432/dspace" > username="dspace" > password="mypassword" > maxActive="30" > maxIdle="10" > maxWait="240000" > timeBetweenEvictionRunsMillis="900000" > numTestsPerEvictionRun="30" > minEvictableIdleTimeMillis="300000" > testWhileIdle="true" > validationQuery="select 1" > removeAbandoned="true" > removeAbandonedTimeout="600" > logAbandoned="true" /> > > Now executing /opt/dspace/bin/dspace oai import -c -v > That won't work ... see error below > What can i do if i have to go through a SPI Firewall that allows me > only to connect if it is a tomcat connection configured as JNDI?
I don't understand what the firewall has to do with this. But, if you *must* use JNDI to locate your DSpace database connection, then you'll need to provide a JNDI server to bin/dspace, as Tomcat is to your DSpace webapp.s. There are a number of providers included with the JRE which can connect to various directory services; or... [modest cough] http://java.net/projects/ephemeral-context is a small in-process JNDI server that can be wrapped into any Java application, for instance bin/dspace. You define a system property naming its ContextFactory as providing the initial context: -Djava.naming.factory.initial=net.wood.jndi.EphemeralContext.ContextFactory" and another telling the provider where to find its content: -Djava.naming.provider.url=/jndi-content.xml" Place the provider JAR and its configuration somewhere in the classpath. You don't need to run any other processes. It's designed to be used the same way you use Tomcat's <Resource> plumbing, to substitute for a big separate directory service. To use it with bin/dspace, add those definitions to ${JAVA_OPTS} in the command's environment. It's a bit rough yet, and objects other than JDBC connections are not at all well tested (or in some cases even tried yet). But I'm using it in production to provide a database connection to bin/dspace in a script. -- Mark H. Wood, Lead System Programmer [email protected] There's an app for that: your browser
pgp0VDo5dOi5t.pgp
Description: PGP signature
------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnnow-d2d
_______________________________________________ DSpace-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

