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 Index » WebSphere Message Broker (ACE) Support » lang.NoClassDefFoundError:org/apache/commons/codec/binary/

Post new topic  Reply to topic
 lang.NoClassDefFoundError:org/apache/commons/codec/binary/ « View previous topic :: View next topic » 
Author Message
vickas
PostPosted: Thu Oct 24, 2013 2:10 am    Post subject: lang.NoClassDefFoundError:org/apache/commons/codec/binary/ Reply with quote

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
View user's profile Send private message
dogorsy
PostPosted: Thu Oct 24, 2013 2:41 am    Post subject: Re: lang.NoClassDefFoundError:org/apache/commons/codec/binar Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » lang.NoClassDefFoundError:org/apache/commons/codec/binary/
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.