on 12-08-2006 4:40 AM
Hi All,
Is there any way to find the sdm path dynamically using java program,
I need to copy files in to the SDM\program directory,how can i findout the sdm root directory path(complete path) using java program.
give me any related links
Thanks in Advance
Regards Srinivas
Hi,
I'm not sure why would you want to do that but please look at this code which will get you the path.
//Assuming the java class runs on the J2EE (WAS) server
Properties props = System.getProperties();
String j2p = props.getProperty("j2ee.path");
//j2ee.path property is a VM arguament which returns the value for ex: /usr/sap/<SID>/JC<nn>/j2ee
File f = new File(j2p);
String parent = f.getParent(); // value is /usr/sap/<SID>/JC<nn>
String sdm = parent + "/SDM/program";
File sdm = new File(sdm);
Lemme know if it helps.
Thanks,
Rajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rajit,
Thanks for u r reply,
when ever i run u r program , i got null pointer exception.(java class runs on the WAS server)
String j2p=props.getProperty("j2ee.path");
when i print j2p , it shows "null"
i think that "j2ee.path" property is invalid,
How to see the VM arguments in the WAS
Thanks&Reply
Srinivas
Hi,
You can use any VM parameter which gives you some kind of path that resolves atleast till /<SID>/<JCnn>. Its strange j2ee.path parameter returns null.
Goto http://<your-WAS-server:port/ and click System Information. (You need admin previliges).
Good luck,
Cheers,
Rajit
Hi Rajit,
Properties props=System.getProperties();
String path=props.getProperty("com.sap.jvmdir");
I have written a sessionbean -->businessmethod , in that method i written the above code and deploy it in to the server(was).then i will get the F:\usr\sap\J2E\JC00\j2ee\cluster\server0 path successfully.(path contains F:\usr\sap\J2E\JC00\j2ee\cluster\server0 )
But i want to find out the sdm home path using java program (without deploying in to server)
I have written a java program with the above code and save it in to the system(which having WAS) when i run the program i got "null".
Is it possible to get the sdm home path with java program(with out deployment).
can u tell me the procedure
Regards
Srinivas
Hi Srinivas
When we are runnig a setup file it will check the all service are existed or not
to deploy the ear in to the server.In this process we need the sdm path dynamically.
Presently we are hardcoding the server path and we are installing the .sda and .ear files.
But if the target system is having another server path the intallation will fail.
thanks and regards
Satyam
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.