ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportCanada postal code validation issue

Post new topicReply to topic
Canada postal code validation issue View previous topic :: View next topic
Author Message
anilmekala
PostPosted: Thu Mar 19, 2020 9:50 pm Post subject: Canada postal code validation issue Reply with quote

Acolyte

Joined: 19 Oct 2012
Posts: 57

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Mar 20, 2020 4:30 am Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20300
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
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportCanada postal code validation issue
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.