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 SupportGLOBAL CACHE ISSUE

Post new topicReply to topic
GLOBAL CACHE ISSUE View previous topic :: View next topic
Author Message
anilmekala
PostPosted: Mon Feb 08, 2021 5:53 am Post subject: GLOBAL CACHE ISSUE Reply with quote

Acolyte

Joined: 19 Oct 2012
Posts: 59

Hi ,

I am trying to implement global cache with help of java integration API in IIB v10. I developed simple java class to put data into cache as below
[
package Utility;

import com.ibm.broker.plugin.MbException;
import com.ibm.broker.plugin.MbGlobalMap;


public class GlobalCache
{
public static String mapName = "Hello";

public static void main(String arg[]) throws MbException{
String payload = "Hello World";
GlobalCache.loadCache("GBKEY",payload.getBytes());
System.out.println("Hello");
}

public static void loadCache(String key, byte [] payload) throws MbException{

MbGlobalMap map = MbGlobalMap.getGlobalMap(mapName);
map.put(key, payload);
System.out.println("Cache loaded");
}
}
]

I have updated my build path with required jar files

javacompute.jar,jplugin2.jar and IntegrationAPI.jar

But I am getting below exception .

Exception in thread "main" java.lang.NoClassDefFoundError: com.ibm.broker.classloading.CacheSupportClassLoader
at Utility.GlobalCache.loadCache(GlobalCache.java:19)
at Utility.GlobalCache.main(GlobalCache.java:13)
Caused by: java.lang.ClassNotFoundException: com.ibm.broker.classloading.CacheSupportClassLoader
at java.net.URLClassLoader.findClass(URLClassLoader.java:610)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:944)
at java.lang.ClassLoader.loadClass(ClassLoader.java:889)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:872)
... 2 more

I could not locate the CacheSupportClassLoader in the above jar files. Please help me any other jars i have to update in build path.

Regards,

Anil

[/code]
Back to top
View user's profile Send private message
timber
PostPosted: Mon Feb 08, 2021 7:51 am Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1162

It looks as if you are trying to load values into a map using a standalone Java program (and not from an IIB message flow). Is that correct?
Back to top
View user's profile Send private message
anilmekala
PostPosted: Mon Feb 08, 2021 8:37 am Post subject: Reply with quote

Acolyte

Joined: 19 Oct 2012
Posts: 59

Hi,

Yes. I want to check the java code before integrating into with IIB flow.


Regards,

Anil.
Back to top
View user's profile Send private message
abhi_thri
PostPosted: Mon Feb 08, 2021 9:24 am Post subject: Reply with quote

Chevalier

Joined: 17 Jul 2017
Posts: 418
Location: UK

hi...crosscheck your system/project classpath to see whether it includes
Quote:
<Installation folder>\IBM\IIB\10.0.0.X\server\classes


The class com.ibm.broker.classloading.CacheSupportClassLoader is available at bipbroker.jar
Back to top
View user's profile Send private message
timber
PostPosted: Tue Feb 09, 2021 5:00 am Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1162

Quote:
I want to check the java code before integrating into with IIB flow.
I think you are approaching this in the wrong way. I recommend that you create a shared library for your Java code, and let IIB handle all of the classloading problems for you.
You don't really need to 'check the java code' because the wrapper class for interacting with global cache is very, very simple.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportGLOBAL CACHE 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.