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 » Problem with MbGlobalMapSessionPolicy in erternal Java File

Post new topic  Reply to topic
 Problem with MbGlobalMapSessionPolicy in erternal Java File « View previous topic :: View next topic » 
Author Message
mahesh2069
PostPosted: Fri Jan 10, 2014 6:54 am    Post subject: Problem with MbGlobalMapSessionPolicy in erternal Java File Reply with quote

Centurion

Joined: 26 Jun 2013
Posts: 103

Hi All,

I need to work on MbGlobalMapSessionPolicy in external file to remove cache automatically from Grid.

In Java Compute Node , This MbGlobalMapSessionPolicy class works correct ,coming to java class it throws Throwable error.

Can we use MbGlobalMapSessionPolicy in .java file , like MbGlobalMap?

Help me ....
_________________
Thanks & Regards
Mahesh Mediboyina
WMB Developer
Back to top
View user's profile Send private message
mahesh2069
PostPosted: Fri Jan 10, 2014 7:05 am    Post subject: I got following Exception Reply with quote

Centurion

Joined: 26 Jun 2013
Posts: 103

No class definition found..

Code:

java.lang.NoClassDefFoundError: com.ibm.broker.trace.Trace

_________________
Thanks & Regards
Mahesh Mediboyina
WMB Developer
Back to top
View user's profile Send private message
stoney
PostPosted: Mon Jan 13, 2014 2:56 am    Post subject: Reply with quote

Centurion

Joined: 03 Apr 2013
Posts: 140

It sounds like you are trying to use MbGlobalMap and MbGlobalMapSessionPolicy in an external Java application.
This is not supported and as you have discovered will not work.
Those classes can only be used in Java code deployed to an execution group.
Back to top
View user's profile Send private message
muthu_tek
PostPosted: Thu Apr 17, 2014 11:31 pm    Post subject: Reply with quote

Apprentice

Joined: 21 Jan 2010
Posts: 36
Location: Coimbatore,India

stoney is correct.

You can create static Java wrappers for common global cache tasks, such as getting/inserting a String value from a given Map. You can then call these Java methods from within ESQL and the Mapping node. Making the cache available natively from across the programming interfaces is the long-term goal

Java Code :
Code:

package com.muthu.iib.integration.services;

import com.ibm.broker.plugin.MbException;
import com.ibm.broker.plugin.MbGlobalMap;
import com.ibm.broker.plugin.MbGlobalMapSessionPolicy;
public class InvokeCache {

   
   public static String callCache(String Key,String Value ){
   
      MbGlobalMap authMap;
      try {
         authMap = MbGlobalMap.getGlobalMap("authMap");
         MbGlobalMap.getGlobalMap("authMap",new MbGlobalMapSessionPolicy(10));
String test = (String)authMap.get(Key);
      if (test == null) {

         authMap.put(Key, Value);
         
      } else {

         authMap.update(Key, Value);
      }
} catch (MbException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
}
      return "";
      
   }


   
}


ESQL Code

Code:
SET cacheValue = callCache("100","Marimuthu Udayakumar From India");

CREATE PROCEDURE callCache(IN requestId CHARACTER, IN payLoad CHARACTER)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "com.muthu.iib.integration.services.InvokeCache.callCache";



_________________
Thanks and Yours,

Marimuthu Udayakumar
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem with MbGlobalMapSessionPolicy in erternal Java File
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.