[greenstone-devel] Re: [greenstone-users] GSDL query - collection connection

From Anupama of Greenstone Team
DateWed Jul 23 12:07:37 2008
Subject [greenstone-devel] Re: [greenstone-users] GSDL query - collection connection
In-Reply-To (487D8186-2020806-gmail-com)
Hi Atanu,

> But after rebooting the system the connection of GSDL librarian
> interface to the collection is lost. the collection as can be seen is
> located in the same file structure but could not see any reason
> why this connection is failed. What are the reasons?

Are you using the binary releases of Greenstone 2 and Greenstone 3?

Do you use GSDL 2.80 and then GSDL 3.03 alternatively to export
documents to Fedora?

The reason why I am asking this second question is as follows:

a. The Perl script that Greenstone uses to export items into Fedora
needs to tell Fedora where to find the FedoraMETS documents (generated
by Greenstone) to ingest. It does so by creating a file called gsdl.xml
located in your fedora/tomcat/conf/Catalina/localhost folder. The
gsdl.xml file that Greenstone contains the full path to the parent
folder of Greenstone's "collect" directory, and its contents are:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/full/path/to/greenstone3/web/sites/localsite/"

In this way, Fedora knows where to look for the documents it has to
ingest (and that that directory is mapped to the alias /gsdl).

b. In order to create that gsdl.xml file, the Perl script has to check
whether the file already exists and contains the correct path. If it
does't, it has to first shutdown the Fedora server, create that file,
then restart the Fedora server. (If you wish to view the Perl script in
question, it is at greenstone3/gs2build/perllib/g2futil.pm and the
subroutine is called "write_gsdl_xml_file".)

It may be that the problem you are encountering is turning up in this
second step. If you change between using Greenstone 2 and then
Greenstone 3 to put documents into Fedora, GLI will have to keep
stopping and restarting the Fedora server in order to regenerate the
gsdl.xml file containing the different locations for the two
greenstones' respective collect directories.

There may be several reasons for the connection failure problem, but I
am hopeful that most (or all) of these have been resolved in some
corrections made recently to some crucial files related to exporting to

Steps (A) below assume that you are working with the most up-to-date
version of Greenstone 3 and Greenstone 2 from the code repository. I do
not know to what extent (A) may help if you are working with binary
releases, perhaps (B) may help you for the time being instead.
(If you wish to install the Greenstone 3 or 2 from the latest source
code, please see
and http://wiki.greenstone.org/wiki/index.php/Installing_Greenstone in
which case you can skip (A) altogether.)

1. First make backup copies of the following files, just so that you can
revert back to a working version in case my suggestion doesn't help at
all (or in case the rest of your greenstone installations are not in
sync with the changes made in the code repository):
- greenstone3/perllib/g2futil.pm
- greenstone3/perllib/plugouts/FedoraMETSPlugout.pm
- greenstone3/perllib/plugouts/METSPlugout.pm
(And possibly
- greenstone3/bin/script/g2f-import.pl
- greenstone3/bin/script/g2f-buildcol.pl as well.)

2. Get the latest versions of the same from the Greenstone svn
repository and put them in the same locations on your computer as above:
- http://trac.greenstone.org/browser/gsdl/trunk/perllib/g2futil.pm
- http://trac.greenstone.org/browser/gsdl/trunk/bin/script/g2f-import.pl
- http://trac.greenstone.org/browser/gsdl/trunk/bin/script/g2f-buildcol.pl

3. Please also look at the file

IF having made the above changes still does not fix the problem you are
facing, please write back and could you then also copy the output of
your build message log that indicates the failure? While we look at any
remaining problems, I have a suggestion that you can temporarily try out:

1. You can manually create the gsdl.xml file with contents of the form
shown further above and put it into your
fedora/tomcat/conf/Catalina/localhost folder each time you swap between
using the two Greenstone versions. It will require you to stop the
fedora server while putting the file in there and then restart it again
thereafter. In this way, your GLI will not find the gsdl.xml is there
and contains the correct location and won't have to do anything to the
2. If you are working with the binary releases of GS2 or GS3, then see
the attached file FLI_README.txt. If you are working with up-to-date
code from the Greenstone repository, then see the updated file

Another reason why things may be going wrong:
Both Greenstone 3 and Fedora use the environment variable CATALINA_HOME
which points to fedora. However, for Fedora, CATALINA_HOME points to
Fedora's tomcat while for Greenstone 3, CATALINA_HOME should point to
its Tomcat. (Greenstone 2 does not use Tomcat.) Recently, a messy
solution has been attempted to resolve this: while g2futil.pm needs to
stop and start the fedora server to create the gsdl.xml, it stores the
CATALINA_HOME environment variable and sets it to Fedora's tomcat. Once
it finishes, it restores CATALINA_HOME to whatever it was before.

Sometime this week I hope to make Greenstone 3's Tomcat become Fedora's
Tomcat by choosing to customise Fedora's installation. If this turns out
to be possible, then there should no longer be a conflict regarding the
CATALINA_HOME environment variable and maybe some further problems
related to this may get resolved.


Atanu Garai wrote:
> Dear All,
> Greetings to all. So far, I have not searched the mailing list archive
> for this problem and hence if it is being repeated, please bear with me.
> We are building a large-scale digital library, which is based on fedora
> and we are a group of people distributed at various places. We were
> looking for a desktop based solution which we can work with offline,
> process the collection and then batch import-export to this fedora-based
> solution. This is where GSDL comes in and after having
> downloaded/installed/run both GSDL 2.80 and 3.03, it seems that GSDL can
> perform this task.
> One problem at this point I am facing is that, when I am installing and
> running this in my local system (Win XP SP 3) for the first time, it
> works very fine. But after rebooting the system the connection of GSDL
> librarian interface to the collection is lost. the collection as can be
> seen is located in the same file structure but could not see any reason
> why this connection is failed. What are the reasons?
> Then the OAI-PMH harvestor is able to load some 500 records at a time
> and then it stops. How is it possible to load all the records at once?
> Thanks for the help.
> --
> Atanu
> ------------------------------------------------------------------------
> _______________________________________________
> greenstone-users mailing list
> greenstone-users@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-users