on 2005 Mar 11 12:29 PM
Hello,
during my message mappings i have to lookup some values from r3. Therefore i have created a RFC Funktion on R3 and developed a java archive (using the generated proxy classes created by the SAP Enterpise Connector wizard) to access the RFC. As the classes should be shared across several applications i think they should be placed at a global place (where the classloader of the WebAS can pick them up for all applications).
Now my question is:
Where/how do i place the jar(s)?
I have already tried the following (using Netweaver Developer Studio):
1.) Created a Library Project (including my jar) -> ok.
2.) Deployed on the server using IDE -> ok.
3.) Created a user defined funktion within my message mapping an try to use one of my classes of the deployed library -> ERROR !!!!! -> Cannot resolve symbol MyClass ...
4.) Created a Ear and Web Project to test the availability of my classes in Ear projects -> when i use one of my classes within a jsp it works fine!
Whats going wrong within the message mapping? It seems the classes are available on the server?
Thanks
Peter
Hi Peter,
We use in our project some JAVA custom objects and properties files which reside on the local file system of XI.
All custom jar's and properties files have been placed on the user.dir and/or user.home variables. i.e. (where user is the XI runtime user)
user.dir = /usr/sap/XD1/DVEBMGS00/j2ee/cluster/server
user.home = /home/xd1adm
These system variables are accessible to all Java classes from the runtime.
Hope this information will help you.
Cheers,
Rob.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Hi,
> We are trying to read a XML properties file in
> multi-App server environment.
>
> Can you please tell us as to how to read the
> following at runtime:
>
> user.dir = /usr/sap/XD1/DVEBMGS00/j2ee/cluster/server
>
> user.home = /home/xd1adm
>
> I want to use this in my Java User defined function.
>
> Thanks
> Ashish
Try this:
// get the system property that contains the server path
String sysDir = System.getProperty("com.sap.systemdir");
String userDir = System.getProperty("com.sap.userdir");
Or if you want to check all the available system variables on your system, try this code in one function:
// Get all system properties
Properties props = System.getProperties();
// Enumerate all system properties
Enumeration enum = props.propertyNames();
for (; enum.hasMoreElements(); ) {
// Get property name
String propName = (String)enum.nextElement();
// Get property value
String propValue = (String)props.get(propName);
}
Enjoy Java.
Cheers,
Roberto.
Hi Peter,
the mapping uses its own classloader. You have to create an Imported Archive in the Integration Builder in the software component version you create your mappings. Load up the jar into this Imported Archive.
If you want to use the library in several software component versions you can create one software component version for the Imported Archive and let all other software component versions be based on this one.
Hope this helps
Stephan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
13 | |
10 | |
10 | |
9 | |
9 | |
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.