Re: Java at startup

From: Dave Stewart (dstewart@AQUAFLO.COM)
Date: Wed Oct 22 2003 - 16:10:02 EDT


On Wednesday, October 22, 2003, at 06:48 AM, Terri Sterr wrote:

> Do you have other java apps that are working?

Nope, this is the only one.

>
>
> Can you compile and execute the following simple program?
> **********************************************************
> public class HelloWorld
> {
> public static void main (String [] args)
> {
> System.out.println ("Hello World" );
> } // end main
> } // end class HelloWorld
> ***********************************************************

No, all I have on this machine is a Java Runtime Environment. No
development here, just deployment. I could build it on my development
machine (Mac OSX) and run it on the IBM though. (Technically speaking,
this isn't true. I think the machine has some dusty old version of java
1.1.8 on it, but I'm not using that at all. My program was built with
1.3.1, so I thought it best to run it with the 1.3.1 version of the
jre.)

You also sent me something stating that "When you restart the app it
should look at .profile and pick up the classpath from there". Problem
isn't when I restart the app though (that works fine), the trouble is
when I restart the MACHINE. I originally had this script run from the
/.profile, but I noticed errors whenever I logged into the machine due
to it trying to start the app again (also, it wasn't starting the app
when the machine booted, which caused confusion. It wasn't working, so
I log in and see that it is ...)

>
> -----Original Message-----
> From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU]On Behalf Of
> Dave Stewart
> Sent: Tuesday, October 21, 2003 7:34 PM
> To: aix-l@Princeton.EDU
> Subject: Re: Java at startup
>
>
> On Tuesday, October 21, 2003, at 06:13 AM, Terri Sterr offered this:
>
>> Does the jar file show up when you do: echo $CLASSPATH
>
> Nope, nothing does. More specifically, I get a blank line.
>
>>
>> If not you need to set the classpath in .profile and/or the
>> configuration
>> file associated with the app you are trying to start.
>>
>> Hope this helps. It might not.
>
> Well, it got me thinking about some things. I have changed the call to
> the .jar file itself to an absolute path rather than a relative one
> (the "/u/dave/jre131/jre/bin/java -verbose -jar FactsWSJServer.jar &"
> line in my script is now "/u/dave/jre131/jre/bin/java -verbose -jar
> /u/dave/FactsWSJServer.jar &"). That changed some things, but didn't
> quite fix it entirely. I also changed the "respawn" in the inittab file
> to "once" (it was getting too confusing chasing all those zombies
> around).
>
> Now I have something at boot (meaning "ps -ef | grep java" does return
> my process), but the program seems to just give up somewhere in
> execution[1] and I get errors like this:
>
> [Signaling in VM: java/lang/reflect/InvocationTargetException, message:
> ]
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.xmlrpc.Invoker.execute(Unknown Source)
> at
> org.apache.xmlrpc.XmlRpcServer$Worker.executeInternal(Unknown Source)
> at org.apache.xmlrpc.XmlRpcServer$Worker.execute(Unknown
> Source)
> at org.apache.xmlrpc.XmlRpcServer.execute(Unknown Source)
> at org.apache.xmlrpc.WebServer$Connection.run(Unknown Source)
> at org.apache.xmlrpc.WebServer$Runner.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:513)
>
> Of course (as usual), I can restart the service and it works perfectly.
>
> I tried to get the CLASSPATH exported from the rc file (where the PATH
> and ODMDIR are set), but that doesn't seem to work (doesn't show up
> with "env", nor with "echo $CLASSPATH"). I would try the .profile file,
> but I want this to work even when someone isn't logged into the machine
> (it should "just work" after a restart).
>
> I also just noticed that I neglected to mention something I can't
> figure out. When the machine is booted, I eventually get to the console
> prompt. Seconds after that, I get a java.lang.NullPointerException
> right there on the console (actually appears at the login prompt). I
> also see characters appearing at the right side of the screen, one for
> each line. Weird characters, ')', ')', '.', 'r', ' ', '-', ';', '.' ...
> I would guess they are random but I get the same series of characters
> each and every time I restart the machine.
>
> In other words, each time I boot the machine I end up with something
> that looks like this:
>
>
> AIX Version 4
> (C) Copyrights by IBM and others 1982, 1996
> Console login: java.lang.NullPointerException
>
> )
>
> )
>
> .
>
> r
>
>
> -
>
> ;
>
> .
>
>
> That's got to be a clue that something's wrong, right? I seem to have
> misplaced my clue, so if one of you kind folks can lend me one for a
> short period of time ...
>
> ;-)
>
>
> [1] - When I say "give up somewhere in execution", it's the same spot
> each and every time. This java program is calling a port on another
> machine, acquiring a port number and reconnecting to that port number.
> An XML request is sent to the new port number connection and it's
> supposed to receive a response, which gets parsed out. It seems to be
> falling apart somewhere in that process of send/receive/parse. My log
> file indicates it's making it through the send part, but nothing after
> that ...
>
>
>>
>>
>>
>> -----Original Message-----
>> From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU]On Behalf Of
>> Dave Stewart
>> Sent: Monday, October 20, 2003 7:30 PM
>> To: aix-l@Princeton.EDU
>> Subject: Java at startup
>>
>>
>> Hi List!
>>
>> Be nice to me, I'm new to the list and to AIX as well. ;-)
>>
>> I have a e-commerce application server written in Java, which is
>> deployed on one of our AIX servers. I created a startup script for it,
>> which simply uses a 1.3 JRE to start the app (instead of using the
>> still installed 1.1.8 version of Java). I can run this script manually
>> from the command line without troubles.
>>
>> What I want to do is have the machine start this app for me
>> automagically when the machine is booted and (if possible) have it
>> restart the app if it becomes unresponsive. I thought if I put the
>> command to run the app in the inittab file (using mkitab), that would
>> do the trick, since I think that is the last stage of the boot
>> process.
>> Unfortunately, it's not working. The line in the inittab file looks
>> like this (it's the last line in the inittab file):
>>
>> dsjavawsdaemon:2:respawn:/u/dave/startWebServices
>>> /u/dave/jwsdaemonerror.log 2>&1
>>
>> I've been having trouble even discerning what it's trouble is, but it
>> looks like it's stumbling on the manifest file in the .jar itself (the
>> last lines in the jwsdaemonerror.log file reads: "FFailed to load
>> Main-Class manifest attribute from
>> FactsWSJServer.jar"). Why this would cause a problem is beyond me (I
>> can run the script manually and it will work, just inittab seems to
>> have trouble with it) and why I'm begging you for input (any input
>> would be appreciated!).
>>
>> Note that I typically can see a zombie process on the machine after
>> the
>> failure (it goes away, then comes back. Nice Halloween trick when the
>> dead keeps rising from the grave! This behavior seems obvious to me
>> though, since the process isn't started successfully the system keeps
>> trying to respawn it.)
>>
>> Particulars:
>> Machine: IBM RS 6000 Model E20
>> OS: AIX 4.3.3
>> Java: JRE 1.3.1 (from Sun)
>>
>> FYI, the startup script file looks like this (I've tried it with and
>> without the "exec", it doesn't seem to matter either way.):
>>
>>> #!/bin/sh
>>>
>>> exec /u/dave/jre131/jre/bin/java -verbose -jar FactsWSJServer.jar &
>>> ps | grep "java"
>>
>>
>> Dave Stewart
>> Aqua-flo Supply (Goleta)
>> dstewart@aquaflo.com
>>
>> No trees were harmed during the production of this email,
>> but a large number of electrons were terribly inconvenienced....
>>
>>
>
>
> Dave Stewart
> Aqua-flo Supply (Goleta)
> dstewart@aquaflo.com
>
> The human mind ordinarily operates at only ten percent of its
> capacity -- the rest is overhead for the operating system.
>
>

Dave Stewart
Aqua-flo Supply (Goleta)
dstewart@aquaflo.com

The box said 'Requires Windows 95, NT, or better,' so I installed Linux.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:18 EDT