[Dspace-tech] 2 Tier Dspace Implementation

7 views
Skip to first unread message

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:42:11 PM8/24/15
to Stuart Lewis [sdl], dspac...@lists.sourceforge.net

Hi! Stuart,

 

(1)     Postgresql 8.2.1-1 was installed on the DB server, dspace.student.main.ntu.edu.sg.

(2)     JDK 1.6.0 and Tomact 6.0 was installed on the Client dspaceweb1.student.main.ntu.edu.sg

(3)     Dspace 1.4.1 was extracted to the client dspaceweb1.

a.       The postgresql-8.2-504.jdbc2.jar  file was copied from the DB server to the client’s “lib” folder

b.    In the client, DSpace config file is modified as db.url = jdbc:postgresql://dspace.student.main.ntu.edu.sg:5432/dspace

c.    The JDBC Driver (db.driver = org.postgresql.Driver) and Database username and password (db.username = dspace, db.password = dspace) was not modified.

 

While giving ant fresh_install from the client dspaceweb1 (Dspace source), database connectivity error from the server is given and build is unsuccessful. I pinged from the client to the server which is fine.

 

Please suggest where I have gone wrong. The error list is given below.

 

Thanks,

Jayan

 

 

 

Database connectivity error:-

 

Buildfile: build.xml

 

compile:

 

install_code:

 

build_wars:

 

init_configs:

 

setup_database:

     [java] 2007-03-26 16:35:24,862 INFO  org.dspace.storage.rdbms.InitializeDatabase @ Initializing Database

     [java] 2007-03-26 16:35:24,878 INFO  org.dspace.core.ConfigurationManager @ DSpace logging installed using log4j.properties

     [java] 2007-03-26 16:35:27,018 FATAL org.dspace.storage.rdbms.InitializeDatabase @ Caught exception:

     [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] Exception: java.net.ConnectException: Connection refused: connect

     [java] Stack Trace:

     [java] java.net.ConnectException: Connection refused: connect

     [java]            at java.net.PlainSocketImpl.socketConnect(Native Method)

     [java]            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

     [java]            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

     [java]            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

     [java]            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

     [java]            at java.net.Socket.connect(Socket.java:519)

     [java]            at java.net.Socket.connect(Socket.java:469)

     [java]            at java.net.Socket.<init>(Socket.java:366)

     [java]            at java.net.Socket.<init>(Socket.java:179)

     [java]            at org.postgresql.core.PGStream.<init>(PGStream.java:59)

     [java]            at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:77)

     [java]            at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)

     [java]            at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)

     [java]            at org.postgresql.jdbc2.Jdbc2Connection.<init>(Jdbc2Connection.java:24)

     [java]            at org.postgresql.Driver.makeConnection(Driver.java:382)

     [java]            at org.postgresql.Driver.connect(Driver.java:260)

     [java]            at java.sql.DriverManager.getConnection(DriverManager.java:582)

     [java]            at java.sql.DriverManager.getConnection(DriverManager.java:185)

     [java]            at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:48)

     [java]            at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)

     [java]            at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840)

     [java]            at org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:175)

     [java]            at java.sql.DriverManager.getConnection(DriverManager.java:582)

     [java]            at java.sql.DriverManager.getConnection(DriverManager.java:207)

     [java]            at org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:717)

     [java]            at org.dspace.storage.rdbms.DatabaseManager.loadSql(DatabaseManager.java:1062)

     [java]            at org.dspace.storage.rdbms.InitializeDatabase.main(InitializeDatabase.java:71)

     [java] End of Stack Trace

     [java]

     [java]            at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:122)

     [java]            at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)

     [java]            at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)

     [java]            at org.postgresql.jdbc2.Jdbc2Connection.<init>(Jdbc2Connection.java:24)

     [java]            at org.postgresql.Driver.makeConnection(Driver.java:382)

     [java]            at org.postgresql.Driver.connect(Driver.java:260)

     [java]            at java.sql.DriverManager.getConnection(DriverManager.java:582)

     [java]            at java.sql.DriverManager.getConnection(DriverManager.java:185)

     [java]            at org.apache.commons.dbcp.DriverManagerConnectionFactory.createConnection(DriverManagerConnectionFactory.java:48)

     [java]            at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)

     [java]            at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840)

     [java]            at org.apache.commons.dbcp.PoolingDriver.connect(PoolingDriver.java:175)

     [java]            at java.sql.DriverManager.getConnection(DriverManager.java:582)

     [java]            at java.sql.DriverManager.getConnection(DriverManager.java:207)

     [java]            at org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:717)

     [java]            at org.dspace.storage.rdbms.DatabaseManager.loadSql(DatabaseManager.java:1062)

     [java]            at org.dspace.storage.rdbms.InitializeDatabase.main(InitializeDatabase.java:71)

 

 

Ping from Cleint to server

 

 

Pinging 155.69.24.192 with 32 bytes of data:

Reply from 155.69.24.192: bytes=32 time<1ms TTL=128

Reply from 155.69.24.192: bytes=32 time<1ms TTL=128

Reply from 155.69.24.192: bytes=32 time<1ms TTL=128

Reply from 155.69.24.192: bytes=32 time<1ms TTL=128

Ping statistics for 155.69.24.192:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 0ms, Maximum = 0ms, Average = 0ms

 

 


From: Stuart Lewis [sdl] [mailto:s...@aber.ac.uk]
Sent: Monday, March 12, 2007 8:50 PM
To: Jayan Chirayath Kurian
Subject: RE: Hi!

 

Hi Jayan,

 

So you're installing the database on one server, and tomcat/DSpace on the other?

 

If that is the case, all you should need to do is edit the following line appropriately (in dspace.cfg):

 

db.url = jdbc:postgresql://localhost:5432/dspace

 

to something like:

 

db.url = jdbc:postgresql://dspacedatabase.ntu.edu.sg:5432/dspace

 

Thanks,

 

 

Stuart

 


From: Jayan Chirayath Kurian [mailto:Ja...@ntu.edu.sg]
Sent: 12 March 2007 09:47
To: Stuart Lewis [sdl]
Subject: Hi!

Hi! Stuart,

 

Hope u had a nice break.

 

Here we are planning to install DSpace in a two-tier fashion. One server holds the entire collection items (publications/articles) and another one holds the DSpace application software. This was suggested since there are huge collections to be imported into DSpace and to maintain the access speed. If I need to implement in a two-tier fashion how shall I proceed with the installation of POSTGRESQL and DSpace 1.4.1. The database connectivity parameter needs to be configured in this case. Could you please suggest how to proceed.

 

Thanks,

Jayan

Stuart Lewis [sdl]

unread,
Aug 24, 2015, 4:42:12 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net
Hi Jayan.

Take a look at the line that says:

[java] org.postgresql.util.PSQLException: Connection refused. Check that
the hostname and port are correct and that the postmaster is accepting
TCP/IP connections.

To do this:

1) Check that postmaster is accepting incoming connections on the
correct port. You can test this by using 'telnet
dspace.student.main.ntu.edu.sg:5432' and seeing if you get a response.

2) Take a look at [postgres]/data/pg_hba.conf to make sure that you have
allowed connections for the dspace user to postgres from dspaceweb1.
That file contains comments about how to configure access.

Hope this helps,


Stuart
_________________________________________________________________

Datblygydd Cymwysiadau'r We Web Applications Developer
Gwasanaethau Gwybodaeth Information Services
Prifysgol Cymru Aberystwyth University of Wales Aberystwyth

E-bost / E-mail: Stuart...@aber.ac.uk
Ffon / Tel: (01970) 622860
_________________________________________________________________



________________________________

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:42:30 PM8/24/15
to Stuart Lewis [sdl], dspac...@lists.sourceforge.net

Hi! Stuart,

 

(1) Initially Telnet from client to server was not working. So Server TELNET service was enabled through services.msc. Telnet dspace.student.main.ntu.edu.sg was getting connected from the client.

 

(2) While giving telnet dspace.student.main.ntu.edu.sg:5432 from the client, the connection was getting refused. The message displayed was "Could not open connection to the host, on port 23: connection failed"

 

(3) In the server, pg_hba was modified to include a single line that gives the IP address of client.

 

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

 

# IPv4 local connections:

host    all         all         127.0.0.1/32          md5

# IPv6 local connections:

#host    all         all         ::1/128               md5

 

host    all         all         155.69.24.194/32          md5

 

(4) Postgresql service was stopped, reloaded configuration and service started again from start menu-postgreSQL options.

 

I think telnet is getting connected but not to the specified port.

Do I need to change “md5” to “trust” or the port No. While installing postgresql the default port no taken by the system was 5432.

 

Could you please suggest

 

Thanks,

Jayan

Michael Judd

unread,
Aug 24, 2015, 4:42:32 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net

Oops, I think the telnet test was meant to be...
telnet dspace.student.main.ntu.edu.sg 5432
You don't actually want to turn on the telnet service. You're just using a telnet client to test whether or not you can connect to the postgresql port.
Good luck!

Regards,

Michael Judd

Nathan Campus, Griffith University.
Brisbane 4111. Australia.

m.j...@griffith.edu.au
07 3735 3801



"Jayan Chirayath Kurian" <Ja...@ntu.edu.sg>
Sent by: dspace-te...@lists.sourceforge.net

27/03/2007 02:18 PM

To
"Stuart Lewis [sdl]" <s...@aber.ac.uk>
cc
dspac...@lists.sourceforge.net
Subject
Re: [Dspace-tech] 2 Tier Dspace Implementation


 -------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
DSpace-tech mailing list
DSpac...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:42:33 PM8/24/15
to Michael Judd, dspac...@lists.sourceforge.net, Stuart Lewis [sdl]

Issuing telnet dspace.student.main.ntu.edu.sg 5432 gives "Could not open connection to the host, on port 5432: connection failed". Any other config files need to be changed in postgresql ?

Thanks,

Jayan

 


Michael Judd

unread,
Aug 24, 2015, 4:42:34 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net

Check that your postgresql startup script (eg. /etc/init.d/postgresql) is passing -i (deprecated) or -p <port> to postmaster.
It looks like you may be able to use /var/lib/pgsql/data/postmaster.opts to specify them.
Check that you have...
tcpip_socket = true
...somewhere in your /var/lib/pgsql/data/postgresql.conf.

Regards,

Michael Judd

Nathan Campus, Griffith University.
Brisbane 4111. Australia.

m.j...@griffith.edu.au
07 3735 3801



"Jayan Chirayath Kurian" <Ja...@ntu.edu.sg>

27/03/2007 02:33 PM

To
"Michael Judd" <m.j...@griffith.edu.au>
cc
<dspac...@lists.sourceforge.net>, "Stuart Lewis [sdl]" <s...@aber.ac.uk>

Michael Judd

unread,
Aug 24, 2015, 4:42:35 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net

Forget the -p <port> suggestion. It has nothing to do with what hosts are allowed to connect. Try -h <hostname> instead. Apparently you can specify * to allow all.
Also it looks like you can specify "listen_addresses <hostname>" in postgresql.conf instead if you want.
I'm just getting this from the man pages for postmaster by the way. :)

Regards,

Michael Judd

Nathan Campus, Griffith University.
Brisbane 4111. Australia.

m.j...@griffith.edu.au
07 3735 3801



Michael Judd <m.j...@griffith.edu.au>
Sent by: dspace-te...@lists.sourceforge.net

27/03/2007 02:52 PM

To
"Jayan Chirayath Kurian" <Ja...@ntu.edu.sg>

https://lists.sourceforge.net/lists/listinfo/dspace-tech -------------------------------------------------------------------------

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:42:39 PM8/24/15
to Michael Judd, dspac...@lists.sourceforge.net, Stuart Lewis [sdl]

Hi,

 

(1) By enabling Telnet service on the DB server, through services.msc, client was able to get connected to the DB server.

(2) While giving telnet dspace.student.main.ntu.edu.sg 5432 from the client, the connection was getting refused. The message displayed was "Could not open connection to the host, on port 5432: connection failed"


(3) In the server, pg_hba was modified to include a single line that gives the IP address/subnet of client.


host    all         all         155.69.24.194         255.255.255.0     trust


(4) In the server, postgresql.cfg file was modified to include

 

tcpip_socket=true

listen_addresses = '*' 

 

(5) netstat on DB server gives

 

 

Active Connections

 

  Proto  Local Address          Foreign Address        State

  TCP    dspace:ms-wbt-server   155.69.104.75:4333     ESTABLISHED

  TCP    dspace:4920            DSPACEDEV1:netbios-ssn  TIME_WAIT

  TCP    dspace:4921            DSPACEDEV1:netbios-ssn  TIME_WAIT

  TCP    dspace:4922            DSPACEDEV1:netbios-ssn  TIME_WAIT

  TCP    dspace:4923            DSPACEDEV1:netbios-ssn  TIME_WAIT

  TCP    dspace:4924            DSPACEDEV1:netbios-ssn  TIME_WAIT

 

(6) netstat on client gives

 

 

Active Connections

 

  Proto  Local Address          Foreign Address        State

  TCP    dspaceweb1:3256        72.5.124.55:http       CLOSE_WAIT

  TCP    dspaceweb1:3257        a203-117-134-209.deploy.akamaitechnologies.com:http  CLOSE_WAIT

  TCP    dspaceweb1:ms-wbt-server  155.69.104.75:3666     ESTABLISHED

 

 

The telnet client connection to server is getting refused.  Please suggest.

James Rutherford

unread,
Aug 24, 2015, 4:42:40 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net, Stuart Lewis [sdl]
On Tue, Mar 27, 2007 at 06:09:33PM +0800, Jayan Chirayath Kurian wrote:
> (1) By enabling Telnet service on the DB server, through services.msc,
> client was able to get connected to the DB server.

As someone else noted, you definitely do not want telnet running on the
server. The use suggested by Stuart was to make sure you could connect
to the postgres tcp port (5432).

> (2) While giving telnet dspace.student.main.ntu.edu.sg 5432 from the
> client, the connection was getting refused. The message displayed was
> "Could not open connection to the host, on port 5432: connection failed"

On the database server, try running

lsof -i tcp:5432

This will let you know whether anything is listening on tcp port 5432.
If it isn't, then postgres has been set up incorrectly. Check to see
what arguments were passed to postgres at startup by running

ps ax | grep post

Which should show something like this:

jim@pomona ~ $ ps ax | grep postmaster
31529 ? S 0:20 /usr/bin/postmaster -i

Note the -i flag which means my postmaster is listening for tcp
connections.

> (3) In the server, pg_hba was modified to include a single line that
> gives the IP address/subnet of client.
>
> host all all 155.69.24.194 255.255.255.0
> trust

That looks fine, but I wouldn't use 'trust' unless you're restricting
access to that machine by some other means; 'md5' would be safer.

> (4) In the server, postgresql.cfg file was modified to include
>
> tcpip_socket=true
>
> listen_addresses = '*'

That looks fine.

I'd check the scripts used to start postgres (usually in /etc/init.d/).
Just make sure the -i flag is being passed at startup. What operating
system is the database server running?

Jim

--
James Rutherford | Hewlett-Packard Limited registered Office:
Research Engineer | Cain Road,
HP Labs | Bracknell,
Bristol, UK | Berks
+44 117 312 7066 | RG12 1HN.
james.ru...@hp.com | Registered No: 690597 England

The contents of this message and any attachments to it are confidential and
may be legally privileged. If you have received this message in error, you
should delete it from your system immediately and advise the sender. To any
recipient of this message within HP, unless otherwise stated you should
consider this message and attachments as "HP CONFIDENTIAL".

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:42:43 PM8/24/15
to James Rutherford, dspac...@lists.sourceforge.net, Stuart Lewis [sdl]
hi! Jim
 
we have Dspace 1.4.1 on Windows 2003 standard edition R2 with tomcat 6.0 and postgresql 8.1
 
(1) i will disable the telnet serive on the server. But disabling telnet service even disconnects telnet IPaddress. (without 5432 port)
(2) in windows, is there any specific directory where i need to run "lsof -i tcp:5432"
(3) For windows environment how shall i execute "ps ax | grep post"
(4)For windows under "data" folder which file i need to check that starts progresql and the -i flag.
Thanks for your reply.
 
Regards,
Jayan



From: James Rutherford [mailto:james.ru...@hp.com]
Sent: Tue 3/27/2007 6:30 PM
To: Jayan Chirayath Kurian
Cc: Michael Judd; dspac...@lists.sourceforge.net; Stuart Lewis [sdl]

Subject: Re: [Dspace-tech] 2 Tier Dspace Implementation

James Rutherford

unread,
Aug 24, 2015, 4:42:44 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net, Stuart Lewis [sdl]
On Tue, Mar 27, 2007 at 08:23:09PM +0800, Jayan Chirayath Kurian wrote:
> we have Dspace 1.4.1 on Windows 2003 standard edition R2 with tomcat
> 6.0 and postgresql 8.1

In this case, everything I said doesn't apply. They're linux commands. I
have no idea how to set up postgres on windows, sorry. There must be
some good postgres-on-windows tutorials out there somewhere.

NS Hashmi, Information Systems and Computing

unread,
Aug 24, 2015, 4:42:49 PM8/24/15
to Ja...@ntu.edu.sg, dspac...@lists.sourceforge.net
Hi Jayan,

The server hosting your database needs to accept outside connections to
port 5432. The issue you have may lie with your firewall settings? You need
to ensure that the firewall on your database host accepts TCP connections
on port 5432. I'm not sure how you would check the firewall settings on
Windows.

Hope this helps.

Naveed


Message: 2
Date: Tue, 27 Mar 2007 20:23:09 +0800
From: "Jayan Chirayath Kurian" <Ja...@ntu.edu.sg>
Subject: Re: [Dspace-tech] 2 Tier Dspace Implementation
To: "James Rutherford" <james.ru...@hp.com>
Cc: dspac...@lists.sourceforge.net, "Stuart Lewis \[sdl\]"
<s...@aber.ac.uk>
Message-ID:
<FBA2B13BA2EFC3499C0E...@EXCHANGE23.staff.main.ntu.edu.sg>

Content-Type: text/plain; charset="iso-8859-1"

hi! Jim

we have Dspace 1.4.1 on Windows 2003 standard edition R2 with tomcat 6.0
and postgresql 8.1

(1) i will disable the telnet serive on the server. But disabling telnet
service even disconnects telnet IPaddress. (without 5432 port)
(2) in windows, is there any specific directory where i need to run "lsof
-i tcp:5432"
(3) For windows environment how shall i execute "ps ax | grep post"
(4)For windows under "data" folder which file i need to check that starts
progresql and the -i flag.

Thanks for your reply.

Regards,
Jayan



--------------------------------------------------------
Naveed Hashmi
Information Systems and Computing
University of Bristol
Naveed...@bristol.ac.uk



Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:43:40 PM8/24/15
to dspac...@lists.sourceforge.net

Hi!

I followed the following steps for 2 tier dspace implementation.

(1) In pg_hba.confg I gave
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 155.69.24.194/32 md5

(2) In Postgresql.confg I gave
listen_addresses = '*'

(3) when "ant fresh_install" was given from client machine, the DB
connection error was not seen but build was not successful. I just
copied the war files to Tomcat webapp folder. Accessing and browsing
items was fine. But submitting a new item gives an internal error. Since
I have not properly build DSpace, the log file was not seen. I am
attaching the command line output when I execute "ant fresh_install".
The error starts with "PSQLException: ERROR: function "getnextid"
already exists with same argument types". Please suggest.

Thanks,
Jayan

Buildfile: build.xml

compile:

install_code:

build_wars:

init_configs:

setup_database:
[java] 2007-04-02 15:15:16,344 INFO
org.dspace.storage.rdbms.InitializeDatabase @ Initializing Database
[java] 2007-04-02 15:15:16,359 INFO
org.dspace.core.ConfigurationManager @ DSpace logging installed using
log4j.properties
[java] 2007-04-02 15:15:16,531 WARN
org.dspace.storage.rdbms.DatabaseManager @ Got SQL Exception:
org.postgresql.util.PSQLException: ERROR: function "getnextid" already
exists with same argument types
[java] org.postgresql.util.PSQLException: ERROR: function
"getnextid" already exists with same argument types
[java] at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecu
torImpl.java:1548)
[java] at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImp
l.java:1316)
[java] at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:
191)
[java] at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stateme
nt.java:452)
[java] at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdb
c2Statement.java:337)
[java] at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stateme
nt.java:329)
[java] at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.
java:261)
[java] at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.
java:261)
[java] at
org.dspace.storage.rdbms.DatabaseManager.loadSql(DatabaseManager.java:11
36)
[java] at
org.dspace.storage.rdbms.InitializeDatabase.main(InitializeDatabase.java
:71)
[java] 2007-04-02 15:15:16,531 WARN
org.dspace.storage.rdbms.DatabaseManager @ Got SQL Exception:
org.postgresql.util.PSQLException: ERROR: relation
"bitstreamformatregistry_seq" already exists
[java] org.postgresql.util.PSQLException: ERROR: relation
"bitstreamformatregistry_seq" already exists
[java] at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecu
torImpl.java:1548)
[java] at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImp
l.java:1316)
[java] at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:
191)
[java] at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stateme
nt.java:452)
[java] at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdb
c2Statement.java:337)
[java] at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stateme
nt.java:329)
[java] at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.
java:261)
[java] at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.
java:261)
[java] at
org.dspace.storage.rdbms.DatabaseManager.loadSql(DatabaseManager.java:11
36)
[java] at
org.dspace.storage.rdbms.InitializeDatabase.main(InitializeDatabase.java
:71)
[java] 2007-04-02 15:15:16,531 WARN
org.dspace.storage.rdbms.DatabaseManager @ Got SQL Exception:
org.postgresql.util.PSQLException: ERROR: relation "fileextension_seq"
already exists

James Rutherford

unread,
Aug 24, 2015, 4:43:44 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net
On Mon, Apr 02, 2007 at 03:57:55PM +0800, Jayan Chirayath Kurian wrote:
> (3) when "ant fresh_install" was given from client machine, the DB
> connection error was not seen but build was not successful. I just
> copied the war files to Tomcat webapp folder. Accessing and browsing
> items was fine. But submitting a new item gives an internal error. Since
> I have not properly build DSpace, the log file was not seen. I am
> attaching the command line output when I execute "ant fresh_install".
> The error starts with "PSQLException: ERROR: function "getnextid"
> already exists with same argument types". Please suggest.

This error is being thrown because the database structure already
exists. How are you able to "access and browse" items if you can't
submit them? It's difficult to figure out exactly how far you've got
with your installation; if you haven't successfully completed a
fresh_install, you shouldn't deploy the WARs and start using DSpace.
Deploying DSpace half-built is definitely a Bad Idea.

If there is no content in your database, I would recommend dropping it
and starting again with a fresh_install.

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:43:48 PM8/24/15
to James Rutherford, dspac...@lists.sourceforge.net
Hi! Jim,
 
sorry for the confusion regarding "How are you able to "access and browse" items if you can't
submit them? ".  Let me explain.
 
(1) Initailly i installed Dspace 1.4.1 and associated software (java,tomcat,postgresql) in "machine1" and imported few items through batch import. DSpace is working fine.
(2) later it was decided to have 2 tier implementation, " machine1" with DB and "machineweb2" with Dspace, java, and Tomcat. The previous configuration of "machine1" was not changed since DSpace was working fine. In "machineweb2" i installed JDK, Tomcat and extracted DSpace 1.4.1. When "ant fresh_install" was given at DSpace source - bin, the build was unsuccessful.
(3) Based on your suggestion, i feel it is due to database structure existing with "machine1" since it was installed with postgresql, java,tomcat, and DSpace software initially .
(4) In this case shall i remove the items already imported or drop the database. How shall i recreate the database once dropped so that it wont effect "machine1" DSpace configuration.
(5) Is it better to reinstall postgresql in "machine1".
(6) Will this effect the existing instance of DSpace running fine on  " machine1".
(7) Is there an option to create a DSpace instance from "machineweb2" without changing existing configuration of "machine1".
 
Thanks for your reply and help.
Only few items are existing in "machine1" and removing them and importing them again is not a big issue.Please suggest how shall i proceed .
 
Thanks,
Jayan


From: James Rutherford [mailto:james.ru...@hp.com]
Sent: Mon 4/2/2007 6:12 PM
To: Jayan Chirayath Kurian
Cc: dspac...@lists.sourceforge.net

Subject: Re: [Dspace-tech] 2 Tier Dspace Implementation

James Rutherford

unread,
Aug 24, 2015, 4:43:56 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net
On Mon, Apr 02, 2007 at 08:44:52PM +0800, Jayan Chirayath Kurian wrote:
> (1) Initailly i installed Dspace 1.4.1 and associated software
> (java,tomcat,postgresql) in "machine1" and imported few items through
> batch import. DSpace is working fine.
> (2) later it was decided to have 2 tier implementation, " machine1"
> with DB and "machineweb2" with Dspace, java, and Tomcat. The previous
> configuration of "machine1" was not changed since DSpace was working
> fine. In "machineweb2" i installed JDK, Tomcat and extracted DSpace
> 1.4.1. When "ant fresh_install" was given at DSpace source - bin, the
> build was unsuccessful.

This is the problem. When you run ant fresh_install it tries to do
everything, including populating the database. All you need to do on
machineweb2 is ant update (and maybe ant init_configs). You shouldn't
need to do anything to the database structure on machine1.

cheers,

Jim

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:44:08 PM8/24/15
to James Rutherford, dspac...@lists.sourceforge.net
Hi! Jim,

(1) In machineweb2 I gave ant update. Build was successful.
(2) Gave ant int_configs and was fine. (Without init_configs system was
giving error while accessing Dspace home page)
(3) When accessing Dspace at http://IP:8080/Dspace it gives an "internal
error". In the log folder, log file was not created.
(4) Gave "ant clean" and then "ant update" and "ant init_configs".
Copied war files and Restarted tomcat. Dspace home page with internal
error message was displayed. ((A) OUTPUT 1)
(5) Tried creating another DSpace installation folder and performed the
same steps. ((B) OUTPUT 2). This time ant init_configs gave the message
" [copy] Copying 32 files to E:\dspace\config
[copy] Copying 1 file to E:\dspace\config"

(6) Gave SMTP arguments thinking it may throw internal error if not
configured.

The output messages are copied in. Could you please suggest how to
proceed with debugging the "internal error".

Thanks,
Jayan




(A) OUTPUT 1

E:\DSpace141>ant clean
Buildfile: build.xml

clean:
[delete] Deleting directory E:\DSpace141\build

BUILD SUCCESSFUL
Total time: 0 seconds
E:\DSpace141>ant update
Buildfile: build.xml

compile:
[mkdir] Created dir: E:\DSpace141\build\classes
[javac] Compiling 233 source files to E:\DSpace141\build\classes
[javac] E:\DSpace141\src\org\dspace\app\oai\DIDLCrosswalk.java:55:
warning:
sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a
future rel
ease
[javac] import sun.misc.BASE64Encoder;
[javac] ^
[javac] E:\DSpace141\src\org\dspace\app\oai\DIDLCrosswalk.java:238:
warning:
sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a
future re
lease
[javac] BASE64Encoder
encoder=(BASE64Enc
oder) Class.forName("sun.misc.BASE64Encoder").newInstance();
[javac] ^
[javac] E:\DSpace141\src\org\dspace\app\oai\DIDLCrosswalk.java:238:
warning:
sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a
future re
lease
[javac] BASE64Encoder
encoder=(BASE64Enc
oder) Class.forName("sun.misc.BASE64Encoder").newInstance();
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 3 warnings

install_code:
[jar] Building jar: E:\dspace\lib\dspace.jar

build_wars:
[copy] Copying 1 file to E:\DSpace141\build
[mkdir] Created dir: E:\DSpace141\build\jsp
[copy] Copying 220 files to E:\DSpace141\build\jsp
[copy] Copying 1 file to E:\DSpace141\build\classes
[war] Building war: E:\DSpace141\build\dspace.war
[copy] Copying 1 file to E:\DSpace141\build
[war] Building war: E:\DSpace141\build\dspace-oai.war

update:
[echo]
[echo]
====================================================================

[echo] Copied language packs into E:/dspace/config
[echo]
[echo]
====================================================================

[echo] Updated Web application (.war) files are in the 'build'
directory.


BUILD SUCCESSFUL
Total time: 14 seconds
E:\DSpace141>ant init_configs
Buildfile: build.xml

init_configs:

BUILD SUCCESSFUL


(B) OUTPUT 2

E:\DSpace141>ant update
Buildfile: build.xml

compile:

install_code:
[mkdir] Created dir: E:\dspace\config
[mkdir] Created dir: E:\dspace\assetstore
[mkdir] Created dir: E:\dspace\handle-server
[mkdir] Created dir: E:\dspace\history
[mkdir] Created dir: E:\dspace\search
[mkdir] Created dir: E:\dspace\log
[mkdir] Created dir: E:\dspace\upload
[mkdir] Created dir: E:\dspace\bin
[mkdir] Created dir: E:\dspace\lib
[mkdir] Created dir: E:\dspace\reports
[copy] Copying 22 files to E:\dspace\bin
[copy] Copying 71 files to E:\dspace\lib
[jar] Building jar: E:\dspace\lib\dspace.jar

build_wars:

update:
[copy] Copying 1 file to E:\dspace\config
[echo]
[echo]
====================================================================

[echo] Copied language packs into E:/dspace/config
[echo]
[echo]
====================================================================

[echo] Updated Web application (.war) files are in the 'build'
directory.

BUILD SUCCESSFUL
Total time: 2 seconds
E:\DSpace141>ant init_configs
Buildfile: build.xml

init_configs:
[copy] Copying 32 files to E:\dspace\config
[copy] Copying 1 file to E:\dspace\config

BUILD SUCCESSFUL

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:44:41 PM8/24/15
to dspac...@lists.sourceforge.net
Hi!,

Stuart Lewis [sdl]

unread,
Aug 24, 2015, 4:44:42 PM8/24/15
to Jayan Chirayath Kurian, dspac...@lists.sourceforge.net
Hi Jayan,

> The output messages are copied in. Could you please suggest how to proceed
> with debugging the "internal error".

2 things:

1) Try to get the logging working. Make sure that
E:\dspace\config\log4j.properties contains the correct location for for the
log file (something like E:\dspace\logs)

If this does not work, try:

2) Often you can find the problem with an internal error by looking at the
source of the internal error page. Near the bottom there will either be a
stack trace or an error saying no stack trace is available.

Good luck,

Jayan Chirayath Kurian

unread,
Aug 24, 2015, 4:44:57 PM8/24/15
to dspac...@lists.sourceforge.net, Stuart Lewis [sdl]
Thanks Jim, Stuart for your suggestions.

Since my initial attempts for a 2 tier DSpace implementation was not
fine I went for a fresh installation and is working fine.

Steps taken are:-

(1) Install postgre.sql in DB server. While installing, host
connection check box can be enabled for remote connections. The
postgre.sql file is configured automatically.
(2) DSpace user and Dspace database owned by dspace user is created
in postgresql DB server.
(3) Pg_hba file is edited and added my machine IP address. DB
service is started for taking the new configuration.
(4) In DSpace client, db.url config parameter is modified to include
jdbc:postgresql://IP address : 5432/dspace
(5) Ant fresh_install was given at DSpace client machine and
installation was fine. Batch import and normal submission interface was
also working fine.

Thanks,
Jayan

-----Original Message-----
From: Stuart Lewis [sdl] [mailto:s...@aber.ac.uk]
Sent: Monday, April 09, 2007 7:31 PM
To: Jayan Chirayath Kurian
Subject: Re: [Dspace-tech] 2 Tier Dspace Implementation (windows 2003
serveredition/Dspace 1.4.1)

Hi Jayan,


Try changing:

> # A1 is set to be a ConsoleAppender.
> log4j.appender.A1=org.apache.log4j.ConsoleAppender

to:

# A1 is set to be a RollingFileAppender.
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.File=/dspace/log/dspace.log
# Roll when log file size is over 1Mb
log4j.appender.A1.MaxFileSize=1048576
# Keep up to 500 files around
log4j.appender.A1.MaxBackupIndex=500

You'll need to change log4j.appender.A1.File to something like
E:\dspace`log`dspace.log

This log file should then start filling up.

Hope this helps,
Reply all
Reply to author
Forward
0 new messages