JVM exit handler -  for jvm invoked thro' native C

complicated, atleast for me :) where do I find if JVM installs any exit handlers when invoked through native C app.
OS -> HP UX 11
java -version ->
java version "1.4.0.02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0.02-021031-18:00)
Java HotSpot(TM) Server VM (build 1.4 1.4.0.02-021031-19:15-PA_RISC2.0 PA2.0, mixed mode)
Although jvm used is HP's hotspot, behaviour seems to be generic, so any directions are appreciated.
In my case JNI based native shared object (on ux) is being used as a pluggin for comm with microsoft SQL2k.
A daemon loads the pluggin (shl_load) -> transaction -> unloads (shl_unload) pluggin.
For each tran I need to create a new JVM instance and later distroy it as it is not possible to multiple times create and distroy JVM in same process space (as encountered)
LD_PRELOAD=.../libjvm.sl
start the daemon( basic signals masked)
Parent -> fork() a child process and wait for its exit status.
Child -> Load JVM and execute reqd method
Child -> unload JVM
Child -> exit() the child process
Parent ->Check the child process exit() code and carry further processing.
Sometimes child does not exit cleanly. Even after exit() child process can be seen in process table and parent wait()'s idefinetly for child exit code.
gdb ouput of child preocess
#0 0xdd28ca38 in os::report_fatal_error () from /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
#1 0xdd28dc48 in os::handle_unexpected_exception ()
from /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
#2 0xdd296c50 in os::Hpux::JVM_handle_hpux_signal ()
from /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
#3 0xdd293adc in os::Hpux::signalHandler ()
from /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
#4 <signal handler called>
#5 0x7e5e6134 in ?? ()
#6 0xc03c6fbc in __niamHelper () from /usr/lib/libCsup.2
Can any one tell me what exactly is happening ?
If I call [b]_exit() instead of exit() everything works fine.

Thnx a lot,
     Finally I was able to locate atexit()'ed function which was causing the problem (setting br at exit() was not working, execution straightway stopped at #0)
(gdb) thr 1
[Switching to thread 1 (system thread 17555)]
(gdb) bt
#0 0x7e6224e0 in epc_exit_handler () from /citisafe/users/yogiraj/cs35/dll/ora_tcp.sl
#1 0xc03c6fbc in __niamHelper () from /usr/lib/libCsup.2
#2 0xc03c7110 in niambody () from /usr/lib/libCsup.2
#3 0xc03c721c in _niam () from /usr/lib/libCsup.2
#4 0xc016fe20 in exit () from /usr/lib/libc.2
#5 0xc4f0c364 in sql_exec_custStrProc () from /citisafe/users/yogiraj/cs35/lib/libtcsql.sl
#6 0x7ec0c9f4 in exec_ext_mgmt (p_ExtCredentials=0x7edf2878)
at /citisafe/users/yogiraj/cs35/c/sql_app.c:251
#7 0x9620 in adm_process_rec ()
#8 0x8bc8 in process_pwd_requests ()
#9 0x8684 in adm_do_ext_sync ()
#10 0x7f5c in main ()
Oracle client lib was the culprit.     Daemon is basically a 'C' daemon which loads pluggins for communication with various DB's including Oracle, Sybase, MS SQL etc and later unloads them on completion.
Ora lib libclntsh.sl installed "epc_exit_handler", eventhough we had shl_unload()'ed oracle pluggin earlier the handler refrence was still around. Later when process exit()'ed may be static dealloaction mech panicked.
Above exit() handler execution even after unloading of Oracle libs seems to be a known bug and work around suggested is to LD_PRELOAD=%ORALIB/libclntsh.sl. After LD_PRELOAD'ing exit() works fine.

Similar Messages

  • System asking me to fill MANDATORY fields, even I used EXIT-COMMAND for F3

    HI Experts,
    issue- there is mandatory field in the screen, so, am using the folllowing code, system asking me to fillup the mandatory field.
    then, i used exit-command, but, still its asking me to fill the mandatory fiels???????????
    code is,
    process after input.
    ***Exit command
    module cancel at exit-command.
    module cancel.
    module user_command_9001.
    module cancel input.
    case: ok_code.
    when wa_con_back.
    clear ok_code.
    set screen 0.
    leave screen.
    when wa_con_exit.
    clear ok_code.
    set screen 0.
    leave screen.
    endcase.
    endmodule. " cancel INPUT
    thanq

    I am not sure but try making a specific module for your exit handling, for instance:
    module do_exit at exit-command.
    module cancel
    module user_command_9001.
    Hope it helps you,
    Bert

  • How to specify for JVM the stack for ONE specific thread that invokes JNI

    Hello all!
    I'm 2 days now looking for a solution in several forums but even in Sun Java Forums nobody was able to come up with a solution. If you know a better forum to place it, please let me know.
    Description:
    I have an application that launches several threads of different types. One of them is quite specific and run a critical JNI C++ process. The remaining ones are just for controling of other stuff... When I call the application by the command line
    java -classpath ... -Xss20m -Djava.library.path ... pack.subpack.myApp
    the application usually crashes: My computer has 256MB RAM of memory that vanish in seconds and causes an OutOfMemoryException
    Sometimes the application works properly, but sometimes the memory usage goes up fast until a general crash.
    What I believe that is going on:
    When we declare -Xss20m, I undestand that for each thread the JVM will attemp to allocate more 20MB, and if I have 10 threads, it goes up to 200MB and so on; however I'd like to have 20MB just for my critical process (that is called in one specific thread) and not for any thread.
    If I try to reduce -Xss parameter to, let's say 10MB, my C++ process overflow the JVM stack for the thread.
    So, does any body have know how to solve it? Please... I need experts help!
    Thanks a lot,
    Calegari

    There we go...
    I have this class:
    package calegari.automata;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2003</p>
    * <p>Company: </p>
    * @author Aur�lio Calegari
    * @version 1.0
    public class Native {
    * Parameters:
    * individuals --> All binary individual (AC rule)
    * indivLength --> number of infividuals
    * numEval --> number of RIs
    * generateUniform --> Uniform distribution of density
    * seed --> seed for current generation
    public native double[] AutomataIterator(int[][] individuals,
    int indvLength,
    int numEval,
    boolean generateUniform,
    long seed
    static {
    System.loadLibrary("Native");
    public Native() {
    Then, running
    javah -classpath ... calegari.automata.Native
    I'll get the following .h
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include "jni.h"
    /* Header for class calegari_automata_Native */
    #ifndef Includedcalegari_automata_Native
    #define Includedcalegari_automata_Native
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: calegari_automata_Native
    * Method: AutomataIterator
    * Signature: ([[IIIZJ)[D
    JNIEXPORT jdoubleArray JNICALL
    Java_calegari_automata_Native_AutomataIterator___3_3IIIZJ
    (JNIEnv *, jobject, jobjectArray, jint, jint, jboolean, jlong);
    #ifdef __cplusplus
    #endif
    #endif
    Next, I built my cpp file which is right bellow
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include "jni.h"
    #include "calegari_automata_Native.h"
    #include "util.h"
    double IndividualEvaluator(long rule[], int automataCells[][149], int numInit1s[],
    int numOfACs, int numEvaluations);
    char getNext(char simb);
    JNIEXPORT jdoubleArray JNICALL
    Java_calegari_automata_Native_AutomataIterator___3_3IIIZJ
    (JNIEnv *env, jobject jobj, jobjectArray indiv, jint length, jint numEval,
         jboolean isUniform, jlong seed)
    printf("Native JVM call for C++ critical block: Started \a[-]");
    int ACs[10000][149]; //Will be filled with 100000 Initial states of a cellular automata
    int numIndiv = length;
    int numOfACs = numEval;
    //Dencity of each Initial state of cellular automata
    int num1sRIs[10000];
    //response
    double resp[1000];
    //set seed
    srand((unsigned int) seed);
    //generate Cellular automata states
    //Uniform generation
    if(isUniform)
    for(int i=0;i<numEval;i++)
    int num1s;
    num1s=0;
    for(int j=0;j<149;j++)
    ACs[i][j] = ((rand()%numEval)<i+1?0:1);
    if(ACs[i][j]==1) num1s++;
    num1sRIs[i] = num1s;
    printf(" %d ",num1s);
    else //not uniform generation
    for(int i=0;i<numEval;i++)
    int num1s;
    num1s=0;
    for(int j=0;j<149;j++)
    ACs[i][j] = rand()%2;
    if(ACs[i][j]==1) num1s++;
    num1sRIs[i] = num1s;
    //load individuals and start the critical method
    char simb = '-';
    for(int i=0;i<numIndiv;i++)
    jintArray oneDim = (jintArray) env->GetObjectArrayElement(indiv, i);
    jint *indiv=env->GetIntArrayElements(oneDim, 0);
    simb = getNext(simb);
    printf("\b\b%c]",simb);
    resp[i] = IndividualEvaluator(indiv,ACs,num1sRIs,numOfACs,300);
    jdoubleArray retApts;
    retApts = env->NewDoubleArray(numIndiv);
    env->SetDoubleArrayRegion((jdoubleArray)retApts,(jsize)0,numIndiv,(jdouble *)resp);
    printf("\nReturning to Java plataform: Completed\a\a\n");
    return retApts;
    char getNext(char simb)
    if(simb=='-') simb = '\\';
    else if(simb=='\\') simb = '|';
    else if(simb=='|') simb = '/';
    else if(simb=='/') simb = '-';
    return simb;
    Then it works fine since we declare the size of the stack to JVM, however, if we don't... We get a crash!
    Any idea?
    Thanks

  • Exit handling in native function by JNI

    Hi everyone,
    We are developing a Java application using native function calls through JNI in Linux.
    The application starts and calls a native function and the native function attach a signal
    handler and an exit handler. In addition, in the native function, we fork another process
    and in the forked process, we calls a several java-side methods. It works in normal cases.
    However, when System.exit() is called in the java-side methods invoked by a native function,
    the application is stopped. Thus we add shutdown hook (Runtime.getRuntime().addShutdownHook())
    to treat this case. The shutdown hook just calls a native method, and the native method
    just calls exit(). We expect the calling exit() in the native method invoked in shutdown hook for JVM
    invokes our exit handler which is attached in advance. It looks working well.
    But, sometimes we find several garbage(?) jvm processes (we can see the process named as "java"
    in using Linux command "ps"). The parent process of these processes is init process (pid = 1).
    With the pid of these processes, we suspect the processes are created when we fork another process
    in native function invoked through JNI. However it is not happened every times in our application.
    Why the garbage java processes remain? Is there any problem in the calling exit() in the native
    method invoked during JVM Shutdown process?
    I hope any answers for this problem.
    Thanks in advance,
    Seung-Uk Oh

    Thus we add shutdown hook
    (Runtime.getRuntime().addShutdownHook())
    to treat this case. The shutdown hook just calls a
    native method, and the native method
    just calls exit(). We expect the calling exit() in the
    native method invoked in shutdown hook for JVM
    invokes our exit handler which is attached in advance.
    It looks working well.I wouldn't think that was a good idea.
    You are terminating the JVMs normal exit process. Why don't you just register the exit processes in your own stack and call them with the native method?

  • When does the JVM exit ?

    I am curious as to what could be the reasons when the JVM exits.Googling didn't give me much relevant links (my bad,may be !!).
    However the JLS states :
    A program terminates all its activity and exits when one of two things happens:
    1. All the threads that are not daemon threads terminate.
    2. Some thread invokes the exit method of class Runtime or class System and the exit operation is not forbidden by the security manager.
    Now,Are there any other reasons apart from the above that may result in a JVM to exit ? I would appreciate any pointers.
    Thank you for your consideration.
    Edited by: punter on Jan 4, 2010 4:14 AM

    Well, you already found the "normal" ways of exiting the JVM.
    punter wrote:
    Now,Are there any other reasons apart from the above that may result in a JVM to exit ? I would appreciate any pointers.It can also halt unexpectedly: crashing. By the very nature of crashes it's hard to define how exactly they happen. But they can happen.
    I assume that you could also call exit() (the C function) from native code, the JVM probably couldn't do much about that.

  • Solaris: memory not freed after JVM exits - why?

    Hi all,
    A client of ours has a Java application that appears to leak memory. Yawn, shrug.
    However, when the application and the JVM exit, some memory still remains missing, as evidenced by vmstat.
    On average, per run of the application 67 MB of memory and 95 MB of swap space 'disappears', eventually rendering the machine unusable. The only way to get the memory back is to reboot the machine.
    This baffles me; I'd expect the JVM to return all memory to the free list when it exits.
    System: SunOS 5.10 Generic_137111-01 sun4u sparc SUNW,Sun-Fire-15000, 32 GB physical memory.
    java version "1.5.0_05"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
    Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_05-b05, mixed mode)
    Java is invoked with:
    java -server -d64 -Xmx20G -Xms20G ...
    Has anyone seen this phenomenon before? If so, do you know what causes it? And better yet, is there a known solution for it?
    Thanks!
    Mark

    The old JVM is not my choice. My client has several Java applications running and currently doesn't have the manpower to do the retesting required when employing a newer JVM.
    I have asked the supplier of the offending program whether it will run with Java 6. They are currently looking into it.
    Mark

  • How to create per instance jvm.config files for multi-instance ColdFusion Cluster ?

    So when we have created our coldfusion 9 instance on solaris all the files and settings of the master instance are copied except the jvm.config file. This means that any changes made here are used for all instances of ColdFusion on that Node.  Now I want to play with memory settings for fine tuning of Application performance and I want to do it on one single instance. I want to know the process of creating individual jvm.config files for each instance.
    Thanks
    Pradeep

    Thanks Anit,  I did whatever is posted in the KB Article. Now I get this below error #
    jrunx.xml.XMLMetaData$CouldNotCreateDocumentException: Could not create document from location 'file:/data/www/appserver/jrun/lib/servers.
    xml'
            at jrunx.xml.XMLMetaData.createDocument(XMLMetaData.java:1028)
            at jrunx.xml.XMLMetaData.importXML(XMLMetaData.java:200)
            at jrunx.xml.XMLMetaData.<init>(XMLMetaData.java:122)
            at jrunx.server.metadata.ServersMetaData.<init>(ServersMetaData.java:32)
            at jrunx.server.ServerManagement.refreshServersMetaData(ServerManagement.java:82)
            at jrunx.server.ServerManagement.getServerRootDirectory(ServerManagement.java:154)
            at jrunx.server.ServerManagement.getServerProperties(ServerManagement.java:191)
            at jrunx.server.ServerManagement.getSystemProperties(ServerManagement.java:204)
            at jrunx.kernel.JRun.setSystemProperties(JRun.java:688)
            at jrunx.kernel.JRun.start(JRun.java:337)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at jrunx.kernel.JRun.invoke(JRun.java:180)
            at jrunx.kernel.JRun.main(JRun.java:168)

  • Error code 143 on JVM exit

    Hello,
    I have a program (with multiple threads, running under MS-Windows) which works fine almost all the time.
    In one case, it terminated unexpectedly, and the exit code (via ERRORLEVEL) is 143.
    There are no other outputs in order to diagnose the problem.
    I would like to know what the error code 143 exactly means.
    Can anybody give me an advice?
    Regards,
    Sabrina Werscheid

    Hello!
    I hope people there is reading old posts too. I have the same problem with code 143. JVM exits unexpectedly, but I believe it is specific block of code which acts differently. I`m trying solution with -Xrs switch, but I`m sure I have no JNI and there is no System.exit() in code at all. Also I know there is no external processes which asks JVM to close.
    I have running special FIT tests in child-jvm as ANT task. The exiting is ANT task, not my FIT tests, but at the same time this is not happening on any other processes.
    I can`t found any references about "Internal field must be valid". What does it mean? What and where to search for problem?
    Any other ideas?
    Using JVM 1.5.14

  • How to increase JVM Process size for WebLogic running SOA Applications.

    Hi,
    I believe 32 Bit OS can address up to 4GB memory so theoretically 32 Bit JVM can use 4GB but practical convention is 2GB as other 2GB is used by OS itself and also this default JVM Process size is set somewhere and I also believe that if JVM is 32 bit on 64Bit OS even though JVM will run on 32Bit Virtual Machine so JVM does not know that it is 64Bit OS in that case again it can use max Process default size up to 2GB.
    And for 64Bit JVM, I can allocate more than 4GB depend on my available RAM size to Xmx, MaxPermSize parameters in java.exe file and after that I can set the same value in “setSOADomainEnv.cmd” or to “setDomainEnv.cmd” file.
    But I am 99% sure by just assigning more memory value to Xmx, MaxPermSize in “setSOADomainEnv.cmd” file only won’t work (not setting Xmx in java.exe), if it would have worked then in my case when I was assigning 1536 to Xmx in “setSOADomainEnv.cmd” file then why it was showing out of memory error. I think that is because it was only taking default 2GB for my 32 Bit JVM not considering 3GB or 4GB. So i think i have to change default memory size what JVM can use (<http://www.wikihow.com/Increase-Java-Memory-in-Windows-7> but i am using windows 8 so for that I don’t know the option to change this default Process Size)
    I also believe that first JVM start and before start it check how much memory it can use from it’s own –Xmx parameter in some ware configuration or java.exe file and after that it allocate that much size of JVM Process Memory in RAM then after it loads Weblogic or Java Applications in its (Heap + Non-heap + Native Area) which are parts of JVM Process memory
    I read post on :< http://stackoverflow.com/questions/3143579/how-can-jvm-use-more-than-4gb-of-memory > and < http://alvinalexander.com/blog/post/java/java-xmx-xms-memory-heap-size-control >
    All used  : 
    java -Xmx64m -classpath ".:${THE_CLASSPATH}" ${PROGRAM_NAME}
    java –Xmx6g     //command which will call java/JVM interpreter which will hold –Xmx parameter to set Heap size for JVM
                                    before JVM comes in memory (JVM process memory)
    now my question is can I manually open any configuration file or java.exe same like “setSOADomainEnv.cmd” or “setDomainEnv.cmd” (I know since java.exe is exe I can’t open simply but I want similar work around)
    so that I don’t need to type java –Xmx6g every time when I run weblogic (and then later I can change weblogic “setDomainEnv.cmd” Xmx and PermSize to more than default size 4GB to 5GB or 6GB in the case of 64Bit OS)
    Please correct me if I am wrong in my understanding.
    Thanks.

    These days the VM will detect a "server" machine and set up the memory appropriate for that.
    You can create a simple java console application and have it print the memory settings (find the appropriate java class fort that.)
    There is of course the possibility that your application is running out of memory because it is doing something wrong and not because the VM doesn't have enough memory.  You can force that in a test setup by LOWERING the maximum amount of memory and thus making it more likely that an out of memory exception will occur.

  • Resources freed on JVM Exit?

    When I exit the JVM due to a RunTimeException thrown part way thru
    constructing an object that has acquired some resources (like inputStreams for instance), do the resources get closed/cleaned up by the JVM during it's exit or have I left these resources tied up permanently?
    I'm very clear that I must cleanup the resources myself if dealing with checked Exceptions that I don't translate into a JVM exit.
    Thanks in advance for any help.

    Thanks for the replys. I'm getting out of this that
    a RunTimeException
    caused exit of the JVM does not gaurantee cleanup of
    stream resources
    in particular. Correct?Depends what you mean by cleanup. All the resources obtained from the OS will be returned. There's no guarantee any streams will be flushed though.
    wrt finally, it is my understanding this execution
    gaurantee applies only to checked exceptions and not
    to RTEs? Is this correct?You could test your assumption very easily and see for yourself, but no, that's not correct.
    Finally will always be executed unless the thread terminates--e.g. by System.exit, an untrapped signal, etc. Break, continue, throw, return in try or catch all transfer control to finally.

  • File close on JVM exit

    See the following code:
    import java.io.*;
    public class Test {
            public static void main(String[] args) throws IOException {
                    PrintWriter pw = new PrintWriter(new FileWriter("test.txt"));
                    pw.write("hi");
    }This code does not close pw, hence no data is written to test.txt. To me,
    this does not make sense, because I believe that JVM surely knows what
    files are opened. Thus it wouldn't be difficult for JVM to close all files
    that are opened but not closed until user application exit.
    But, JVM does not close pw, and result in loss of data. This behavior
    would make sense if I were writing apps w/ C or C++ because those
    languages give much freedom to programmers such that people can do
    whatever they want. Java, on the other hand, has the philosophy of
    easy of use and safety, I believe.
    Does anybody know why JVM does not try to close pw?
    Sincerely,
    Minkoo Seo

    Thank you for the comment!
    The JVM is not an operating system it is a program.
    When the JVM exits, all the files opened by the JVM
    (or any other program) are closed by the real
    operating system. That doesn't include calling
    flush() or close(), which only the JVM can do and
    only if it GCs the object, which it may not do.I think JVM is actually a layer which exists right above the
    operating system and acts like a 'virtual machine.'
    Thus, like I said, I believe that the virtual machine maintains
    file descriptors like all other operating systems do.
    And ejp suggest that JVM is nothing but a program which
    makes sense also.
    So I wonder whether JVM actually maintains file descriptor
    table (or linked list) or not. If it does, JVM is irresponsible
    because it does not take care of destruction of file descriptor
    table. If not, that's okay. I'm just curious.

  • When does the JVM exit and deleteOnExit();?

    I developed a JSP that queries a database, displays the results in a browser, and writes the results to the server as a file. While the user is viewing the JSP, they can click on a download link to save the file that was written to the server. Everything works fine!
    I would like to delete the file that was written to the server (to save space), however, I can't delete the file until the user is finished viewing the JSP. I need some help concerning this method: java.io.File.deleteOnExit() the API states:
    "Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates. Deletion will be attempted only for normal termination of the virtual machine, as defined by the Java Language Specification (12.9)."
    If I use this method, When does the JVM exit? I tested it in my home environment using Tomcat and the file was deleted when I stopped Tomcat. If I run this on a web server, does the JVM ever exit? If so when?
    Thanks
    --Scott

    The JVM stays active so long as the Java based webserver (or the servlet engine if your webserver is connected to one) is up. Only when you shutdown your server will the VM terminate. (Similar to what you observed with tomcat)

  • User exit/BADI for Deleting the Empty Handling unit

    Hi All,
    Can anyone give me the suitable User exit/BADI for the below scenario.
    While creating the TO (Transfer order) for a delivery using the transaction code LT12, the system will automatically generate HU (Handling unit) number. If the materials are not found in the storage bin for the selected HU, we have to delete the Handling Unit from the delivery document.
    Thanks in advance.
    Thanks
    Ramesh.

    Find below couple of  User Exits for Transfer Order.
    MWMTO001 - EXIT_SAPLL03T_001 (Enhancements for end of transfer order generation)
    MWMTO002 - EXIT_SAPLL03T_002 (User Exit at End of TO Confirmation (in Update Task))
    The Exits gives you access to LTAK and LTAP.....
    Hope this is helpful to you.
    Vinodh Balakrishnan

  • Can I set the default locale for jvm

    Hi,
    Can I set the default locale for jvm?
    How to do it?
    Pan

    My windows default locale is chinese .I have thought of your opinion. But in
    windows nt , if I change the locale , all the environment will be
    destroyed(just like reinstall it , it's difficult for me) . So , Is there
    any other approach?
    Dimitri Rakitine <[email protected]> wrote in message
    news:[email protected]...
    Did you try to change the locale in the Windows control panel?
    (Control panel -> Regional Options -> Your locale)
    Pan YangBin <[email protected]> wrote:
    I have tried changing this system property and other properties such
    as -Duser.language=en -Dfile.encoding=Cp1252 , but all these properties
    did
    not changed, you can get this infomation from the log file .Maybe these
    system properties are readonly.
    Thanks very much.
    Pan
    Chris Halstead <[email protected]> wrote in message
    news:[email protected]...
    Try adding -Duser.region=US to the java command line used to start
    WebLogic...
    -chris
    "Pan YangBin" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    The problem exists in my project still exist.That is it.
    When I did not set weblogic.jsp.encoding to GB2312 in my web
    application(web.xml), and when the jsp file contain's chinese , the
    output
    will be error(error chinese) .And when I did not set it , the output
    is
    correct, but when I use request.getParameter("SomeFormElement")(theelement
    inputed chinese), the return value is error(still chinese error).And
    when
    I
    am in windows nt english version and do not set this property, all
    these
    two
    problems dispear. And I try to compare the java files those were
    generated
    by weblogic from the jsp file , there is only two additional clause
    in
    the
    java file. That's it:
    ((weblogic.servlet.jsp.JspWriterImpl)out).setEncoding("GB2312");
    response.setHeader("Content-Type", "text/html; charset=GB2312");
    (the web.xml has <context-param>
    <param-name>weblogic.jsp.encoding</param-name>
    <param-value>GB2312</param-value>
    </context-param> to be set
    So, I think maybe it works well if I change the default locale toenglish.
    And unfortunately, your method is also failed.(I have to use weblogic
    in
    chinese environment)
    Would you please help me to solve this problem?
    Pan
    Dimitri Rakitine <[email protected]> wrote in message
    news:[email protected]...
    Try java ... -Duser.language=en ...
    or mode con cp select=437 in the command prompt before running
    weblogic.
    Pan YangBin <[email protected]> wrote:
    I'm using weblogic server 5.1 sp6 in chinese environment, and I
    want
    weblogic compile my jsp with en_us locale . So I can't use
    Locale.setDefault(new Locale(...)) to set the default locale ,butI
    really
    want someway configure.
    Pan
    Dimitri Rakitine <[email protected]> wrote in message
    news:[email protected]...
    Locale.setDefault(new Locale(...)) ?
    Pan YangBin <[email protected]> wrote:
    Hi,
    Can I set the default locale for jvm?
    How to do it?
    PanDimitri
    Dimitri
    Dimitri

  • Is is possible to call a function or method before JVM exits ??

    Hi All,
    Is is possible to call a function or method before JVM exits where System.exit() is used.
    I am calling a program where System.exit is used. i need to call a function before the JVM exits.
    Please help me.
    Thanks,
    J.Kathir

    How to call the method ? Did i have to call the shudown hooks method in my main class ?
    Is it possible to have in subclass?
    is the below code is correct ? i am calling a class before System.exit is called....
    java.lang.Runtime.getRuntime().addShutdownHook(...My Own Class()....)

Maybe you are looking for