Start a Conversation

Unsolved

This post is more than 5 years old

1250

March 19th, 2010 06:00

solving windows console issues: emc114433 & emc70018

This has been an issue I raised 6 years ago caused by the following java bug:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4787931

If your console pops up asking what host to connect to and then silently goes away you may be getting hit by this bug.  There are several workarounds but for the developers benefit as much as anything here's how I fix it each time we get a new version of the console.  I have successfully used this to patch our consoles since the 5.1.2 days and it continues to work fine in 6.1 UB7.  I am going to be a little loose on some of the steps intentionally, if you can't fill in the pieces it might not be a great idea for you to attempt this fix.

- retrieve the exec.jar file from the console installation

- unjar it to a working location

- decompile the IniMgr.class file

- edit the IniMgr java code and look for the line that sets homeDirName:

     homeDirName = System.getProperty("user.home");

- after this line add the following code:

       String OS = System.getProperty("os.name").toLowerCase();
       if (OS.indexOf("windows") > -1) {
               try {
                       Process p = Runtime.getRuntime().exec("cmd.exe /c echo %USERPROFILE%") ;
                       InputStream inStr = p.getInputStream();
                       BufferedReader inBr = new BufferedReader(new InputStreamReader(inStr));
                       String line;
                       while((line = inBr.readLine()) != null) {
                               homeDirName = line;
                       } try {
                               p.waitFor();
                       } catch(InterruptedException ex) {}
                       inBr.close();
                       p.destroy();
               } catch(IOException e) {
                       ErrorMessage = "error running batch command";
                       return false;
               }
       }

- all this code does is basically say if you're on a windows box retrieve userhome by echo'ing USERPROFILE, which has always been a safe and recommended alternative to using the broken System.getProperty call.

- compile your modified java code to replace IniMgr.class

- jar up the whole tree you pulled to have a replacement exec.jar with the new IniMgr.class included

- save a copy of your original exec.jar (as a simple backout but you could always de-install and reinstall the console)

- put your patched exec.jar in place

That's it.  If you want you can get fancy and build an installer but once you have a replacement exec.jar it's pretty easy to just copy that file to the proper location.

NOTE: I have been sitting on these changes for years but since this known issue has never been properly solved (and I don't mean by recommending people start editing batch files, it should work straight out of the box) I decided to throw this out there.  Developers: feel free to fix this situation with the above code or code of your choosing but please fix it properly, thanks.

59 Posts

August 26th, 2010 13:00

FYI: same bug exist and fix works in 6.1 UB8.  I really wish someone would pass this little code chunk on to the developers so they could get this fixed, people don't really like installing my patch after the install the normal console patch, it makes some folks uneasy.

59 Posts

July 6th, 2011 09:00

Still exists in EB9, still patchable the same way.  This is really a hassle, I patch my own console but every time we upgrade or someone needs to install a console they need to manually patch it after I create the patch and not everyone is 100% comfortable with loading unofficial code.

No Events found!

Top