Click to See Complete Forum and Search --> : Error loading c:\\prog. files....\jvm.dll
dnyan123
October 16th, 2008, 10:44 PM
I have a swing based desktop application that continuously loops through a program in order to wait for a serial input.
The error message goes like this--
The are multiple windows saying:-
header - Java Virtual Machine Launcher
Message - Error loading C:\Program Files\Java\j2re1.4.2_07\bin\client\jvm.dll
Also, the program has been deployed as a JAR file and run from the desktop, and this problem has been faced by the users. I was not able to replicate it since its something that is quite randomly occuring on the user PCs.
can someone please help???
thanks
keang
October 17th, 2008, 06:59 AM
By multiple windows do you mean multiple console windows?
I've no idea how relevant this is but I found this link (http://dll-repair-now.com/advice/Jvm.dll.html?t202id=8147&t202kw=jvm.dll&gclid=CJnY4-aMrpYCFQkrlAod7T3IGA) which suggests it may be a Windows registry error.
dnyan123
October 19th, 2008, 10:15 PM
no they are the windows error message windows...and if its a windows registry error, will the program run in the first place..i say this because the application runs for quite some time and then over the weekend, these windows appear and the use needs to close and restart the application.
Norm
October 19th, 2008, 10:31 PM
What is the application doing? If it starts ok and runs for hours, what does it do or what does the OS do that could cause your problem.
dnyan123
October 20th, 2008, 03:20 AM
the code is as under, and its called every 30 seconds to check if one particular application is running or not and to start it if not... :-
String line;
String query="c:\\WINNT\\system32\\tasklist.exe /FO CSV /v /nh";
Process p = Runtime.getRuntime().exec(query);
BufferedReader input = new BufferedReader
(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
if (!line.trim().equals("")) {
String appname=line.substring(0,line.indexOf(","));
appname=appname.replaceAll("\"","");
String processid=line.substring(line.indexOf(",")+1,line.indexOf(",",line.indexOf(",")+1));
processid=processid.replaceAll("\"","");
String processname= line.substring(line.lastIndexOf(",")+1,line.length());
String user=line.substring(line.indexOf("\\")+1,line.indexOf(",",line.indexOf("\\")+1));
user=user.replaceAll("\"","");
processname=processname.replaceAll("\"","");
if((processname.length()>=3 && processname.substring(0,3).equals("N/A")) && appname.equals("javaw.exe") && user.equals(System.getProperty("user.name"))){
running=true;
break;
}
}
}
p.destroy();
input.close();
} catch (Exception err) {
logger.error("****r",err);
}
if(running==false){
String startApp="javaw -jar "+"\""+System.getProperty("user.dir")+"\\****\\ClockingClientUpdate.jar"+"\"";
try {
String directory=System.getProperty("user.dir")+"\\****";
Runtime.getRuntime().exec(startApp,null,new File(directory));
} catch (IOException ex) {
logger.error("*****",ex);
}
}
the error trace for this method is:-
java.io.IOException: Bad file descriptor
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
i think i know what is happening. due to the errors taking place as per the trace shown, the second part of the program(for starting the app) is executed. Thus, every 30 seconds, a new javaw app is started and hence in a few hours, there are so many of them that the jvm.dll can load no more.
However,
I fail to understand why the Bad file descriptor problem is occuring. I believe this is the last thing that needs to be done. Thanks.
ProgramThis
October 20th, 2008, 12:07 PM
I believe your problem is here:
String startApp="javaw -jar "+"\""+System.getProperty("user.dir")+"\\****\\ClockingClientUpdate.jar"+"\"";
try {
String directory=System.getProperty("user.dir")+"\\****";
Runtime.getRuntime().exec(startApp,null,new File(directory));
I don't think you can have "\\****" as a directory, hence the 'bad file descriptor' error.
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.