JeromeDL/WindowsInstallation
From Corrib Clan Wiki
Contents |
Windows Installation Guide v0.2
I. Preparations
1.Download Jerome source files using cvs.
Jerome source can be found on the cvs server hosted by sourceforge. Cvs root is: :pserver:anonymous@cvs.sourceforge.net:/cvsroot/jeromedl
There are many windows cvs clients available, most popular are: WinCvs - www.wincvs.org TortoiseCVS - http://sourceforge.net/projects/tortoisecvs/ ( www.tortoisecvs.org )
The cvs command for downloading all sources into directory Elvis on your hard drive:
cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/jeromedl checkout -kb Elvis
Important: While downloading under windows remember about the -kb command so no files are corrupted !
2.Download & install Tomcat server.
You can get Tomcat binaries from: http://jakarta.apache.org/tomcat/
After downloading run the installer it will do all the configuration for you.
When installed you can run tomcat as a service using Tomcat monitor. To check if everything is ok open the Tomcat manager via browser typing: http://127.0.0.1:[tomcat port]
JeromeDL using Tomcat on port 8081, the standard is 8080. You must decide whether to change the Tomcat port or make about 10 changes in the code.
To check any for possible errors see tomcat logs under: $(Tomcat_dir)\logs You surly have to visit this directory more then once in next steps.
3.Download eXist XML database.
Exist is available at: http://exist.sourceforge.net/
You can either download a jar installer or war archive. If you choose the jar, you must install all the eXist files into a chosen directory under $(Tomcat_dir)\webapps\ . In you downloaded the compressed war version simply copy the war file to $(Tomcat_dir)\webapps\ or deploy it using tomcat manager.
After deploying check if you get any exceptions. If you do then you'll have to change the paths for exist logs. They are stored in $(exist_dir)\WEB-INF\classes\log4j.xml. You have to change paths for xmldb.log and exist.log from relative to full (and make sure that the directory you specify is actually present, if not create it).
When deployed open exist control panel using the browser. You can access it via Tomcat admin or directly typing: http://127.0.0.1:[tomcat port]/[your exist dir name]
In the control panel login as admin and create user named “jeromedl” with chosen password in a group named “D0ndek”. Logout and login again as jeromedl. Create the following resources:
/db/jeromedl
* /db/jeromedl/doc /db/jeromedl/books /db/jeromedl/marc21 /db/jeromedl/request /db/jeromedl/bibtex /db/jeromedl/request
/db/jeromedl/foafreg /db/jeromedl/i18n
4.Download & install Mysql database server.
You can download it from : http://www.mysql.com/
The whole installation process it pretty straightforward. To make working with MySql easier you can download MySql ControlCenter. It is located at: http://www.mysql.com/products/mysqlcc/
JeromeDL requires you to create 2 databases named: jeromedl foafrealm
The databases are filled with tables by jerome so you don't have to create any. Next thing to do is create users: "jenaj" with password "12345" "jenaf" with password "123"
After that grant those users the rights to created at the beginning databases.
5. Download & unpack jena.
Jena is a semantic web framework for java it can be found on: http://jena.sourceforge.net/
After downloading only unpack the files to desired location.
6. Download and install JAI.
JAI files can be found on sun website: http://java.sun.com/products/java-media/jai/
In the windows download section there are available 3 types of installation files JRE, JDK and plain. Download the jdk ones (for example jai-1_1_2_01-lib-windows-i586-jdk). Run the installer it will copy all the required jar files to your J2SE JDK directory.
7. Download & unpack ant.
Files can be download from: http://ant.apache.org/
Ant is a tool used to automate the compilation process. It requires only downloading and unpacking. You also have to set the appropriate system variables: $ANT_HOME = path to your ant dir add to your $PATH variable, path to $(ANT_HOME)\bin
II. Recompiling Jerome web application.
This and the next part are written mostly in a journal-like way. They describe the process step-by-step exposing various errors (and way of dealing with them) that you might but not must encounter.
1. Copy files.
At this moment we will only be interested in the core part of the application located in WEB-APP. Copy the source files from it to $(Tomcat_dir)\webapps\[chosen dir name].
[chosen dir name]- you can choose whatever name you like in which jeromedl will be stored but to simplify things from this moment on we will call this directory “jeromedl”. (I recommend to have such name)
2. First compilation.
The file containing all installation info is: $(Tomcat_dir)/webapps/jeromedl/WEB-INF/build.xml Edit it and change the paths to “pathToWebInf” , “j2se” and “jena_home” so they match yours.
Via command line go to $(Tomcat_dir)/webapps/jeromedl/WEB-INF/ . To compile simply type ant. If the paths set in “1. Preparation “ and build.xml are correct you should see many lines describing the compilation process. Unfortunately Jerome won't compile without errors almost for sure. Take a look at the next steps to see what you have to change to make things work.
3. Getting rid of errors.
Below you can see various advices describing how to configure and change jerome to fit your system. They are ordered in the same way as the author of this document has coped with them so you might directly fallow them one after another but depending on your situation you can also choose a specified topic to gain help with solving your problem.
3.1. Changing the configuration files.
The most basic thing is to change the server address to yours and paths so they match your jerome installation directory. Take a look at those files, browse through them and change them to match your system:
$(Tomcat_dir)/webapps/jeromedl/xml/dtd/namespaces.dtd $(Tomcat_dir)/webapps/jeromedl/WEB-INF/web.xml $(Tomcat_dir)/webapps/jeromedl/WEB-INF/fop/conf/userconfig.xml $(Tomcat_dir)/webapps/jeromedl/WEB-INF/fop/conf/config.xml $(Tomcat_dir)/webapps/jeromedl/WEB-INF/rtf2fo/plugins/wmf2png.config $(Tomcat_dir)/webapps/jeromedl/WEB-INF/rtf2fo/conf/nsdc.properties
After changing try to recompile and see what happens.
3.2. DTD file problems.
If ant throws you an error that he can't find a DTD file (for example namespaces.dtd) similar to: [xslt] : Error! \www\webapps\ELVIS\xml\dtd\namespaces.dtd
that means you have to change path to it in all *.xsl files stored in $(Tomcat_dir)/webapps/jeromedl/ Search this dir for .xsl files containing the false path that ant will print(to be exact it's the linux formatted path “www/webapps/jeromedl”) , change all of them.
Most probably all those files will be located in $(Tomcat_dir)/webapps/elvis/xsl and they will be: admin.xsl book.xsl bookElement.xsl bookField.xsl bookInfo.xsl checkXml.xsl fo2html.xsl help.xsl indexProperty.xsl marcFormat.xsl menu.xsl model.xsl oneBookInfo.xsl pkt.xsl preview.xsl queryProperty.xsl queryType.xsl rdfFields.xsl rdfs.xsl scannedBookChapter.xsl search.xsl searchResults.xsl sortedBookInfo.xsl
These should be all files you have to change however as stated before due to constant changes made in JeromeDL it is recommended that you search for them on your own.
MSWindows paths should be in the same format as in example below: "file:///c:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\elvis\xml\dtd\namespaces.dtd"
After you finish recompile.
3.3. ConvertRTF.java error.
This error is connected with RTF2fo library. As you can probably guess it's a library used to convent rtf files to xml. That error: [javac] E:\jeromeDL\luty2k5\Tomcat 5.5\webapps\elvis\WEB-INF\src\com\skruk\e lvis\beans\ConvertRTF.java:37: package ru.novosoft.dc.core does not exist
Basicly means that ant cannot find rtf2fo jar file in libs directory (which contains the core class). There are to ways of solving that problem:
a) Check the$(Tomcat_dir)/webapps/jeromedl/WEB-INF/lib and see if there are any file names similar to rtf2fo.jar (additionally containing date or some numbers concerning version number like rdf-api-2001-01-19.jar). Change the name to rtf2fo.jar.
b) If you can't find rtf2fo*.jar in directory: $(Tomcat_dir)/webapps/elvis/WEB-INF/libs then go to http://www.rtf2fo.com/ and download the trial version instal it anywhere and copy from that dir the rtf2fo.jar to $(Tomcat_dir)/webapps/elvis/WEB-INF/libs. The rest of rtf2fo wont be needed.
After resolving problem as described above recompile. If you eliminated all the errors described in 3.1- 3 and correctly installed everything as stated in “1.Preparation” this time Jerome should compile without any errors. Don't worry about the warnings mostly that are printed because some methods are deprecated in Java 5.0.
III. Deploying Jerome web application.
Unfortunately copying jerome files to your webapps dir and eliminating all the compilation problems is only half of the success. Now when you start Tomcat you'll find that it's log fills with exceptions and the Jerome web app isn't started (which you can see in Tomcat Manager). Below you can see the description of problems that might cause such state.
Note: If you omitted point “2.Recompiling Jerome” and done it yourself then read 2.1 and 2.3.1 to know where to copy your files and what configuration files to change,
1. No security-role stated for Elvis_admin.
Depending on the version on Tomcat that you use it can show you an error referring to lack of security-role stated for Elvis_admin in file web.xml. To correct that edit this file:
$(Tomcat_dir)/webapps/jeromedl/WEB-INF/web.xml
Inside it find:
<login-config>
<auth-method>BASIC</auth-method> <realm-name>Elvis - Realm Login</realm-name>
</login-config>
and directly after it paste the fallowing text:
<security-role>
<role-name>JeromeDL_admin</role-name>
</security-role>
2. Access rights exceptions.
If after running tomcat you get a lot exceptions containing java.io.FilePermission that means the tomcat server doesn't have the access rights to open, read or write files included with jerome (like libraries and other). The rights are stated in files:
$(Tomcat_dir)/webapps/jeromedl/WEB-INF/java.policy $(Tomcat_dir)/webapps/jeromedl/WEB-INF/server.policy
To add this information to Tomcat: - Open Tomcat Monitor. - Right click on it and select Configure... - In "Java" tab - "Java options" text box put the following line:
-Djava.security.policy=$(Tomcat_dir)/webapps/jeromedl/WEB-INF/server.policy
- restart Tomcat.
You could also do this: Copy the file to c:/ and change it's name to .java.policy (under windows you have to enter the command prompt to change the file name to a one with a dot at the beginning).
Shutdown tomcat server, delete all logs and try to run tomcat again. If you eliminated problems described in points 3.1 and 3.2 (and done everything as stated in previous – 1 and 2) now you shouldn't get any exceptions.
IV. Checking the application via browser.
Ok- you downloaded everything, recompiled jerome, deployed it, now you enter Jerome website on your server using a browser and get a lot of errors and exceptions. This chapter helps you to eliminate them and get Jerome finally working.
1. ClassNotFound error. =
Generally you get this error when Tomcat searches a library that actually isn't there or searches it in a wrong location. Depending on your system this error can concern various files. To know what you need check in log what class file tomcat cant find. Here we will solve this problem for the following exception:
java.lang.NoClassDefFoundError: org/apache/commons/collections/CursorableLinkedList
The missing classes are included in a file called commons-collections.jar. To find the file simply search the entire webapps dir for it( for example it should be located in eXist dir). When you find it copy it to
$(Tomcat_dir)/shared/lib
This directory contains jars that tomcat will use in the first place for all deployed web applications so if you have problems with other libraries you can copy them here as well.
(If you still have problems with finding some jars, go to JeromeDLInstallation/ConfigurationTips - you can find there a link to all needed jars.)
2. Pagecontext error.
When after you enter your Jerome page tomcat throws exception containing error about pagecontext in applet.tag that means you have to do the following.
Open and edit the file:
$(Tomcat_dir)/webapps/elvis/WEB-INF/tags/applet.tag
The error shows in newer versions of tomcat and requires you to find text “pagecontext” in the following file and change it to “_jspx_page_context”. That should solve the problem (if it doesn't search the whole elvis dir for files containing that text).
3.[DEBUG] waiting 1 sek for rmiserver
This text showing continuously in your log file means that your jerome web application is waiting for the jerome rmi server which is located in a different part which we haven't yet compiled. If you have coped with all errors described above now it's time to take care about compiling the rest of Jerome and deploying it. In next chapter you'll learn how to do it properly .Possibly while browsing your jerome website you will get more errors like ones concerning NullPointer to a connection but all those are a consequence of not having jerome services and rmi server deployed and working so to eliminate them see how to instal those components.
V. Recompiling and running Jerome admin.
Jerome admin is a standalone application, technically it doesn't require Tomcat to run (thou it requires the services and web app running on server if you what to actually change anything).
1.Recompilation.
At the beginning go to your ElvisAdmin directory and modify the build.xml as usual. The next step is to copy rmi_client.jar to $(ElvisAdmin_dir)\lib. While compiling the rmi server in elvis webapp directory that file has been made. To find it go to your webapps dir in Tomcat find the directory ElvisAdmin. Now you've got all you need to compile. Go to command prompt, enter your ElvisAdmin directory and type ant.
2.Running.
To run EvlisAdmin you'll have to change the .bat files a bit. Open run.bat. At the beginning there are 3 system variables being set: JAVA_HOME,PATH and HOST. Set them to match your system. Save the file and run it. You need also to run rmiregistry before running the Tomcat server.
Other pages: W2W Project main page



