|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
![Reply to topic](templates/DAJ_Glass/images/lang_english/reply.gif) |
|
GLOBAL CACHE ISSUE |
« View previous topic :: View next topic » |
Author |
Message
|
anilmekala |
Posted: Mon Feb 08, 2021 5:53 am Post subject: GLOBAL CACHE ISSUE |
|
|
Acolyte
Joined: 19 Oct 2012 Posts: 63
|
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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
timber |
Posted: Mon Feb 08, 2021 7:51 am Post subject: |
|
|
![](images/avatars/53508560955fb354bd4bd0.jpg) Grand Master
Joined: 25 Aug 2015 Posts: 1282
|
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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
anilmekala |
Posted: Mon Feb 08, 2021 8:37 am Post subject: |
|
|
Acolyte
Joined: 19 Oct 2012 Posts: 63
|
Hi,
Yes. I want to check the java code before integrating into with IIB flow.
Regards,
Anil. |
|
Back to top |
|
![](templates/DAJ_Glass/images/spacer.gif) |
abhi_thri |
Posted: Mon Feb 08, 2021 9:24 am Post subject: |
|
|
![](images/avatars/3159673415d820d89ea89a.jpg) Knight
Joined: 17 Jul 2017 Posts: 516 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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
timber |
Posted: Tue Feb 09, 2021 5:00 am Post subject: |
|
|
![](images/avatars/53508560955fb354bd4bd0.jpg) Grand Master
Joined: 25 Aug 2015 Posts: 1282
|
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 |
|
![](templates/DAJ_Glass/images/spacer.gif) |
|
|
![Reply to topic](templates/DAJ_Glass/images/lang_english/reply.gif) |
|
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
|
|
|
|