Need help to communicate with EJB's in websphere

Discussions

General J2EE: Need help to communicate with EJB's in websphere

  1. Hi all, I am facing problem with JRE versions of websphere and SUN JRE. Let me explain my problem. We have an application working fine in websphere, Now my organization wants to migrate this app to websphere. This application downloads some set of jar files to the client side when the user hits the server with some url. These jar files starts th swing based application in the client side , at the same it will try to communicate with EJB's deployed in the server(Now websphere) to get the data for menus and trees in the swing application. Because of different JRE in the websphere commucation problems like class cast exception are happening. Now we are downloading the the Websphere JRE to the client side and trying to start the application with the downloaded JRE(Even it is not required in case of weblogic in the exiting application also they are downloading the sun JRE). Here the problem starts for me. The execute method of Process class is not able to detect the main class. The waitFor method is returning non zero value. Here is my method. Can anybody guess what's wrong going on with this code public Process spawnProcess(String szSpawnCommand) throws Exception { szSpawnCommand = "C:\\ccc\\JRE\\bin
    javaw.exe com.att.suite.client.SuiteAppManager"; System.out.println("starting processs "+szSpawnCommand); Process oProcess = null; try { // oProcess = Runtime.getRuntime().exec(szSpawnCommand); Runtime rt = Runtime.getRuntime(); System.out.println("Got runtime....."); oProcess = rt.exec("c:/ccc/JRE/bin/java com.att.suite.client.SuiteAppManager"); //oProcess.waitFor(); //oProcess = rt.exec("c:/ccc/JRE/bin/javaw -version"); } catch (Exception ex) { // Throw an exception with the reason why the process // couldn't be spawned // // The original message here confused end users - almost always // occurs due to lack of memory and we cannot determine actual // reason OS failed to spawn a process. // // Changed to correct LCR MR#: 437 // throw new Exception("Unable to spawn process with command: \"" + // szSpawnCommand + "\".\nSystem Reason: " + ex.getMessage()); // /*throw new Exception("You have insufficient memory to " + "launch this program. \nPlease quit some other " + "applications and try again.");*/ System.out.println("In oProcess.... "); ex.printStackTrace(); } // Wait for a second to give the new process a chance // to run properly try { Thread.sleep(1000); } catch (Exception ex) { } final DataInputStream oProcStdOutStream = new DataInputStream( oProcess.getInputStream()); final DataInputStream oProcStdErrStream = new DataInputStream( oProcess.getErrorStream()); Thread oProcStdOutStreamThread = new Thread() { public void run() { try { String szLine = null; while ((szLine = oProcStdOutStream.readLine()) != null) { System.out.println("[FromProc1] " + szLine); } } catch (Exception ex) { System.out.println("In oProcStdOutStream"); ex.printStackTrace(); } } }; oProcStdOutStreamThread.start(); Thread oProcStdErrStreamThread = new Thread() { public void run() { try { String szLine; while ((szLine = oProcStdErrStream.readLine()) != null) { System.out.println("[FromProc2] " + szLine); } } catch (Exception ex) { ex.printStackTrace(); } } }; oProcStdErrStreamThread.start(); // See if the process is still running properly int nProcessExitValue = 0; try { nProcessExitValue = oProcess.exitValue(); // nProcessExitValue = oProcess.waitFor(); System.out.println("nProcessExitValue : "+nProcessExitValue); } catch (Exception ex) { // This means that the process is still running which // we'll consider a good sign. nProcessExitValue = 0; System.out.println("In nProcessExitValue"); ex.printStackTrace(); } // Check the process exit value if (nProcessExitValue != 0) { // Throw an exception with the return value of the spawned // process. // The original message here confused end users - almost always // occurs due to lack of memory and we cannot determine actual // reason OS failed to spawn a process. // // Changed to correct LCR MR#: 437 // throw new Exception("Unable to spawn process with command: \"" + // szSpawnCommand + "\".\nProcess Exit Value: " + // nProcessExitValue); throw new Exception("You have insufficient memory to " + "launch this program. \nPlease quit some other " + "applications and try again."); //System.out.println("In nProcessExitValue!=0"); } Here is the error : starting processs C:\ccc\JRE\bin\javaw.exe com.att.suite.client.SuiteAppManager Class loaded... Got runtime..... nProcessExitValue : 1 [FromProc2] The java class is not found: com/att/launch/jre/Sample java.lang.Exception: You have insufficient memory to launch this program. Please quit some other applications and try again. at com.att.launch.jre.LaunchApp.spawnProcess(LaunchApp.java:525) at com.att.launch.jre.LaunchApp.spawnCJAS(LaunchApp.java:366) at com.att.launch.jre.LaunchApp.main(LaunchApp.java:171) Please help me, I am struggling with this problem from the long time. Or can any body suggest different way to solve this problem instead of downloading the JRE to the client side. Bhaskar
  2. Maybe its your error: java.lang.Exception: You have insufficient memory to launch this program. I don't known your system, but if you are using a swing client, why not to use a applet to start it? If your clients are inside the company, them your administrator can change all machines to use a standard JRE. Mainly its not a problem, if you are using a default implementation of swing, i mean, not a specific swing component from IBM.
  3. Maybe its your error: java.lang.Exception: You have insufficient memory to launch this program. I don't known your system, but if you are using a swing client, why not to use a applet to start it? If your clients are inside the company, them your administrator can change all machines to use a standard JRE. Mainly its not a problem, if you are using a default implementation of swing, i mean, not a specific swing component from IBM.