jvm - Java error: java.lang.IllegalArgumentException: Signal already used by VM: INT -


I am checking a Java problem (using IBM JVM 1.4.2 64-bit) on Red Hat Linux . I am thinking that someone has seen this error message first and knows what is the solution to this problem?

Source:

  import sun.misc.Signal; Import Sun.misc.SignalHandler; Expansion of public class signaltast thread {Private stationary signal signal = new signal ("INT"); Private stationary shutdown handler handler = new shutdown handler (); Private Static Class Shutdown Handler SignalHandler {Public Zero Handle (Signal Sig) {}} Public Static Wide Men (Sting [] AGR) Try {{Signal.handle (Signal, Handler); } Hold (Throbable E) {e.printStackTrace (); } Try {Thread Solid (5000); } Hold (exception e) {e.printStackTrace (); } System.exit (0); }}  

Output:

  java.lang.IllegalArgumentException & lt; The signal is already used by VM: INT & gt; Java.lang.IllegalArgumentException: The signal is already used by VM: INT at com.ibm.misc.SignalDispatcher.registerSignal (SignalDispatcher.java:145) at sun.misc.Signal.handle (Signal.java:199) XXX on  

Additional information:

I found out something weird. The reason for its failure is because I am running the program inside the shell script as a background process.

i.e. Sigtest.sh:

  #! / Bin / bash java -cp signals & gt; & Gt; Sigtest.log 2 & gt; And 1 & amp;  

If I run programs from the command line, or "& amp; (i.e. make it a foreground process inside the shell script), there is no problem in it ... i understand It does not matter why this is the case.

This may very well be a JVM implementation specific problem. We are using a non-documented / unsupported API ( sun.misc.Signal / SignalHandler ) and therefore the API No contract is guaranteed on the contract.

IBM JVM implementation can signal signal handling-different from the SUN JVM implementation and hence the cause of this problem, because this specific use case SNR works in JVM, but not in IBM JVM.

But try the following (I can not do it myself):

Do all

  • Property ibm.signal Set to true / false
  • property ibm.signalhandling .rs set > True / false
  • (Properties where many error dumps are found through Google but I can do any specific documents on them Do not meet)

    I do not know that IBM JVM also supports this special flag, but you can also try to add it, in which specifications for some problems with signal in SUN JVM Try using Linux / Solaris

      -XX handlers   

    or use a basic signal handler if it's y Where is an option for See sample code given:

    > Although it is not related to your specific problem, an IBM article on JVM signal handling (a bit late, but still mostly correct). With the sample code for the original code signal handler:


    But I think it can not be of any benefit because IBM JVM Implementation SIGINT Do not give yourself a chance to work correctly and thus never allow you to handle SIGINT .

    From Btw I think that what this is exactly what you want to do is

    when -Xrs is used on the Sun's JVM The signal masks for the signet, the SIGTM, SIUIPUP and the SQUQUIT are not changed by the JVM, and these the signals are not installed .

    or it may mean that only the JVM default actions for the signal are not executed. Or it depends on the JVM implementation that is actually.


    Comments

    Popular posts from this blog

    c++ - Linux and clipboard -

    Visual Studio 2005: How to speed up builds when a VSMDI is open? -

    booting ubuntu from usb using virtualbox -