|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
lang.NoClassDefFoundError:org/apache/commons/codec/binary/ |
« View previous topic :: View next topic » |
Author |
Message
|
vickas |
Posted: Thu Oct 24, 2013 2:10 am Post subject: lang.NoClassDefFoundError:org/apache/commons/codec/binary/ |
|
|
Centurion
Joined: 18 Aug 2013 Posts: 126
|
Am calling a java method from ESQl , am able to call the method but it gives the following exception after processing some statements
My Error :
:Java Exception calling CallStaticVoidMethodA.
:java.lang.NoClassDefFoundError:org/apache/commons/codec/binary/Base64.
My ESQl code :
DECLARE pkey CHARACTER 'xyxzh'
DECLARE inputmsg CHARACTER 'inputmsg'
CALL encrypt(inputmsg,pkey);
CREATE PROCEDURE encrypt(INOUT plainText CHARACTER,IN pkey CHARACTER )
LANGUAGE JAVA
EXTERNAL NAME "acces.AES.encrypt";
My java code :
pckge acces
class AES
public static void encrypt(String[] plainText, String key)
{
byte[] plainTextbytes;
try {
plainTextbytes = plainText[0].getBytes(characterEncoding);
byte[] keyBytes = getKeyBytes(key);
plainText[0] =Base64.encodeBase64String(encrypt(plainTextbytes,keyBytes, keyBytes));
}
}
public static byte[] encrypt(byte[] plainText, byte[] key, byte[]initialVector) {
Cipher cipher = Cipher.getInstance(cipherTransformation);
SecretKeySpec secretKeySpec = new SecretKeySpec(key,aesEncryptionAlgorithm);
IvParameterSpec ivParameterSpec = new IvParameterSpec(initialVector);
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
plainText = cipher.doFinal(plainText);
return plainText;
}
I get an error noclassdeffounderror when it is returning the plainText...
I have included the common-codecs jar in my library, pasted in MQSI/jre17/lib and also in classpath..
what is the reason for this error ? how do i resolve it ? |
|
Back to top |
|
 |
dogorsy |
Posted: Thu Oct 24, 2013 2:41 am Post subject: Re: lang.NoClassDefFoundError:org/apache/commons/codec/binar |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
vickas wrote: |
Am calling a java method from ESQl , am able to call the method but it gives the following exception after processing some statements
My Error :
:Java Exception calling CallStaticVoidMethodA.
:java.lang.NoClassDefFoundError:org/apache/commons/codec/binary/Base64.
My ESQl code :
DECLARE pkey CHARACTER 'xyxzh'
DECLARE inputmsg CHARACTER 'inputmsg'
CALL encrypt(inputmsg,pkey);
CREATE PROCEDURE encrypt(INOUT plainText CHARACTER,IN pkey CHARACTER )
LANGUAGE JAVA
EXTERNAL NAME "acces.AES.encrypt";
My java code :
pckge acces
class AES
public static void encrypt(String[] plainText, String key)
{
byte[] plainTextbytes;
try {
plainTextbytes = plainText[0].getBytes(characterEncoding);
byte[] keyBytes = getKeyBytes(key);
plainText[0] =Base64.encodeBase64String(encrypt(plainTextbytes,keyBytes, keyBytes));
}
}
public static byte[] encrypt(byte[] plainText, byte[] key, byte[]initialVector) {
Cipher cipher = Cipher.getInstance(cipherTransformation);
SecretKeySpec secretKeySpec = new SecretKeySpec(key,aesEncryptionAlgorithm);
IvParameterSpec ivParameterSpec = new IvParameterSpec(initialVector);
cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
plainText = cipher.doFinal(plainText);
return plainText;
}
I get an error noclassdeffounderror when it is returning the plainText...
I have included the common-codecs jar in my library, pasted in MQSI/jre17/lib and also in classpath..
what is the reason for this error ? how do i resolve it ? |
You can resolve it by reading the documentation. It is clearly explained what you need to do when have overloaded methods. |
|
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
|
|
|
|