Question
Toyota System
JP
Last activity: 21 Jun 2022 3:24 EDT
Conflict java class
Hi all,
I trying to use class Transliterator by using ICU library (https://icu.unicode.org/home). Import was successful and class files were saved in my Codeset but I can not use class Transliterator in java function rule. I founded in pega codeset had a little class same name in pricu2jdk.jar but didn't have Transliterator class. Anyone had any solutions about this case.
Thank you,
Lanh
-
Like (0)
Srikanth Kasula -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Toyota System
JP
Similar post was answered before : https://collaborate.pega.com/question/importing-external-jar-implement-pegaserde-interface
ING Bank N.V.
NL
@LANH(ラン) Try adding an Import package in the Imports and Exports tab in the function. In the tab, add the fully qualified package name and save the function again.
Also, you need to restart your PEGA servers after you have installed your new JAR. I hope you have done that.
Updated: 12 Jan 2022 21:00 EST
Toyota System
JP
Thank @VTALUKDAR
You can see in error message run compile with com.pega.ibm.icu but my java code is com.ibm.icu
Thank @VTALUKDAR
You can see in error message run compile with com.pega.ibm.icu but my java code is com.ibm.icu
Error(s) detected while generating java. Compiler reported: ----------
1. ERROR in \com\pegarules\generated\test_complaintsprod_icu4j.java (at line 47)
import com.pega.ibm.icu.text.Transliterator;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import com.pega.ibm.icu.text.Transliterator cannot be resolved
----------
----------
2. ERROR in \com\pegarules\generated\test_Transliterator_010101__3620305168101550020.java (at line 47)
import com.pega.ibm.icu.text.Transliterator;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import com.pega.ibm.icu.text.Transliterator cannot be resolved
----------
3. ERROR in \com\pegarules\generated\test_Transliterator_010101__3620305168101550020.java (at line 89)
com.pega.ibm.icu.text.Transliterator t = com.pega.ibm.icu.text.Transliterator.getInstance("Fullwidth-Halfwidth");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
com.pega.ibm.icu.text.Transliterator cannot be resolved to a type
----------
4. ERROR in \com\pegarules\generated\test_Transliterator_010101__3620305168101550020.java (at line 89)
com.pega.ibm.icu.text.Transliterator t = com.pega.ibm.icu.text.Transliterator.getInstance("Fullwidth-Halfwidth");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
com.pega.ibm.icu.text.Transliterator cannot be resolved to a type
----------
4 problems (4 errors)
Compile failed.
Library—
The Library failed to compile
When compile my code pega compile library com.pega.ibm.icu.text in pricu2jdk.jar not in my imported external jar file so that make error.
Do you have any solution to fix it?
Thanks and regards,
Updated: 19 Jan 2022 16:58 EST
Pegasystems Inc.
JP
@KevinZheng_GCS could you kindly suggest the required steps , to pick the correct jar-file, we have imported jar, put in the /lib, still it is not recognizing it. The problem is that it does not have the required class file which is required for Japanese script translation. This class is required for Japanese half-width to full-width conversion.
Deeply appreciate your valuable inputs.
Best regards,
Tarun Sipani
Pegasystems Inc.
JP
We are still looking for a solution for this. Has anybody run into something similar or has any clues?
Best regards,
Tarun Sipani
Pegasystems Inc.
JP
@LANH(ラン) Can u have a look into https://docs-previous.pega.com/system-administration/84/importing-custom-java-archives-and-classes.
Toyota System
JP
Thank Tarun,
Yeah, I try exactly the steps mentioned above but it not working
Best regards,
Toyota System
JP
I checked java code file when generated and in Library in pega platform
I checked java code file when generated and in Library in pega platform
package com.pegarules.generated;
import com.pega.pegarules.pub.*;
import com.pega.pegarules.pub.clipboard.*;
import com.pega.pegarules.pub.context.*;
import com.pega.pegarules.pub.database.*;
import com.pega.pegarules.pub.dictionary.Dictionary;
import com.pega.pegarules.pub.dictionary.*;
import com.pega.pegarules.pub.infengine.*;
import com.pega.pegarules.pub.pal.*;
import com.pega.pegarules.pub.runtime.*;
import com.pega.pegarules.pub.util.*;
import com.pega.pegarules.priv.*;
import Pega.*;
// to explicitly override v2 Pega.*
import com.pega.pegarules.pub.runtime.ParameterPage;
import com.pega.pegarules.pub.util.Base64Util;
// to explicitly override v3 implicit imports
import Pega.Activity;
import com.pega.pegarules.priv.PegaAPI;
import com.pega.pegarules.pub.runtime.LibraryFunctionNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Iterator;
import java.util.Map;
import com.pega.pegarules.priv.generator.LibraryMetadata;
import com.pega.pegarules.priv.generator.LibrarySupport;
// library specific imports follow
import com.pega.ibm.icu.text.Transliterator;
Why in java file the last line code is com.pega.ibm.icu.text.Transliterator not is com.ibm.icu.text.Transliterator. Any one can explain me that and if can please help me to fix it?
Thanks and regards,
Lanh
Accepted Solution
Toyota System
JP
Similar post was answered before : https://collaborate.pega.com/question/importing-external-jar-implement-pegaserde-interface
-
Guangri Liang
Pegasystems Inc.
JP
May I ask how you resolved this issue?
Toyota System
JP
Sorry, this issue can not resolved, I had to code by myself without using ICU library
Pegasystems Inc.
JP
Thank you for reply, You mean write a java code by using ICU library and packaged it as jar, and import that custom jar into Pega, correct?
Toyota System
JP
No, I just write a java code to convert in pega function and not include ICU library. May be your solution can resolved this issue. Thank you
-
Guangri Liang