Use of JPackage for gLite 3.1 Release


There is standing target that JPackage rpms should be used where ever possible to supply java code within the gLite 3.1 release.

In particular the following software combination should be used.

  • Java JDK 1.5.0_??.
  • JPackage repositories 1.7 free, 1.7 non-free, 5.0 free and 5.0 non-free.
  • For the exact version of Java to use it should match the 1.5 version recommended by JPackage in 1.7 SRPMS-non-free. If, for example, this contains java-1.5.0-sun- then it is jdk 1.5.0_12 that you want to install as described below.

Use of these repositories implies the following versions of relevant software are used.

  • tomcat - tomcat5-5.5.23-7jpp.noarch.rpm
  • axis - axis-1.4-2jpp.noarch.rpm
However as JPackage is updated so these packages will follow their updates of course.

Jpackage Setup

The configuration of jpackage is documented by jpackage but below is summary that includes EGEE/gLite particulars.

Configuration of YUM or APT for JPackage.

  • A yum configuration file should be created, say /etc/yum.repos.d/jpackage5.0.repo.
  • A apt configuration file should be created, say /etc/apt/sources.list.

name=JPackage 5, generic

name=JPackage 5, generic non-free

rpm jpackage/5.0/generic  free non-free

If at CERN you may wish to use instead of

Installation of GPG Key.

Install the gpg key ideally.
 rpm --import

Install JPackage Utils

The jpackage-utils package is supplied within the OS release of RHEL, SL, SLC or Debian and should be installed.
 yum install jpackage-utils

Installation of SUN's JDK 1.5.0.

There are three options for completing this, 2 of them very similar.

  • Option 1a Take SUN's Linux self-extracting file jdk-1_5_0_12-linux-i586.bin and JPackage's .nosrc packages to build a JPackage's version of the RPM. Note from SUN you want to download the Linux self-extracting file and not the Linux RPM in self-extracting file.
  • Option 1b If you are inside CERN on an SL*C*4 box then the packages are already available.
    • If acceptable to you one of these is the recommended solution as it avoids the problems with SUN's RPM.
  • Option 2 Take SUN's RPM jdk-1_5_0_12-linux-i586.rpm.bin
    • This may be consistent with what you already have but there are problems due to some imprecise properties that this RPM provides in its spec file which creates problems when using with jpackage.

Unless following the CERN only recipe download jdk-1_5_0_12-linux-i586 for method 1a or jdk-1_5_0_12-linux-i586.rpm.bin for method 2 from SUN's web pages. Once on this page Sun calls this version JDK 5.0 Update 12. At times jpackage is a release behind SUN and in which case an old version of the SUN's JDL is available.

Option 1a: Installing JPackage's RPM of JDK.

This is described on JPackage's nosrc page. The process is as follows and can be run as a non-root user.

$ mkdir -p ~/redhat/BUILD ~/redhat/SOURCES ~/redhat/SPECS ~/redhat/RPMS/i586 ~/redhat/SRPMS
$ cat <<EOF > ~/.rpmmacros
%_topdir    $HOME/redhat
%packager       Firstname Lastname <>
$  rpm -Uvh
$ mv jdk-1_5_0_12-linux-i586.bin ~/redhat/SOURCES/.
$ rpmbuild -ba ~/redhat/SPECS/java-1.5.0-sun.spec
# yum localinstall ~/redhat/RPMS/i586/java-1.5.0-sun-
# yum localinstall ~/redhat/RPMS/i586/java-1.5.0-sun-devel-

You can just put these packages in a local yum or apt repository and then install them in the normal way. This is what CERN does effectively to offer solution 1b.

Option 1b: Installing JPackage's RPM of JDK if inside CERN.

Note that if using slC4 and inside CERN's network you can just issue.
# yum --enablerepo slc4-cernonly install java-1.5.0-sun java-1.5.0-sun-devel

Option 2: Installing SUN's RPM of JDK

Using the SUN's JDK package creates a headache though it can be used if care is taken. In particular tomcat5 requires the package xml-commons-jaxp-1.3-apis however this package is configured to Obsolete within RPM the property xml-commons-apis which is provided by SUN's JDK. The consequence is that installing xml-commons-apis removes SUN's JDK from your system! More details are here, there, else where and over there.

# yum install xml-commons-jaxp-1.3-apis
If you had SUN's JDK installed it will have just been removed!
# yum localinstall  jdk-1_5_0_12-linux-i586.rpm
# yum install java-1.5.0-sun-compat

Note that when ever xml-commons-jaxp-1.3-apis is upgraded you risk removing SUN's JDK. Please consider using the JPackage RPM of JDK.

Continue to Install Packages,

It should now work to install furthur JPackage packages or gLite meta-packages. e.g one of the following.
# yum install glite-CE
#  yaim -i -s <location of site-info.def> -m <meta-package name>
Note that if you plan to install a service requiring tomcat e.g. MON box they be aware of the tomcat user issue below.

Install tomcat

One thing to be aware of is that tomcat package adds a tomcat user with the following in its spec file.
/usr/sbin/groupadd -g 91 -r tomcat 2> /dev/null || :
/usr/sbin/useradd -c "Apache Tomcat" -u 91 -g tomcat \
    -s /bin/sh -r -d /usr/share/tomcat5 tomcat 2> /dev/null || :

So this adds in a username/groupname tomcat/tomcat with uid/gid 91/91. If you already have a user called tomcat then you have nothing to do and everything will be okay, it does not matter what the uid/gid of this existing tomcat user is. However if you already have a username or group with uid or gid 91 but a different username, e.g. tomcat4 then you have a problem that needs correcting before you install the tomcat.

You can do one of the following.

  • Add a tomcat user with a different uid/gid. Run the commands above but with a number differing from 91.
  • Delete the existing user (tomcat4) and group (tomcat4). userdel tomcat4 && groupdel tomcat4. The RPM will then add the tomcat user.
  • Modify the existing user tomcat4 to tomcat. usermod -l tomcat tomcat && groupmod -n tomcat tomcat4

# yum install tomcat5
# yum install glite-MON

If you see an error message when tomcat5 is installed or started:

/usr/bin/build-jar-repository: error: Could not find xml-commons-apis Java extension for this JVM
/usr/bin/build-jar-repository: error: Some specified jars were not found for this jvm
Then you have opted to use SUN's JDK and have installed xml-commons-apis and SUN's JDK in the wrong order. Install xml-commons-apis and then reinstall SUN's JDK. Avoid this completely using JPackage's JDK package.

Last page update: AndreasUnterkircher - 2009-01-22

Edit | Attach | Watch | Print version | History: r19 < r18 < r17 < r16 < r15 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r19 - 2009-01-22 - AndreasUnterkircher
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    EGEE All webs login

This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright & by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Ask a support question or Send feedback