[Gllug] Java sucks

Tethys tet at accucard.com
Fri Mar 7 15:03:42 UTC 2003


Simon Stewart writes:

>What are you trying to do? I've not run into a situation where this is 
>a problem, and I'm curious to find out.

If we have a number of Java processes running on a machine, how do we
tell which one's which? The Solaris ps command truncates the command
at 79 characters (with no flags to increase the cutoff point). So our
ps output typically looks like:

 accuadm 14221     1  0   Mar 05 ?        1:47 /accucard/java/bin/../bin/sparc/native_threads/java -server -Djava.security.pol
 accuadm 14242     1  0   Mar 05 ?       64:19 /accucard/java/bin/../bin/sparc/native_threads/java -server -Djava.security.pol

Now one of those is tomcat3, and one is tomcat4. Which is which? Even if
we *can* get the full command line[1], it still not always clear what that
particular instance of java is actually running.

The solution we came up with was to define an arbitrary system property
in the tomcat startup scripts[2]. That way we could have:

 /accucard/java/bin/../bin/sparc/native_threads/java -Dver=tomcat3 [...]
 /accucard/java/bin/../bin/sparc/native_threads/java -Dver=tomcat4 [...]

The problem comes from the fact that we want to use the "-server" switch
to the JRE. We obviously want the version at the start of the arguments,
because we dont' want to run therisk of it getting truncated. But the
JRE barfs. Thus:

	java -server -Dver=tomcat4

is fine, but

	java -Dver=tomcat4 -server

isn't...

Tet

[1] /usr/ucb/ps helps here
[2] Another blow to Java's much hyped platform independence. Sun made the
    invocation sequence for a Java app so horrendously complex that it's
    not realistically feasible to call it directly, and you *need* a
    startup script (which is naturally system specific -- usually either
    a Unix shell script, or a DOS batch script).

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list