HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Tomcat root application bug?

 
SOLVED
Go to solution
Fredrik Israelsson
Occasional Advisor

Tomcat root application bug?

I use Tomcat and have problems deploying the root application. When I drop ROOT.WAR into webapps it is beeing deployed and is accessible through http://myservername/root but not as http://myservername/ or http://myservername/ROOT.

It seams to be a case problem since I get 400 - bad request. Renaming the war and/or the deployed root directory does not work either.

Any ideas of what might be causing this and what I can do to successfully deploy any root application?
10 REPLIES

Re: Tomcat root application bug?

There are a number of things that affect case handling. Could you provide the following information:

Disk: ODS-2 or ODS-5?

JAVA$... and DECC$... logicals?
Fredrik Israelsson
Occasional Advisor

Re: Tomcat root application bug?

ODS5 all the way.

Except for the default HP Tomcat scripts I run the following:

admds79103@secv21> type applications:[web.bin]JAVA$CONFIG_SETUP.COM
$! JAVA$CONFIG_SETUP.COM
$!
$! --NOTE:
$! -- THIS FILE WAS ORIGINALLY GENERATED BY
$! -- SYS$COMMON:[JAVA$150.COM]JAVA$CONFIG_WIZARD.COM;1
$! -- ON 27-FEB-2009 12:09:29.25
$! -- IT MAY HAVE BEEN MANUALLY EDITTED SINCE THEN.
$! --
$! -- For more complete description of the logicals shown,
$! -- please read the release notes.
$!
$! The following are useful in all environments.
$!
$ SET PROCESS/PARSE_STYLE=EXTENDED
$ DEFINE/JOB DECC$ARGV_PARSE_STYLE TRUE
$ DEFINE/JOB DECC$EFS_CASE_PRESERVE TRUE
$ DEFINE/JOB JAVA$DAEMONIZE_MAIN_THREAD TRUE
$ DEFINE/JOB JAVA$DISABLE_CMDFILE_WHITESPACE_PARSING TRUE
$ DEFINE/JOB DECC$ENABLE_GETENV_CACHE TRUE
$!
$! Omitting logicals useful in debugging environment.
$!
$! Logicals useful for mimicing UNIX-like environments:
$!
$ DEFINE/JOB JAVA$CREATE_DIR_WITH_OWNER_DELETE TRUE ! make mkdir & rmdir symmetric --
$! no need to change dir. protection before delete
$ DEFINE/JOB JAVA$DELETE_ALL_VERSIONS TRUE ! delete all copies of file on delete operation
$ DEFINE/JOB JAVA$RENAME_ALL_VERSIONS TRUE ! rename all copies of file on rename operation
$ DEFINE/JOB DECC$POSIX_SEEK_STREAM_FILE TRUE ! make seek() beyond EOF not extend file if no write happened
$!
$! Logicals useful for applications with many children:
$!
$ DEFINE/JOB JAVA$FORK_PIPE_STYLE 2 ! use buffered Mailbox devices and TCP/IP devices for interprocess communication
$ DEFINE/JOB JAVA$FORK_SUPPORT_CHDIR TRUE ! simulate chdir behavior on runtime.exec()
$ DEFINE/JOB JAVA$FORK_MAILBOX_MESSAGES 8 ! default -- increase for better buffering
$ DEFINE/JOB JAVA$WAIT_FOR_CHILDREN 5 ! seconds to delay exiting main to allow children to exit first
$!
$! Logicals useful for supporting file sharing:
$!
$ DEFINE/JOB DECC$FILE_SHARING TRUE ! ask for C-RTL support for file sharing
$!
$! Omitting logicals useful for bypassing secondary stat() call.
$!
$! Logicals useful to set up caching of file/directory information
$!
$ DEFINE/JOB JAVA$CACHING_INTERVAL 10 ! to disable, undefine logical or set value to 0
$ DEFINE/JOB JAVA$CACHING_DIRECTORY TRUE ! enable special case -- don't look in directory if directory known to be absen
t
$!
$ DEFINE/JOB JAVA$CREATE_STMLF_FORMAT TRUE ! No stream-lf log files please. 2009-03-05 GID/FI
$ DEFINE/JOB JAVA$FSYNC_INTERVAL 5 ! Flush files including log files every Xs
$!
$! Logicals useful for supporting both ODS-2 and ODS-5 formatted disks.
$!
$ DEFINE/JOB JAVA$FILENAME_CONTROLS -1 ! enable all mappings
$!
$! See: SYS$COMMON:[JAVA$150.COM]JAVA$FILENAME_CONTROLS.COM for explanation of bits enabled above.
$!
$! Logicals useful for workstations with PC-style keyboard:
$!
$ DEFINE/JOB JAVA$KEYBOARD_TYPE_DEC TRUE ! make PC-style keyboard transmit keycodes like DEC-style keyboard
$!
admds79103@secv21>

Is it parse style that mess things up? It is needed for a couple of the web applications though.

Re: Tomcat root application bug?

It shouldn't be the setting of PARSE_STYLE. Could you post your .tomcatrc? That should have some ODS-5 and case-related settings as well.
Fredrik Israelsson
Occasional Advisor

Re: Tomcat root application bug?

I don't have any .tomcatrc, instead I use the following file to configure memory, logging etc.

admds79103@secv21> type applications:[web.conf]TOMCAT_JVM_ARGS.DAT
-mx512m
-Djava.awt.headless=true
-Djava.awt.headlesslib=true
-XX:+ServerApp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=TOMCAT_ROOT/conf/logging.properties
admds79103@secv21>

and this is the login.com for the user running Tomcat:

admds79103@secv21> typ APPLICATIONS:[WEB.BIN]login.com
$! 2009-02-27 GID/FI Login.com for Tomcat user.
$!
$ write sys$output "''f$cvtime()' Info: Entering ''f$environment("PROCEDURE")'"
$ bin_dir = f$parse(f$environment("PROCEDURE"),,,"DEVICE") + f$parse(f$environment("PROCEDURE"),,,"DIRECTORY")
$ conf_dir = bin_dir - ".BIN]" + ".CONF]"
$!
$! Setup Java enironment
$ @'bin_dir'JAVA$CONFIG_SETUP.COM
$!
$! Tell HP scripts where to find JVM config.
$ define/job APACHE$JAKARTA_JAVA_PARAMETERS_FILE 'conf_dir'TOMCAT_JVM_ARGS.DAT
$ define/job APACHE$JAKARTA_USER_CLASSPATH "TOMCAT_ROOT:[bin]*.JAR" ! Needed for logging
$!
$! Execute application specific script
$ if f$search("''bin_dir'SETUP_ENVIRONMENT.COM") .nes. "" then @'bin_dir'SETUP_ENVIRONMENT.COM
$!
$! Give the applications a chance to navigate from the root.
$ TOMCAT_ROOT = BIN_DIR - ".BIN]" + ".CLUSTER." + f$getsyi("NODENAME") + ".APACHE.JAKARTA.TOMCAT]"
$ @utils:[000000]DEFINE_CONCEALED.COM TOMCAT_ROOT "''TOMCAT_ROOT'"
$!
$! Jump to tomcat_bin so that log conf files are found.
$ set default TOMCAT_ROOT:[BIN]
$!
$ show process /parse
$!
$ write sys$output "''f$cvtime()' Info: Exiting ''f$environment("PROCEDURE")'"
$!
$ exit
admds79103@secv21>

Re: Tomcat root application bug?

I am missing at least two logicals:

DECC$EFS_CASE_SPECIAL (set to "ENABLE")
APACHE$JAKARTA_ENABLE_ODS5 (set to 1)

Also, you have DECC$EFS_CASE_PRESERVE set to true, and I am not sure if that works. I do know that it works when set to "ENABLE"

These three would normally go into the .tomcatrc file.

If the above doesn't work, there may be more that's missing. I suggest you look at the CSWS_JAVA Installation Guide. I believe it has a section that specifically deals with installing on an ODS-5 disk.
Solution

Re: Tomcat root application bug?

Hmm... I may have been too fast there. From reading the description of DECC$EFS_CASE_SPECIAL, your problem might be that it _is_ enabled and should be disabled.

From how I read this, if DECC$EFS_CASE_SPECIAL is set, it would cause a directory named "ROOT" to appear as "root" to Unix apps.

You might want to check and see if this gets set anywhere, and see what happens if it's disabled.

Here's the description:

DECC$EFS_CASE_SPECIAL
With DECC$EFS_CASE_SPECIAL enabled, case is preserved only for file names containing lowercase. If an element of a file name contains all uppercase letters, it is reported in all lowercase in UNIX style.

When enabled, DECC$EFS_CASE_SPECIAL overrides the value of DECC$EFS_CASE_PRESERVE.

Re: Tomcat root application bug?

Any luck yet?
Fredrik Israelsson
Occasional Advisor

Re: Tomcat root application bug?

DECC$EFS_CASE_SPECIAL false did the trick!

I also had to delete everything in [APACHE.JAKARTA.TOMCAT.conf.catalina.localhost...]*.*;* as well as the case on the config file names in there took precedence over the logicals and the .war file name case. Took a while to figure out since it worked in one of two nodes in the cluster :)

You don't happend to know any way of running Tomcat on port 80 without using Apache in front or giving the user running Tomcat full privileges?

Re: Tomcat root application bug?

Hi Frederik,

I'm glad your initial problemn got solved. As to the other question, no, I don't know a way to do this. You might want to ask that question in a new thread, to catch other people's attention who might know a way to.
Hoff
Honored Contributor

Re: Tomcat root application bug?

By default, port 80 is protected against non-privileged use. All ports below 1024 are similarly protected. These are the so-called privileged ports, a security mechanism which dates back to a different and much earlier era on the Internet.

Here are some related details...

http://wiki.apache.org/tomcat/HowTo

The approach using the little stub program will also work here, too. That written, the construction and the requisite INSTALL command mechanism differs from the Unix syntax shown in the Apache Wiki.

Details on allowing a non-privileged OpenVMS user to execute a procedure or an image with privileges is discussed around the net; that's basically what is involved here. Here is one article that discusses some of the options:

http://labs.hoffmanlabs.com/node/491

The Apache Wiki article was found via...

http://www.google.com/search?q=tomcat+without+apache