[
http://jira.dspace.org/jira/browse/DS-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jeffrey Trimble closed DS-446.
------------------------------
Documentation Status: Complete or Committed (was: Needed)
Resolution: Fixed
Command has been added to System Administration Chapter.
> New ant step - test_database
> ----------------------------
>
> Key: DS-446
> URL: http://jira.dspace.org/jira/browse/DS-446
> Project: DSpace 1.x
> Issue Type: Improvement
> Affects Versions: 1.5.0, 1.5.1, 1.5.2
> Reporter: Stuart Lewis
> Assignee: Jeffrey Trimble
> Priority: Minor
> Fix For: 1.6.0
>
> Attachments: check-db-ant.patch
>
>
> This patch adds a new ant target 'test_database'. It adds a main() method to
> DatabaseManager.java which tests a connection to the database and prints out
> any error messages.
> Ant's build.xml is updated to run this target as the first dependency of
> fresh_install, so that if the database connection defined in dspace.cfg is
> not good nothing else will happen (e.g. dspace.home and its directories will
> not be created) and an error message will appear. There is no point in
> performing any subsequent step if the DB isn't configured correctly.
> E.g.:
> ant fresh_install
> Buildfile: build.xml
> test_database:
> [java] 2010-01-03 20:55:31,724 INFO
> org.dspace.core.ConfigurationManager @ Loading system provided config
> property (-Ddspace.configuration): config/dspace.cfg
> [java] 2010-01-03 20:55:31,729 INFO
> org.dspace.core.ConfigurationManager @ Using default log4j provided log
> configuration,if uninitended, check your dspace.cfg for (log.init.config)
> [java]
> [java] Attempting to connect to database:
> [java] - URL: jdbc:postgresql://localhost:54321/dspace
> [java] - Driver: org.postgresql.Driver
> [java] - Username: dspace
> [java] - Password: dspace
> [java] - Schema: null
> [java]
> [java] Testing connection...
> [java]
> [java] Error:
> [java] - org.postgresql.util.PSQLException: Connection refused. Check
> that the hostname and port are correct and that the postmaster is accepting
> TCP/IP connections.
> [java]
> [java] Please see the DSpace documentation for assistance.
> [java]
> BUILD FAILED
> /Users/stuartlewis/IntelliJ-Projects/16/dspace/target/dspace-1.6.0-SNAPSHOT-build.dir/build.xml:599:
> Java returned: 1
> Or on a successful build...
> ant fresh_install
> Buildfile: build.xml
> test_database:
> [java] 2010-01-03 20:56:35,677 INFO
> org.dspace.core.ConfigurationManager @ Loading system provided config
> property (-Ddspace.configuration): config/dspace.cfg
> [java] 2010-01-03 20:56:35,682 INFO
> org.dspace.core.ConfigurationManager @ Using default log4j provided log
> configuration,if uninitended, check your dspace.cfg for (log.init.config)
> [java]
> [java] Attempting to connect to database:
> [java] - URL: jdbc:postgresql://localhost:5432/dspace
> [java] - Driver: org.postgresql.Driver
> [java] - Username: dspace
> [java] - Password: dspace
> [java] - Schema: null
> [java]
> [java] Testing connection...
> [java] Connected succesfully!
> [java]
> init_installation:...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.dspace.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel