|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Canada postal code validation issue |
« View previous topic :: View next topic » |
Author |
Message
|
anilmekala |
Posted: Thu Mar 19, 2020 9:50 pm Post subject: Canada postal code validation issue |
|
|
Acolyte
Joined: 19 Oct 2012 Posts: 63
|
Hi Team,
I am trying to validate canada postal code by using java regular expression and esql. I have written code as below and getting exception while deploy.
[
ESQL CODE :
DECLARE validate BOOLEAN FALSE;
SET validate = isPostalCodeValid(reftoPcode);
CREATE PROCEDURE isPostalCodeValid(IN postalCode CHARACTER)
RETURNS BOOLEAN
LANGUAGE JAVA
EXTERNAL NAME "com.arbis.util.CommonUtil.postalCodeValidation";
JAVA CODE :
public class CommonUtil {
public static boolean postalCodeValidation(String inPostalCode){
boolean b;
String regex = "^(?!.*[DFIOQU])[A-VXY][0-9][A-Z] ?[0-9][A-Z][0-9]$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(inPostalCode);
b= matcher.matches();
return b;
}
}
EXCEPTION :
BIP2087E: Integration node 'TESTNODE_Anil' was unable to process the internal configuration message.
The entire internal configuration message failed to be processed successfully.
Use the messages following this message to determine the reasons for the failure. If the problem cannot be resolved after reviewing these messages, contact your IBM Support center. Enabling service trace may help determine the cause of the failure.
BIP4041E: Integration server 'default' received an administration request that encountered an exception.
While attempting to process an administration request, an exception was encountered. No updates have been made to the configuration of the integration server.
Review related error messages to determine why the administration request failed.
BIP3202E: (.sample_postal_code_mf_Compute.isPostalCodeValid, 1.2) : An error occurred when trying to resolve the Java class or method 'com.arbis.util.CommonUtil.postalCodeValidation' which is referred to by the routine 'isPostalCodeValid'.
Further messages are generated that explain the error in more detail.
Correct the syntax of your Java expression in node '.sample_postal_code_mf_Compute.isPostalCodeValid', around line and column '1.2', then redeploy the message flow.
BIP2928E: The Java method 'com.arbis.util.CommonUtil.postalCodeValidation' was found but its return type does not match the ESQL return type
The Java method 'com.arbis.util.CommonUtil.postalCodeValidation' has a return type that does not match its ESQL return type. Correct the ESQL return type or change the Java return type
Examine and correct the SQL program.
]
Please help to resolve the same.
Regards,
Anil.[/code] |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Mar 20, 2020 4:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Code: |
BIP2928E: The Java method 'com.arbis.util.CommonUtil.postalCodeValidation' was found but its return type does not match the ESQL return type
The Java method 'com.arbis.util.CommonUtil.postalCodeValidation' has a return type that does not match its ESQL return type. Correct the ESQL return type or change the Java return type |
I believe the error message is pretty clear here. Change the Java return type.
Maybe to boolean[] ?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|