on 07-10-2012 9:32 AM
Hi Exparts,
In one java mapping I have use a external jar common-lang-2.3.jar. And the corresponding method which I have used in the java map is StringEscapeUtils.escapeXml(“the string”);
It is for handling spatial characters (“,’,&,<,>) in xml data, like if <a> you & I </a> comes it will transfer to <a> you & I </a>
After creating the imported archive when I ran it in ESR locally in test tab it is running fine but when ever I run it end to end or triggering it from RWB it is giving error in MONI as "Linkage error while loading class - java.lang.NoClassDefFoundError: org/apache/commons/lang/StringEscapeUtils".
What can be the reason for it ?
Thanks,
Aniruddha
Hi,
A few cents,
In addition to Anupam you should recompile all the classes that you have developed for the java mapping
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anupam,
How can I import the classes inside external jar file common-lang-2.3.jar separately? The external jar I have added in Library with option add external jar. Then export the whole project in final jar with steps export->jar file->checked class and source file & resources.
In your above solution I have tried 1.5 also.. but no result.
Thanks,
Aniruddha
Hi Aniruddha,
try this approach to include commom-lag-2.3.jar file in PI
1. You must be adding this as external jar file.
2. Instead of step 1 try importing the jar file inside your project as archive. Right click on project name-> import ---->archive.
3. Once this is imported then recompile the project once again. (have both versions one with java 1.5 and another with java 1.6).
4. While exporting to final jar file include all classes of your project along with source file.
5. Now import the jar file within PI.
Here you are, error must vanish.
Regards
Anupam
Hi Ani,
Please check the JVM Version.
i think PI installed JVM and Java Code Compiled JVM are not same.
Generally we can get this error when we imported the Lower Version JVM complied class.
Regards,
Venkat.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aniruddha,
what is the version of PI you are working with?
What is the version of j2sdk in your local system?
Linkage error is there if the java version of your local system does not match the expectation of PI server. For PI 7.0 you need to compile your code in j2sdk1.4.2_15 . For PI 7.1 and above you need j2sdk 1.5.0. Finally if you want to replace special characters without external jar files you can also do it this way
String s; //holds all special charaters in xml
s=s.replaceAll("&","&");
s=s.replaceAll("<","<");
s=s.replaceAll(">", ">");
s=s.replaceAll("'", "'");
s=s.replaceAll("\"", """);
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.