on 10-14-2009 12:56 PM
Hi All,
I have a WDJ app, where i have called a java method to execute a system commant "cmd /c nbtstat -a ipadd" . It takes 10 mins to get deployed on the server.PLease advice how the response time can be reduced.
Regards
Ishita
Hi,
While deploying you code , server dont run the code what you wrote inside you program, what it will do is it just builds your code and checks for any build time errors. So when you say deploying is taking time means
there might be 2 causes.
1. May be you have a very huge amount of UI or java code is there to build you application and deploy.
2. If you are deploying through SDM, please ask you basis guy to remove the unwanted .ear temp files in the server.
This delay in deployment happened with me also. In my case my webdynpro project had 10 applications with around 40 views. So it used to take 3 to 10 mins.
Regards,
SrinivaS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Some point form my side
1.You have called that method at wdDoinit() of Component Controller .please avoid this by create a method at CC and call it at point where actually it require (Reason is let our presentation come first then only Business logic and its control , most of the cases which I found is initialize the UI logic at CC is OK and I prefer this unless & until it require).
2. If java code is big enough then create one java class at directory and use the method .
Hope it help you to resolve the issue.
Best Regards
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Plz put the code specific ot that java method.
BR
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
This is the code from where i call the java code from the controller wdDoinit()
IWDRequest req = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
machinename = req.getClientHostAddress();
// wdContext.currentContextElement().setMachname(machinename);
IWDClientUser clientUser = WDClientUser.getLoggedInClientUser();
String username="" ;
username = GetInfo.userinfo(machinename); // Java method called to execute the command
mgr.reportSuccess("Hostname :"+ username);
mgr.reportSuccess("IP :"+ machinename);
This the Java code
package user_pwd_comp;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.InetAddress;
import com.sap.tc.webdynpro.services.sal.adapter.api.IWDRequest;
import com.sap.tc.webdynpro.services.sal.adapter.api.WDProtocolAdapter;
/*
Created on Oct 14, 2009
*
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
*/
/**
@author Ishita.Shah
*
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
*/
public class GetInfo {
public static void main (String args[]) throws Exception{
String ip = GetInfo.userinfo("192.168.100.229");
System.out.println(ip);
}
public static String userinfo(String ipadd) throws Exception {
InetAddress local = InetAddress.getLocalHost();
String ip = ""+local;
System.out.println(ip);
System.out.println(ipadd);
Runtime rt = Runtime.getRuntime();
ipadd = "cmd /c nbtstat -a " + ipadd;
Process pr = rt.exec(ipadd);
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line=null;
String result = null;
int i = 0;
while((line=input.readLine()) != null) {
if(i==14)
{
result = line.substring(0,15);
pr.destroy();
}
i++;
}
//int exitVal = pr.waitFor();
//System.out.println("Exited with error code "+exitVal);
return result;
}
}
Regards
Ishita
Edited by: Ishita Shah on Oct 15, 2009 6:09 AM
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.