ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike.H...@wincanton.co.uk
Subject Re: java errors when running build file
Date Mon, 22 Jan 2007 13:23:46 GMT
Thanks all for your input, especially to Steve for your laymans 
explanation at the foot of your last post!

As this build file will be run by a cron job in the wee small hours of the 
morning, and doesn't require any user input, I don't think I need to 
bother too much about my JVM's lack uf support for the full signal set. I 
will report the problem to my vendor though.

Mike





Steve Loughran <stevel@apache.org> 
22/01/2007 11:50
Please respond to
"Ant Users List" <user@ant.apache.org>


To
Ant Users List <user@ant.apache.org>
cc

Subject
Re: java errors when running build file






Dalibor Topic wrote:

> Steve Loughran <stevel <at> apache.org> writes:
> 
>> Mike.Horn <at> wincanton.co.uk wrote:
>>> Hello
>>>
>>> HP-UX11i
>>> Java 1.3
>>> ANT v.1.7.0
>>>
>>> $ ant -f Unix_Build.xml
>>> Buildfile: Unix_Build.xml
>>>  [property] java.lang.reflect.InvocationTargetException: 
>>> java.lang.IllegalArgume
>>> ntException: Unknown signal: HUP
>>>  [property]     at sun.misc.Signal.<init>(Unknown Source)
>>>  [property]     at java.lang.Terminator.setup(Unknown Source)
> 
> [snip]
> 
>> In smartfrog we have to wrap signal setup with an exception catcher, as 

>> it fails earlly on on the kaffe JVMs. We catch it and warn that the 
tool 
>> is not tested on those JVMs and so use at your own risk...
> 
> We don't have an implementation of sun.misc.Signal in Kaffe, I don't 
think it's
> part of the standard API.
> 

no, its not, which is why my work project skips the whole signal 
handling setup -its currently sun JVM only.

If ant is doing some signal handling during an exec it should catch a 
failure and continue with the run.

(pause)

OK. here's the source in question.

1. ant uses reflection to get the shutdown hook.
     public ProcessDestroyer() {
         try {
             // check to see if the shutdown hook methods exists
             // (support pre-JDK 1.3 VMs)
             Class[] paramTypes = {Thread.class};
             addShutdownHookMethod =
                 Runtime.class.getMethod("addShutdownHook", paramTypes);

             removeShutdownHookMethod =
                 Runtime.class.getMethod("removeShutdownHook", 
paramTypes);
             // wait to add shutdown hook as needed
         } catch (NoSuchMethodException e) {
             // it just won't be added as a shutdown hook... :(
         } catch (Exception e) {
             e.printStackTrace();
         }
     }

If there is no method (as with kaffe), then nothing is printed.

2. when the hook is added, if the method throws an exception, then yes, 
it is printed.

     private void addShutdownHook() {
         if (addShutdownHookMethod != null && !running) {
             destroyProcessThread = new ProcessDestroyerImpl();
             Object[] args = {destroyProcessThread};
             try {
                 addShutdownHookMethod.invoke(Runtime.getRuntime(), args);
                 added = true;
             } catch (IllegalAccessException e) {
                 e.printStackTrace();
             } catch (InvocationTargetException e) {
                 Throwable t = e.getTargetException();
                 if (t != null && t.getClass() == 
IllegalStateException.class) {
                     // shutdown already is in progress
                     running = true;
                 } else {
                     e.printStackTrace();
                 }
             }
         }
     }

This code is not tied to a project, and so cannot use Project.log(). 
Otherwise I'd downgrade the trace to a -verbose level. As it is, I think 
we just need to leave it in.

Mike: this stack trace is a warning that your JVM doesnt support the 
complete signal set. It is mostly harmless, but you should know that if 
you kill ant with a control-C or similar, processes it starts may hang 
around, as ant wont get told. Other than that, its a message you can 
ignore.

-steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org




***************************************************************
Wincanton plc is a leading European provider of supply chain solutions.  We design, implement
and operate creative solutions for customers in 15 countries.  Our business has a turnover
of over EUR2.7bn /GBP1.81bn and employs 27,000 staff across 360 locations.  Warehousing, transport
and specialist services are provided for customers in a range of sectors including automotive,
retail, FMCG, petrochemicals and manufacturing.  Further information on our unique achievements
and competencies can be found by visiting 

www.wincanton.co.uk

****************************************************************
This e-mail and any files transmitted with it are confidential 
and intended solely for the use of the individual(s) to whom it 
is addressed.  If you have received this e-mail in error please 
contact IT Service Desk on +44 (0) 870 870 9393 or e-mail
mail.monitor@wincanton.co.uk

Any views or opinions expressed are solely those of the author 
and do not necessarily represent those of Wincanton plc
or any of its subsidiary companies.  Unauthorised publication, 
use, dissemination, forwarding, printing or copying of this 
e-mail and its associated attachment(s) is strictly prohibited.
Wincanton plc, Methuen Park, Chippenham, Wiltshire SN14 0WT.
****************************************************************
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message