translation difficulties during tomcat installation

General discussion on the JZOS batch launcher and toolkit
Post Reply
wlarip
Posts: 1
Joined: Wed Feb 15, 2006 2:56 pm

translation difficulties during tomcat installation

Post by wlarip »

Greetings:

Please inform me if this is offtopic.

I am installing JZOS with the intention of running TOMCAT.
Things were going well until the installation of TOMCAT.

The 5.0.28 binary zip file was downloaded from APACHE with
FILEZILLA in binary mode. It was then uploaded by FILEZILLA
in binary mode to a ZOS to a preallocated RECFM U LRECL 0 BLKSIZE
32760 zip file when was then OCOPIED from MVS to USS.

When the "jar -xvf tomcat.zip" command is run in USS, the "jakarta-tomcat-5.0.28" directory and all of its subdirectories are properly created
and all appears normal. However the individual files appear to be
untranslated from ASCII to EBCDIC. Any attempt to use a record format other than described will result in an IOexception creating the "jakarta" directory.

If the files are viewed on the PC which was the target of the original
download, there are correct and legible.

Any clues as to how to get this properly translated?

Thanks,

Bill
monty

Post by monty »

you have to download files from or to mainframe in binary... an old problem... there are some tricks in the faq i think
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

You have done nothing wrong.... you don't need any of the files translated from ascii to ebcdic!

For jars - they need to be binary.
For java properties files - the Java spec dictates that these are iso-8859-1 (ascii)
For xml files - they must be left alone... if no encoding in specified on the prologue, they must be utf-8 (ascii)

For "read me"ish text files - open them in iso-8859-1 (see http://jzos.com/docs/editascii.html )

For "script (sh)" files - you don't need these to use the JZOS batch launcher
Guest

Post by Guest »

thank you very much.

can you enlighten me as to why the bootstrap is failing with:

java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler
:at java.lang.Class.getDeclaredConstructors0(Native Method)
:at java.lang.Class.privateGetDeclaredConstructors(Class.java:1747)
:at java.lang.Class.getConstructor1(Class.java:2063)
:at java.lang.Class.newInstance3(Class.java:331)
:at java.lang.Class.newInstance(Class.java:305)
:at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:208)
:at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:402)
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

A search on google seems to indicate that this is some kind of TOMCAT classpath problem. Are you sure that you have the CATALINA_HOME environment variable set to the base directory where you unzipped Tomcat?

If you can run the JZOS launcher with LOGLVL='+D' and post your //SYSOUT log file, we might be able to figure out the problem.

You might also try running with the JVM option:

-verbose:class

IBM_JAVA_OPTIONS environment variable, which causes a classloader trace.
Guest

Post by Guest »

adding CATALINA_HOME to the USS /etc/profile yields the same result.
i'll have to get a few diagnostics.
what is the contextual difference between the exported variables:
(1) CATALINA_HOME and (2)TOMCAT_HOME.
Does the lack of an export statement in the 14 batch launcher for 2
make any difference?
Is 1 referenced outside the scope of the batch launcher?
Is the cloned shell environment created by the batch launcher pervasive for everything executed by it?

Thanks
Guest

Post by Guest »

these messages jump out of the classloader trace:

Signaling in VM: java/lang/UnsatisfiedLinkError, message: /usr/lpp/java/J1.4/biin/libjzos14.so: Could not find dll

Signaling in VM: java/lang/UnsatisfiedLinkError, message: /lib/libjzos14.so: Could not find dll

but the NoClassDefError for TOMCAT is the last thing you see
before the abort.

i'll format the +D SYSOUT and post it shortly.

thanks for your help.
Guest

Post by Guest »

what is the latest verion of TOMCAT that JZOS 1.2.2 can support?
Guest

Post by Guest »

here is the +D output:
TOMCAT 5.0.38 vs. TOMCAT 5.0.30 both yield identical results.
CATALINA_HOME is set in USS /etc/profile which has permissions of 755.


02:10:40 JZOSVM14(N): log level has been set to: D
02:10:40 JZOSVM14(N): Copyright (C) 2004 Dovetailed Technologies LLC. All rights reserved.
02:10:40 JZOSVM14(N): JZOS Version 1.2.2
02:10:40 JZOSVM14(I): Region requested = 0K, Actual below/above limit = 9M / 1680M
02:10:40 JZOSVM14(D): Output from DD:STDENV config shell script:
02:10:40 JZOSVM14(D): ___JZOS_ENV_START___
02:10:40 JZOSVM14(I): MAIL=/usr/mail/
02:10:40 JZOSVM14(I): IBI_LIBPATH=
02:10:40 JZOSVM14(I): JAVA_PROPAGATE=NO
02:10:40 JZOSVM14(I): PATH=/bin:/usr/lpp/java/J1.4/bin:
02:10:40 JZOSVM14(I): IBM_JAVA_ZOS_TDUMP=NO
02:10:40 JZOSVM14(I): JZOS_HOME=/usr/lpp/jzos
02:10:40 JZOSVM14(I): IBM_JAVA_OPTIONS=-Xms64m -Xmx128m -Dfile.encoding=ISO8859-1 -Djzos.home=/usr/lpp/jzos
-Dcatalina.base=/usr/lpp/tomcat -Dcatalina.home=/usr/lpp/tomcat -Djava.io.tmpdir=/usr/lpp/tomcat/temp
-Djava.endorsed.dirs=/usr/lpp/tomcat/common/e
ndorsed
02:10:40 JZOSVM14(I): _=/bin/env
02:10:40 JZOSVM14(I): CLASSPATH=/usr/lpp/java/J1.4/lib/tools.jar:/usr/lpp/tomcat/bin/bootstrap.jar:/usr/lpp/jzos/jzos.ja
r:
02:10:40 JZOSVM14(I): STEPLIB=:SAS.PROD.TARG.LIBRARY
02:10:40 JZOSVM14(I): LANG=C
02:10:40 JZOSVM14(I): LIBPATH=/lib:/usr/lib:/usr/lpp/java/J1.4/bin:/usr/lpp/java/J1.4/bin/classic:/usr/lpp/jzos:
02:10:40 JZOSVM14(I): TOMCAT_HOME=/usr/lpp/tomcat
02:10:40 JZOSVM14(I): JAVA_DUMP_HEAP=false
02:10:40 JZOSVM14(I): JAVA_HOME=/usr/lpp/java/J1.4
02:10:40 JZOSVM14(I): TZ=EST5EDT
09:10:40 JZOSVM14(I): MANPATH=/usr/man/%L
09:10:40 JZOSVM14(I): NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
09:10:40 JZOSVM14(I): CATALINA_HOME=/usr/lpp/tomcat
09:10:40 JZOSVM14(D): ___JZOS_ENV_STOP___
09:10:40 JZOSVM14(D): argBuf=''
09:10:42 JZOSVM14(N): Java Virtual Machine created. Version information follows:
09:10:45 JZOSVM14(D): About to invoke com.dovetail.jzos.ZUtil.getJavaVersionInfo()
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM z/OS Persistent Reusable VM build cm142sr1a-20050209 (JIT enabled: jitc))
09:10:45 JZOSVM14(D): About to invoke com.dovetail.jzos.ZUtil.redirectStandardStreams()
09:10:45 JZOSVM14(I): Using output encoding: 'IBM-1047'
09:10:45 JZOSVM14(I): MVS commands are ENABLED
09:10:45 JZOSVM14(D): About to invoke com.dovetail.jzos.ZUtil.establishMvsCommandWaiter()
09:10:45 JZOSVM14(I): Java main class: org.apache.catalina.startup.Bootstrap
09:10:45 JZOSVM14(I): Arg 1='start'
09:10:45 JZOSVM14(N): Invoking org.apache.catalina.startup.Bootstrap.main()
09:10:45 JZOSVM14(D): About to invoke org.apache.catalina.startup.Bootstrap.main()
09:10:56 JZOSVM14(N): org.apache.catalina.startup.Bootstrap.main() completed.
09:10:56 JZOSVM14(I): Waiting for non-deamon Java threads to finish before exiting...
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

I'll try to answer some of your questions:

1) The following messages from the classloader are normal...
It seems that the JVM tries to load dlls from every directory in the LIBPATH until it finds it.
====================================
Signaling in VM: java/lang/UnsatisfiedLinkError, message: /usr/lpp/java/J1.4/biin/libjzos14.so: Could not find dll

Signaling in VM: java/lang/UnsatisfiedLinkError, message: /lib/libjzos14.so: Could not find dll

=====================================

2) The JZOS Launcher is not dependent on any version of Tomcat.
(The Tomcat SAF realm only works with Tomcat 5.0.x, however. We are getting ready to post a new SAF realm for Tomcat 5.5 )

===========================================

3) The JVM and Tomcat don't actually care about the setting of TOMCAT_HOME or CATALINA home, only the -Dcatalina.home and -Dcatalina.base that are configured in the sample script from these environment variables.

============================================

4) I don't see anything wrong in your environment variables (CLASSPATH, LIBPATH, IBM_JAVA_OPTIONS) for invoking the JVM to run Tomcat.
(You don't need to add CATALINA_HOME to /etc/profile, just set TOMCAT_HOME in the example script as you have and you will be fine)

The CLASSPATH setup to run Tomcat only specifies the "bootstrap.jar", for staring Tomcat. The Tomcat bootstrap code creates new ClassLoaders that reference the jars in ./server/lib, ./server/classes, ./common/lib, ./common/classes, etc.

Here's a link to an explanation of how Tomcat's classloader structure works: http://tomcat.apache.org/tomcat-5.5-doc ... howto.html

The NoClassDefFound exception that you are getting is for a class that is not in the original CLASSPATH (bootstrap.jar), but in ./server/lib/tomcat-util.jar. Do you have that jar? Try a "jar -tvf " on it to see if is corrupted.

Since your invocation of the Java VM looks OK, my best guess is that your unloaded distribution of Tomcat is somehow corrupted.

Since you uploaded / unpacked Tomcat in an unconventional way, this might have caused the problem; its hard to say. Try the normal way: FTPing the Tomcat .zip file directly to the hfs file system (in binary mode) and then use the "jar -xvf xxx.zip" command to unzip it.

There's another thing that you can try.... I notice that the standard Tomcat startup script "catalina.sh" adds a Jar to the classpath that the JZOS JCL script is not adding.... this must have been added in Tomcat 5.0. Its odd, since we and other are running Tomcat 5.0.28 and 5.5.x without this.
But, there maybe something else unique in your environment that might be related to this.

To fix this, add the following line to your //STDENV script:
(after this line):
CLASSPATH="$CLASSPATH":"${TOMCAT_HOME}/bin/bootstrap.jar"
(add:)
CLASSPATH="$CLASSPATH":"${TOMCAT_HOME}/bin/commons-logging-api.jar"

If you still have problems, turn on LOGLVL='+D' and -verbose:class and email a complete //SYSOUT file to info@dovetail.com and I'll take a look.
The classloader trace should be able to tell us which class really can't be found.

Finally, if you are just getting started with JZOS, you might want to download and install the latest version 1.2.3 from IBM's alphaworks site. There are no major differences, except the newer version does support SDK 5.0 (31-bit). The alphaworks version has a much-expanded user's guide, however. But, I'm sure that this is not your Tomcat problem.
Guest

Post by Guest »

i'll try those things.
however the 5.0.30 of TOMCAT has eaxctly the same problem and was FTP'ed and unpacked in the conventional way.
if implicit classloading follows general execution flow, the exception is occurring right after socket creation.
this suggests to me that RACF and TCPIP security considerations may be playing a part and that the classload failure is a byproduct of a log attempt
that may be in error or simply premature in the initialization process.
Excuse my ignorance of the FAQ, but is the batch launcher the proc name that needs RACF profile and TCPIP authorization to open the default port which i also assume is 8080?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

At this point I don't have a clear picture of what your symptoms are... the only exception that you posted was a NoClassDefError very early in the bootstrap process. But now you seem to say that the exception is after socket creation. RACF is not a consideration unless you have installed our custom SAF Realm, but even then only after you try to login.

So, turn on LOGLVL='+D' and -verbose:class and send me your entire job output and I'll look at it. (info@dovetail.com)

BTW - here's how to download a job from the JESS spool with ftp:

ftp <host>
(login)
quote site filetype=jes
get JOBnnnn output.txt
Guest

Post by Guest »

it's a tomcat problem.
thanks for your help.
Guest

Post by Guest »

CLASSPATH="$CLASSPATH":"${TOMCAT_HOME}/server/lib/tomcat-util.jar"
Post Reply