Jrocket segfaults when running even trivial java app

Trying to run it on debian woody (2.2) it segfaults and on debian sid it just hangs
(can't control c it)
gdb on the core gives:
Core was generated by `/usr/local/jrockit/jre1.3.1/bin/i386/native_threads/java
-jrockit -cp . test'.
Program terminated with signal 11, Segmentation fault.
#0 0x2ad0e38d in ?? ()
stracing it on woody stops it segfaulting and I get these messages
wait4(2418, ********** Warning: Alternative 2 also failed
******* JRockit failed in setfs -1 - repeat
NULL, 0, NULL) = 2418
--- SIGCHLD (Child exited) ---
getpid() = 1761
fork() = 2419
wait4(2419, ********** Warning: Alternative 2 also failed
******* JRockit failed in setfs -1 - repeat
NULL, 0, NULL) = 2419
--- SIGCHLD (Child exited) ---
getpid() = 1761
fork() = 2420
test.java is:
public class test {
public static void main(String[] args) {
System.out.println("test");

Hi Chris.
I agree, I think it may be something in the OS like glibc or perhaps some other lib.
Unfortunately we don't test on debian, and we don't certify on it. 8-(
You might compare glibc versions between your version of debian and the version of
redhat we support, and make them the same if possible. Other than that I'm not sure
what else to suggest other than go with RedHat.
Maybe someone else reading this forum can offer a better suggestion.
Regards,
Michael
Christoph Sturm wrote:
Hi Michael!
I tried both the old version and the 7.0 version on debian, and it didnt work.
Both versions worked fine on RH.
maybe a problem with the glibc.
tell me if you need any config info or want me to run tests.
regards
chris
Michael wrote:
Hi.
Hmm, weird. I tried your test app on RH linux with jrockit and it worked fine.I
gather you are not getting a jrockit.dump file, so it's an initialization problem.
I don't have any good suggestions. You might try the new release of JRockit7.
Your copy of jrockit may have been corrupted.
HTH,
Michael
M wrote:
running within gdb is slightly different:
This GDB was configured as "i386-linux"...
(gdb) set args -Xmx128m test
(gdb) r
Starting program: /usr/local/jrockit/jre1.3.1/bin/i386/native_threads/java -Xmx1
28m test
[New Thread 1024 (LWP 21840)]
********** Warning: Alternative 2 also failed
******* JRockit failed in setfs -1 - repeat
********** Warning: Alternative 2 also failed
******* JRockit failed in setfs -1 - repeat
this repeats over and over

Similar Messages

  • New Output Module install generates an i/o error when running even on a single image.

    Adobe *had* removed the Output Module from Bridge, and I see now there is a (tedious) "manual" install to "reinstate" the module available online, but it is not functional. It generates an i/o error when running even on a single image.

    I'm afraid this is not helping the OP
    There are already to many having this I/O problem showing in several other threads and in this forum there is still no solution found. Can you pass this on to Adobe Tech please?
    Thanks

  • When running a "stand-alone" APP..how do I send midi from Logic?

    Hi all,
    When running a "stand-alone" APP..how do I send midi from Logic?.....Please no IAC stuff it doesn't work.......thanx
    SvK

    using IAC here no problems. works very well.
    you can host your au's in another app such as soundflower or au lab, but you are still going to need to get it to hear midi. you can use physical midi ports with something like a MTP midi interface, and getting the midi by routing the out of one port to the in of another (midi loop) but you have to be careful logic doesn't listen to the same midi signal or everything will jam up (midi feedback).

  • Server Error: Unexpected Error when running Napa SharePoint 2013 App

    I am getting an error "Server Error : Unexpected error" when I try to run a SharePoint 2013 app in Napa Development environment.
    It starts the process normally but after it shows "Uninstalling previous version" it throws the error. This has been happening since yesterday.Someone help

    I have a solution to the problem. I had a folder with a JSON file. On renaming the file to .txt, the app ran normally. I believe .json files are not supported in SharePoint hence the error.

  • P6.2.1: Got error when running update baselines: java error

    In P6.2.1 I tried to update my baseline but received
    Error running the selected application: C:\Program Files\Common Files\Primavera Common\Java\_jvm\bin\java.exe
    I followed the note "Error Running Selected Application Java.exe" When Running Update Baseline [ID 899322.1]
    Im using an account with no spaces in username. I have uninstalled Primavera and reinstalled and still get the same error.

    Hi,
    I am using P6 pro R8.2.0 Built # 1926
    Java 1.6.0_27-b07
    I have the same problem when trying to use the Baseline Updates.
    Here is the error message
    The Selected application : \Bin\JAVA.EXE cannot be found.
    I also have a similar error when using the Claim Digger
    Here is the error message
    The selected application : \bin\JAVAW.EXE cannot be found
    Can someone help me ?
    Thanks

  • Error when trying to run my first Java app

    Okay, Im new to Java programming. I started a day ago :). My question is after I compile my application like so.
    javac TestGreeting.javaIt give me a .class file. So the next step is I want to run it so I do the following.
    java TestGreeting.classWhen I run this I get this error:
    Exception in thread "main" java.lang.NoClassDefFoundError: TestGreeting/classCan some one tell me what is going on? I am running Mac OSX Leopard on a MBP. I have the latest Xcode Tools which is 3.1 if I am not mistaken.
    Thanks everyone. Go easy on a newbie :)

    The argument for the java command is the fully qualified Class Name. It is not a file name or path. You provided a file name. The JVM tried to find a class named 'class' in a package named TestGreeting. Most likely, you should have typed "java TestGreeting"
    Here is a link to a tutorial, and the Getting Started section includes a section for problem resolution.
    [http://java.sun.com/docs/books/tutorial/]

  • Exception when running a compiled java program in DOS

    I'm new to programming in general and java in specific. I am using the jGrasp programming software, and successfully compile my program, but when I try to run it out of DOS (which I undesrtand is the purpose of java to begin with, unless I'm mistaken), I get an exception that looks exactly like this.....
    Exception in thread "main" java.lang.NoClassDefFoundError: keyboard/java
    Caused by: java.lang.ClassNotFoundException: keyboard.java
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    I realize I may just be missing something simple, as I've not been in the class for very long, but the book doesn't seem to have the answer. It is "Starting out with Java: Early Objects, Third Edition, by Tony Gaddis. Any help will be apprecieated. The program is below, it's really short.
    The program is a simple one to teach myself scanner input and an 'if' statement:
    *     basic input program
    import java.util.Scanner;
    public class keyboard
         public static void main(String[] args)
              String Class;
              int age;
              String race;
              char sex;
              String gender;
              Scanner keyboard = new Scanner(System.in);
              System.out.print("What class do you wish to be? ");
              Class = keyboard.nextLine();
              System.out.print("How old is your character? ");
              age = keyboard.nextInt();
              keyboard.nextLine();
              System.out.print("What sex is your character? M/F? ");
              gender = keyboard.nextLine();
              sex = gender.charAt(0);
              System.out.print("What race is your character? ");
              race = keyboard.nextLine();
              if (sex == 'M')
                   System.out.println("Today you will be playing a " + race + " " + Class +
                                                           " who is " + age + " years old at the start " +
                                                           "of his adventuring career!");
              if (sex == 'F')
                   System.out.println("Today you will be playing a " + race + " " + Class +
                                                           " who is " + age + " years old at the start " +
                                                           "of her adventuring career!");                                   
    }

    Childofheinlein wrote:
    I'm new to programming in general and java in specific. I am using the jGrasp programming software, and successfully compile my program, but when I try to run it out of DOS (which I undesrtand is the purpose of java to begin with, unless I'm mistaken), I get an exception that looks exactly like this.....
    So summerizing some of what was said before and some of that wasn't.
    jGrasp is a simplistic IDE. When you pop a dos window from it it sets up the windows correctly to run your program. When you open a regular command window you must do the same yourself.
    >
    Exception in thread "main" java.lang.NoClassDefFoundError: keyboard/javaJava runs "classes". The command that you typed above meant that you were trying to run a "file". Specifically the file "keyboard.java". The two are not the same. There is however a relationship. When the source code, in this case inside of "keyboard.java" is compiled it produces a file called "keyboard.class". Insided of the file there is a "class" called "keyboard". Notice that the name of the class does not have either .java nor .class on the end of it.
    The VM (the 'java' command) finds a "class" using the class path to search files of various types for the class (again keep in mind that files contain classes but they are not themselves classes.)
    You can add to the classpath using the Sun VM using either command line options or environment variables. As noted in some of the previous messages those are "-cp" and "CLASSPATH". It is important to note that that does NOT fully specify the class path. But for your purposes it is sufficient to think of it as doing so.
    The 'default' setting for the part of the class path that you normally set (like via '-cp') is the current directory which is specified by the ".". So normally the following are equivalent.
    java -cp . keyboard
    java keyboard
    The reason the VM could not find your class when you opened the dos window yourself is because you were in the wrong directory. If you had been in the directory with the file "keyboard.class" then it would have worked (if you have not messed with the environment variable "CLASSPATH".)
    So if your class file has the following location: c:\myapps\java\keyboard.class then you can do the following.
    1. Open a console window
    2. Type "cd c:\myapps\java"
    3. Type "java keyboard"
    If the above does not work then you are in the wrong directory or the env variable CLASSPATH has been set to something.

  • Lion freezing when running Adobe CS5.5 apps

    Is anyone having this issue or can you offer any troubleshooting help? I installed Lion a couple of days ago on one of my computers (2 x 3 GHx Dual-Core Intel Xeon with 2 GB 667 MHz EEC DDR2 FB-DIMM). When I open up any of the Adobe CS5.5 apps and begin working, after a while, I get the spinning beach ball. I had no issue before in Snow Leopard. Do I need to up my memory or are they just not playing together well?

    houstonalle wrote:
    with 2 GB 667 MHz EEC DDR2 FB-DIMM
    4GB memory would be better for Lion.
    Regards,
    Colin R.

  • How to enforce a login screen when running a Web Dynpro app?

    Hello,
    In Web Dynpro for Java there is a way to set authentication property to true and by that enforcing a login screen in case someone is browsing this application outside of an authenticated context (for example, the portal).
    My question is: How do I do this for Web Dynpro for ABAP?

    Roy, are you familiar with that http://help.sap.com/saphelp_nw04s/helpdata/en/ff/c7de3fc6c6ec06e10000000a1550b0/frameset.htm ?

  • Who's running a Flex-Java app in an enterprise clustered environment?

    And how are you handling session management and security?  Using distributed cache functionality such as that in Terracotta, or another method?

    Wow, don't everyone answer at once! 
    Is the question too open ended?

  • How do I run multiple java apps in one JVM to reduce memory use?

    Hi all,
    I saw an article either on the web or in a magazine not too long ago about how to "detect" if the app is already running, and if so, it hands off the new instance to the already running JVM, which then creates a thread to run the Java app in. As it turns out, my app will be used in an ASP environment, through Citrix. We may have as many as 50 to 100 users running the same app, each with their own unique user ID, but all using the same one server to run it on. Each instance eats up 25MB of memory right now. So the question is if anybody knows of a URL or an app like this that can handle the process of running the same (or even different Java) apps in one JVM as separate threads, instead of requring several instances of the JVM to run? I know this article presented a fully working example, and I believe I know enough to do it but I wanted ot use the article as a reference to make sure it is done right. I know that each app basically would use the same one "launcher" program that would on first launch "listen" to a port, as well as send a message through the port to see if an existing launcher was running. If it does, it hands off the Java app to be run to the existing luancher application and shuts down the 2nd launching app. By using this method, the JVM eats up its normal memory, but each Java app only consumes its necessary memory as well and doesn't use up more JVM instance memory.
    Thanks.

    <pre>
    import java.util.Properties;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    import java.util.Enumeration;
    import java.util.NoSuchElementException;
    public class RunProg implements Runnable, Cloneable
    private String iProg;
    private String iArgs[];
    public static void main(String args[])
    new RunProg().main();
    // first step is to start main program itself
    private void main()
    Properties properties = System.getProperties();
    try
    properties.load(new FileInputStream("RunProg.properties"));
    catch(IOException e)
    System.setProperties(properties);
    int i = 0;
    System.out.println("enter main, activeCount=" + Thread.activeCount());
    while(true)
    String program = properties.getProperty("Prog" + i);
    if(program == null)
    break;
    StringTokenizer st = new StringTokenizer(program);
    String[] args = new String[st.countTokens() - 1];
    try
    RunProg rp = (RunProg)this.clone();
    rp.iProg = st.nextToken();
    for(int j = 0; st.hasMoreTokens(); j++)
         args[j] = st.nextToken();
    rp.iArgs = args;
    Thread th = new Thread(rp);
    th.setName("prog" + i + "=" + program);
    th.start();
    System.out.println("prog" + i + "=" + program + ", started");
    catch(CloneNotSupportedException e)
    System.out.println("prog" + i + "=" + program + ", can't start");
    i++;
         System.out.println("end of main, activeCount=" + Thread.activeCount());
    // next step is to start all others one by one
    public void run()
    try
    Class c = Class.forName(iProg);
    Class p[] = new Class[1];
    p[0] = String[].class;
    Method m = c.getMethod("main", p);
    Object o[] = new Object[1];
    o[0] = iArgs;
    m.invoke(null, o);
    catch(ClassNotFoundException e)
    System.out.println(iProg + "ClassNotFoundException");
    catch(NoSuchMethodException e)
    System.out.println(iProg + "NoSuchMethodException");
    catch(InvocationTargetException e)
    System.out.println(iProg + "NoSuchMethodException");
    catch(IllegalAccessException e)
    System.out.println(iProg + "NoSuchMethodException");
    System.out.println(Thread.currentThread().getName() + ", ended");
    System.out.println("exit run, activeCount=" + Thread.activeCount());
    // setup SecurityManager to disable method System.exit()
    public RunProg()
         SecurityManager sm = new mySecurityManager();
         System.setSecurityManager(sm);
    // inner-class to disable method System.exit()
    protected class mySecurityManager extends SecurityManager
         public void checkExit(int status)
              super.checkExit(status);
              Thread.currentThread().stop();
              throw new SecurityException();
    * inner-class to analyze StringTokenizer. This class is enhanced to check double Quotation marks
    protected class StringTokenizer implements Enumeration
    private int currentPosition;
    private int maxPosition;
    private String str;
    private String delimiters;
    private boolean retTokens;
    * Constructs a string tokenizer for the specified string. All
    * characters in the <code>delim</code> argument are the delimiters
    * for separating tokens.
    * <p>
    * If the <code>returnTokens</code> flag is <code>true</code>, then
    * the delimiter characters are also returned as tokens. Each
    * delimiter is returned as a string of length one. If the flag is
    * <code>false</code>, the delimiter characters are skipped and only
    * serve as separators between tokens.
    * @param str a string to be parsed.
    * @param delim the delimiters.
    * @param returnTokens flag indicating whether to return the delimiters
    * as tokens.
    public StringTokenizer(String str, String delim, boolean returnTokens)
    currentPosition = 0;
    this.str = str;
    maxPosition = str.length();
    delimiters = delim;
    retTokens = returnTokens;
    * Constructs a string tokenizer for the specified string. The
    * characters in the <code>delim</code> argument are the delimiters
    * for separating tokens. Delimiter characters themselves will not
    * be treated as tokens.
    * @param str a string to be parsed.
    * @param delim the delimiters.
    public StringTokenizer(String str, String delim)
    this(str, delim, false);
    * Constructs a string tokenizer for the specified string. The
    * tokenizer uses the default delimiter set, which is
    * <code>"&#92;t&#92;n&#92;r&#92;f"</code>: the space character, the tab
    * character, the newline character, the carriage-return character,
    * and the form-feed character. Delimiter characters themselves will
    * not be treated as tokens.
    * @param str a string to be parsed.
    public StringTokenizer(String str)
    this(str, " \t\n\r\f", false);
    * Skips delimiters.
    protected void skipDelimiters()
    while(!retTokens &&
    (currentPosition < maxPosition) &&
    (delimiters.indexOf(str.charAt(currentPosition)) >= 0))
    currentPosition++;
    * Tests if there are more tokens available from this tokenizer's string.
    * If this method returns <tt>true</tt>, then a subsequent call to
    * <tt>nextToken</tt> with no argument will successfully return a token.
    * @return <code>true</code> if and only if there is at least one token
    * in the string after the current position; <code>false</code>
    * otherwise.
    public boolean hasMoreTokens()
    skipDelimiters();
    return(currentPosition < maxPosition);
    * Returns the next token from this string tokenizer.
    * @return the next token from this string tokenizer.
    * @exception NoSuchElementException if there are no more tokens in this
    * tokenizer's string.
    public String nextToken()
    skipDelimiters();
    if(currentPosition >= maxPosition)
    throw new NoSuchElementException();
    int start = currentPosition;
    boolean inQuotation = false;
    while((currentPosition < maxPosition) &&
    (delimiters.indexOf(str.charAt(currentPosition)) < 0 || inQuotation))
    if(str.charAt(currentPosition) == '"')
    inQuotation = !inQuotation;
    currentPosition++;
    if(retTokens && (start == currentPosition) &&
    (delimiters.indexOf(str.charAt(currentPosition)) >= 0))
    currentPosition++;
    String s = str.substring(start, currentPosition);
    if(s.charAt(0) == '"')
    s = s.substring(1);
    if(s.charAt(s.length() - 1) == '"')
    s = s.substring(0, s.length() - 1);
    return s;
    * Returns the next token in this string tokenizer's string. First,
    * the set of characters considered to be delimiters by this
    * <tt>StringTokenizer</tt> object is changed to be the characters in
    * the string <tt>delim</tt>. Then the next token in the string
    * after the current position is returned. The current position is
    * advanced beyond the recognized token. The new delimiter set
    * remains the default after this call.
    * @param delim the new delimiters.
    * @return the next token, after switching to the new delimiter set.
    * @exception NoSuchElementException if there are no more tokens in this
    * tokenizer's string.
    public String nextToken(String delim)
    delimiters = delim;
    return nextToken();
    * Returns the same value as the <code>hasMoreTokens</code>
    * method. It exists so that this class can implement the
    * <code>Enumeration</code> interface.
    * @return <code>true</code> if there are more tokens;
    * <code>false</code> otherwise.
    * @see java.util.Enumeration
    * @see java.util.StringTokenizer#hasMoreTokens()
    public boolean hasMoreElements()
    return hasMoreTokens();
    * Returns the same value as the <code>nextToken</code> method,
    * except that its declared return value is <code>Object</code> rather than
    * <code>String</code>. It exists so that this class can implement the
    * <code>Enumeration</code> interface.
    * @return the next token in the string.
    * @exception NoSuchElementException if there are no more tokens in this
    * tokenizer's string.
    * @see java.util.Enumeration
    * @see java.util.StringTokenizer#nextToken()
    public Object nextElement()
    return nextToken();
    * Calculates the number of times that this tokenizer's
    * <code>nextToken</code> method can be called before it generates an
    * exception. The current position is not advanced.
    * @return the number of tokens remaining in the string using the current
    * delimiter set.
    * @see java.util.StringTokenizer#nextToken()
    public int countTokens()
    int count = 0;
    int currpos = currentPosition;
    while(currpos < maxPosition)
    * This is just skipDelimiters(); but it does not affect
    * currentPosition.
    while(!retTokens &&
    (currpos < maxPosition) &&
    (delimiters.indexOf(str.charAt(currpos)) >= 0))
    currpos++;
    if(currpos >= maxPosition)
    break;
    int start = currpos;
    boolean inQuotation = false;
    while((currpos < maxPosition) &&
    (delimiters.indexOf(str.charAt(currpos)) < 0 || inQuotation))
    if(str.charAt(currpos) == '"')
    inQuotation = !inQuotation;
    currpos++;
    if(retTokens && (start == currpos) &&
    (delimiters.indexOf(str.charAt(currpos)) >= 0))
    currpos++;
    count++;
    return count;
    </pre>
    RunProg.properties like this:
    Prog1=GetEnv 47838 837489 892374 839274
    Prog0=GetEnv "djkfds dfkljsd" dsklfj

  • Kill opened IE, when killing Swing Java App

    I am creating menu items which fire off an IE window to a URL. However, when app is closed the Java process that runs the app blocks waiting for the executed browser to terminate before its shuts itself down. This has potential repercussions as the Java VM hangs around in the mean time, holding resources. Can anyone point me in the direction of how to kill the opened IE window when I kill the java app? I would greatly appreciate any help. :-)
    This is the code in question:
    userManualMenuItem.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
         try
         String url = System.getProperty("EASEUserManualURL");
         Runtime r = Runtime.getRuntime();
         Process p = r.exec("iexplore " + url);
         catch(Exception exception)
              Logger.getLogger().logError("Error opening Intenet Explorer to show EASE user manual.\nCause: " + exception.getMessage());
         });

    Wouldn't it solve the problem if you made the exec() call on a daemon
    thread? I wouldn't advise making exec() calls on the EDT in any case. 1 - You can't call exec() on a Daemon thread. You can call Runtime.exec() inside of a spawned thread that has been marked as a Daemon. This would be preferably rather than launching off of the EventDispatcherThread as itchystratchy stated because....
    http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
    I'm sure there's a way you can just launch the user's default browser isn't there?2. - I use http://browserlaunch2.sourceforge.net/ in my current app, it launches whatever application you have associated for that file type to view that file. Also supposedly cross platform. You will not get Process reference to the launched app though. I've tested successfully on Win 2000 and XP up to now but it will allow you to close your Java application and leave any launched browsers open if that is what you are looking for or as you asked for earlier keep a collection of launched Process references and destory them when your user is closing your app.

  • Show java app name in task manager

    Right now if I run 10 java apps in seperate JVMs, it shows 10 copies of java.exe in the task manager on Windows NT/2000.
    Does anyone know a way to change the image name when I launch my java apps, or a simple way to create a java "application" for windows (for example, NetBeans shows up as Netbeans.exe even though it is a java app).
    Thanks!

    Turns out you can copy java.exe to anyname.exe and execute anyname.exe just like java.exe.
    DOH!

  • Java app with web service and servlets

    Hi. I intend to make a java application which exposes some methods as a web service and as jsp/servlets. It's core functionality is not really web centric, but its more a java app with a web tier. I am not sure about how the architecture of such a system would look like using the java platform. I currently see three options:
    1. Run everything in a servlet container like tomcat. I hesitate to do this because i would be putting a lot of functionality which isn't about the web into a servlet container. Also, I have a lot of application scope data that is maintained and shared by all servlets/web services. However, it would be really easy just to put everything into tomcat and use ServletContext to maintain some global objects.
    2. Use a Java EE to seperate application/business logic and data access into session beans and entity beans. I hesitate to this because it seem a bit overkill because the system isn't very big or complex right now. It also means that I would have to learn to use EJB's instead of just using some POJOs.
    3. Run the web tier in a servlet container and the main app in a separate JVM, and then connect the tier by sending serialized objects over TCP sockets. I don't like writing network code but at least there is some separation of the tiers.
    What would you do? Maybe I have overlooked a much better solution to the problem?
    Let me just say that the system is the product of a student project spanning one semester, so it's important to choose the RIGHT solution (architectural-wise) instead of the something quick and dirty that is hard to defend.

    jschell wrote:
    Run everything in a servlet container like tomcatTomcat is a JEE container.Now I am confused. Maybe you mean Glassfish? Tomcat is definitely a web container(?).
    Let me just say that the system is the product of a student project spanning one semester, so it's important to choose the RIGHT solution (architectural-wise) That pretty much makes it impossible then.
    1. A "Right" solution is generally only proven by time.
    2. It requires a great deal of knowledge about the business domain.Yeah, you are right. Let be try to rephrase it. What solution (pattern) would be considered the most common or appropriate when you have a Java App and want to expose a few methods as a website and web service?
    I hesitate to do this because i would be putting a lot of functionality which isn't about the web into a servlet container. Also, I have a lot of application scope data that is maintained and shared by all servlets/web servicesHuh? Do you already have an exposed web service? If you already have a server which other clients communicate then where does this functionality that you don't want to be tomcat running now? Or where do you think that you want to run it? And if you are or do run it somewhere else then tomcat could access it the same way any other client accesses that server.Sorry, that sentence was written badly. I don't have anything right now. What I meant to write was that I will have a lot of application scope data, objects that are kept in memory as long as the server is running, shared by multiple servlet instances.

  • Killing Java app from C

    Ive seen this question posted before, but never found a good answer. I am invoking a JVM from a legacy C app (via JNI_CreateJavaVM) and I want to be able to end the JVM and have the C app continue. The problem is that a call to System.exit() from inside the java app causes the entire native process (not just the JVM) to be killed. A call to DestroyJavaVM() does not unload the
    JVM (as it claims it does in the API documentation).
    Currently, the Java code calls dispose and System.gc (for good measure) on exiting, although this doesnt completely kill the java app. If the user wishes to invoke another Java app, the C code uses JNI_GetCreatedVMs to see if one already exists, and if so uses AttachThread (or GetEnv) to hook to the existing JVM to run the new Java app. The problem with this is with complicated GUI apps, the machine soon hits a wall, I guess because of un-gc'd stuff laying around.
    Is there a way to kill the app from java without using System.exit or is there a way to unload the JVM from the C app?

    Unfortunately I am running into the same issues using JDK1.4 on Win32. Basically the call to jvm->DestroyJavaVM() is NEVER returning. This seems to mainly be a problem when you use classes which require a native class loader to load native libraries. EX: classes which use System.loadLibrary("some native library"). Has anyone found a workaround to allow us to stop the jvm from the native side when these are present?
    Also if anyone in interested - this is the exact c++ code I am currently using:
        if(vm != NULL) {
             * Detach the current thread from the vm so that it appears to have
             * exited when the process has detatched from the dll.
            if (vm->DetachCurrentThread() != 0) {
                MessageBox(NULL,"Could not detatch the Java Virtual Machine","DEBUG Info",MB_OK+MB_ICONEXCLAMATION);
            MessageBox(NULL,"Try to destroy the VM","DEBUG Info",MB_OK+MB_ICONEXCLAMATION);
            vm->DestroyJavaVM();
            vm = NULL;
        MessageBox(NULL,"JVM destroyed successfully","DEBUG Info",MB_OK+MB_ICONEXCLAMATION);Basically all the calls succeed except the vm->DestroyJavaVM(); including the call to detatch the current thread from the VM! Am I missing something obvious? Is this a known bug? Anyone know any workarounds? Aany and all constructive comments are welcome.

Maybe you are looking for