Message Mapping - java.util.Map

Hi There
I would like to know if there is any way, using java.util.Map map; to get the "data type" field name in a UDF? Passing a constant with the field name would not be practical.. I'm looking for a object oriented process to use in all my mappings.
Also where could I look for the methods I can use in the map trace object?
Regards,
Jan

But I'm still missing the field name..
Let say I have a message mapping going from Field ACB to Field QAZ and a UDF called CheckLen.
In my UDF I'm looking at the incoming field and if it's length is correct. if not I'm writing an entry into a table stating there was an incorrect field but what I can't get is the the field name so I can write to the table "Invalid length on field ACB" The only way to get this field name value is by passing a constant of "ACB" to the UDF and using that. But we have hundreds of MMs so implementing this would be much more difficult than a OOP way..

Similar Messages

  • Unable to capture messages from java.util.logging

    I have a class called (Caller.java) which invokes a method called foo from another java class(Util.java) using reflection API.Now this method foo logs messages using Java's logger.My requirement is to call foo for 3 times from Caller and capture/redirect the log messages into 3 log files.
    But only the first log file is capturing the log messages(from logger) and other two are not ?
    Plz suggest if I am doing somethin wrong here ?
    Caller.java
    package project2;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.PrintStream;
    import java.lang.reflect.Method;
    public class Caller {
        public Caller() {
        public static void main(String[] args) throws Exception {
            Caller caller = new Caller();
            for (int i = 0 ;i<3 ;i++ )  {
                caller.createLogStream(i);
                System.setOut(caller.getPs());
                System.setErr(caller.getPs());
                /*****************Invoking Util.java*****************************/
                Class clas = Class.forName("project2.Util");
                Method m = clas.getMethod("foo",null);
                Object obj =clas.newInstance();
                m.invoke(obj,null);
        public void createLogStream(int i) throws FileNotFoundException {
            ps = new PrintStream(new File(System.getenv("HOME")+File.separator+"MyLog"+i+".log"));
        public void closeLogStream(){
            ps.close();
            ps = null;
        private PrintStream ps = null;
        public PrintStream getPs() {
            return ps;
    } Util.java
    package project2;
    import java.util.logging.Logger;
    public class Util {
        Logger logger = null;
        public Util() {
            logger = Logger.getLogger(this.getClass().getName());
        public void foo(){
            System.out.println("Hello out stream");
            System.err.println("Hello error stream");
            logger.info("This is an information");
            logger.warning("This is a warning message");
            logger.severe("This is fatal!! ");
    }First Log file MyLog0.log:
    Hello out stream
    Hello error stream
    Feb 16, 2009 7:55:55 PM project2.Util foo
    INFO: This is an information
    Feb 16, 2009 7:55:55 PM project2.Util foo
    WARNING: This is a warning message
    Feb 16, 2009 7:55:55 PM project2.Util foo
    SEVERE: This is fatal!!
    Feb 16, 2009 7:55:55 PM project2.Util foo
    INFO: This is an information
    Feb 16, 2009 7:55:55 PM project2.Util foo
    WARNING: This is a warning message
    Feb 16, 2009 7:55:55 PM project2.Util foo
    SEVERE: This is fatal!!
    Feb 16, 2009 7:55:55 PM project2.Util foo
    INFO: This is an information
    Feb 16, 2009 7:55:55 PM project2.Util foo
    WARNING: This is a warning message
    Feb 16, 2009 7:55:55 PM project2.Util foo
    SEVERE: This is fatal!! Other 2 log files have only this much
    Hello out stream
    Hello error stream

    A stale Connection Factory or Connection Handle may be used in SOA 11g
    Regards,
    Anuj

  • Formatting Log message for Java.Util.Logger

    Hi,
    I want to format out put that i get when i logg the message
    example
    Sep 23, 2009 5:32:56 PM com.log.utils.helper info
    INFO: in Logging messagingI was wondering if I could get output like
    Sep 23, 2009 5:32:56 PM INFO: in Logging messagingThis is the code which i have used to generate logs
    public Logger logs() {
            makeLogFolder();
            Logger log = Logger.getLogger(UtilityHelper.class.getName());
            try {
                int limit = Integer.parseInt(loadProperties(
    Constants.PROPERTY_FILE_NAME)
    .getProperty(Constants.MAX_SIZE_OF_LOG_FILES));
                int numLogFiles = Integer.parseInt(getProperties(
    Constants.MAX_NO_OF_LOG_FILES));
                String LogFileName = getProperties(Constants.LOG_FOLDER) +
    File.separator + getLogInDate() + File.separator +
    getProperties(Constants.LOG_FILE) + getLogDate() +
    " " + getLogTime() + "_%g.log";
                FileHandler fh1 = new FileHandler(LogFileName, limit, numLogFiles);
                fh1.setFormatter(new SimpleFormatter());
                log.addHandler(fh1);
            } catch (IOException ex) {
                ex.printStackTrace();
            } catch (SecurityException ex) {
                ex.printStackTrace();
            return log;
    log.info(message);please let me know how can i do it
    thanks for the reply

    Note: This thread was originally posted in the [Java Virtual Machine (JVM)|http://forums.sun.com/forum.jspa?forumID=37] forum, but moved to this forum for closer topic alignment.

  • Java.util.zip.ZipException: invalid entry size error --  help required

    Hi all
    I am sure this error would have been posted many number of times, but I would really appreciate if someone could help me with my problem. I am working on reading data from a .zip file, which in it has ~5GB data. All I am performing is a read operation through the piece of code specified below. This code worked well for .zip files handling till ~2.5GB
    FileInputStream fis = new FileInputStream(filename);
    BufferedInputStream bis = new BufferedInputStream(fis);
    ZipInputStream zis = new ZipInputStream(bis);
    StreamTokenizer tok = new StreamTokenizer( zis );
    ZipEntry entry;
    while((entry = zis.getNextEntry()) != null)
    \\read from the zip file through the streamTokenizer
    I just print what I read through the program, on the console.
    But the error I get is
    java.util.zip.ZipException: invalid entry size (expected 4294967295 but got 2117536490 bytes)
    at java.util.zip.ZipInputStream.readEnd(Unknown Source)
    at java.util.zip.ZipInputStream.read(Unknown Source)
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at java.io.StreamTokenizer.read(Unknown Source)
    at java.io.StreamTokenizer.nextToken(Unknown Source)
    at ZipFileStreams.getMessages(ZipFileStreams.java:677)
    at ZipFileStreams.main(ZipFileStreams.java:814)
    Could anybody give me hints as to what am I missing and where am i going wrong. Any help would be appreciated.
    Thanks

    Hi,
    I get the same exception while reading a ZIP file. The size if the ZIP file is just 82KB but I am reading it over FTP not sure if it makes any difference. I am using JDK 1.4.2_05. Here is the code I am trying to execute.
    public class TestFTP {
    public static void main( String[] argv ) throws Exception {
    String inboundPath = "/transfer/inbound/";
    FTPClient ftp = new FTPClient();
    ftp.connect("123");
    ftp.login( "123", "123" );
    ftp.changeWorkingDirectory(inboundPath);
    FTPFile[] zipFiles = ftp.listFiles("*.zip");
    TelnetClient telnetClient;
    for(int i=0;i<zipFiles.length;i++){   
    System.out.println(zipFiles.getName());
    ZipInputStream zis = new ZipInputStream(ftp.retrieveFileStream(zipFiles[i].getName()));
    for (ZipEntry entry = zis.getNextEntry(); entry != null; entry = zis.getNextEntry()){           
    System.out.println(entry.getName());
    The error message is
    java.util.zip.ZipException: invalid entry size (expected 10291 but got 10233 bytes)
         at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:367)
         at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
         at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:91)
         at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:69)
         at test.TestFTP.main(TestFTP.java:41)
    Exception in thread "main"
    Please let me know if you were able to fix the problem.
    Thanks

  • Error: java.util.zip.ZipException: missing entry name

    Does anybody know how to solve the following error? I got this error when I was trying to update files in my CVS.
    OracleJSP: oracle.jsp.parse.JspParseException: Line # 2, <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    Error: java.util.zip.ZipException: missing entry name
    Thanks

    Hi,
    I get the same exception while reading a ZIP file. The size if the ZIP file is just 82KB but I am reading it over FTP not sure if it makes any difference. I am using JDK 1.4.2_05. Here is the code I am trying to execute.
    public class TestFTP {
    public static void main( String[] argv ) throws Exception {
    String inboundPath = "/transfer/inbound/";
    FTPClient ftp = new FTPClient();
    ftp.connect("123");
    ftp.login( "123", "123" );
    ftp.changeWorkingDirectory(inboundPath);
    FTPFile[] zipFiles = ftp.listFiles("*.zip");
    TelnetClient telnetClient;
    for(int i=0;i<zipFiles.length;i++){   
    System.out.println(zipFiles.getName());
    ZipInputStream zis = new ZipInputStream(ftp.retrieveFileStream(zipFiles[i].getName()));
    for (ZipEntry entry = zis.getNextEntry(); entry != null; entry = zis.getNextEntry()){           
    System.out.println(entry.getName());
    The error message is
    java.util.zip.ZipException: invalid entry size (expected 10291 but got 10233 bytes)
         at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:367)
         at java.util.zip.ZipInputStream.read(ZipInputStream.java:141)
         at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:91)
         at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:69)
         at test.TestFTP.main(TestFTP.java:41)
    Exception in thread "main"
    Please let me know if you were able to fix the problem.
    Thanks

  • Usage of java.util.Logger

    I have an API which has logs messages using java.util.Logger.
    While using this API to perform activities, i need those log messages to tell me when something is going wrong. How can I view those log messages in console?
    For eg: I have a class with following structure:-
    public class sample
    public static void main (String[] args)
    APIClass api = new APIClass();
    api.doStuff();
    Now i want the messages which are printed inside api to appear in my system console, but only SEVERE messages seems to come out, not INFO, FINE etc.
    Please let me how i can achieve this?

    I was able to get the messages out by following
    java.util.logging.Logger LOGGER = java.util.logging.Logger.getLogger("com.foo");
    java.util.logging.ConsoleHandler ch = new java.util.logging.ConsoleHandler();
    ch.setLevel(Level.FINE);
    LOGGER.addHandler(ch);
    LOGGER.setLevel(Level.FINE);

  • Portal errors...java.util.zip.ZipException

    Hi all,
    I don't have any clue how to solve this problem, anybody knows?
    Full Message Text
    java.util.zip.ZipException: Error opening zip file /usr/sap/P11/DVEBMGS11/j2ee/cluster/server0/./log/archive/_log_kernel_cluster_default.trc1301094236029.zip
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:141)
    at java.util.zip.ZipFile.<init>(ZipFile.java:156)
    at com.sapmarkets.bam.jmxadapter.AbstractLog.getArchiveInfo(AbstractLog.java:328)
    at com.sapmarkets.bam.jmxadapter.AbstractLog.getArchives(AbstractLog.java:454)
    at com.sapmarkets.bam.jmxadapter.AbstractLog.getArchives(AbstractLog.java:477)
    at sun.reflect.GeneratedMethodAccessor2304.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.getAttribute(DefaultMBeanInvoker.java:129)
    at javax.management.StandardMBean.getAttribute(StandardMBean.java:229)
    at com.sap.pj.jmx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:1296)
    at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.getAttribute(MBeanServerWrapperInterceptor.java:181)
    at com.sap.engine.services.jmx.CompletionInterceptor.getAttribute(CompletionInterceptor.java:309)
    at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.getAttribute(BasicMBeanServerInterceptor.java:169)
    at com.sap.jmx.provider.ProviderInterceptor.getAttribute(ProviderInterceptor.java:195)
    at com.sap.engine.services.jmx.RedirectInterceptor.getAttribute(RedirectInterceptor.java:232)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getAttribute(MBeanServerInterceptorChain.java:124)
    at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.getAttribute(MBeanServerSecurityWrapper.java:234)
    at com.sap.engine.services.jmx.ClusterInterceptor.getAttribute(ClusterInterceptor.java:522)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getAttribute(MBeanServerInterceptorChain.java:124)
    at com.sapmarkets.bam.logcontroller.jmx.LogControllerFacade.getLogInfo(LogControllerFacade.java:227)
    at com.sapmarkets.bam.logcontroller.jmx.LogControllerFacade.getLogInfosWithPattern(LogControllerFacade.java:193)
    at com.sapmarkets.bam.logcontroller.jmx.LogControllerFacade.getLogInfos(LogControllerFacade.java:174)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:61)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.getAttribute(DefaultMBeanInvoker.java:129)
    at javax.management.StandardMBean.getAttribute(StandardMBean.java:229)
    at com.sap.pj.jmx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:1296)
    at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.getAttribute(MBeanServerWrapperInterceptor.java:181)
    at com.sap.engine.services.jmx.CompletionInterceptor.getAttribute(CompletionInterceptor.java:309)
    at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.getAttribute(BasicMBeanServerInterceptor.java:169)
    at com.sap.jmx.provider.ProviderInterceptor.getAttribute(ProviderInterceptor.java:195)
    at com.sap.engine.services.jmx.RedirectInterceptor.getAttribute(RedirectInterceptor.java:232)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getAttribute(MBeanServerInterceptorChain.java:124)
    at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.getAttribute(MBeanServerSecurityWrapper.java:234)
    at com.sap.engine.services.jmx.ClusterInterceptor.getAttribute(ClusterInterceptor.java:522)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getAttribute(MBeanServerInterceptorChain.java:124)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:61)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.tc.logviewer.mbean.LocalLVMBeanServer.invoke(LocalLVMBeanServer.java:73)
    at $Proxy334.getAttribute(Unknown Source)
    at com.sapmarkets.bam.application.logdepot.AbstractLogDepot.getAttribute(AbstractLogDepot.java:236)
    at com.sapmarkets.bam.application.logdepot.AbstractLogDepot.getLogDescriptors(AbstractLogDepot.java:84)
    at com.sap.tc.logviewer.mbean.ServerModelLogDepot.getLogDescriptors(ServerModelLogDepot.java:79)
    at com.sap.tc.logviewer.mbean.ServerModelLogDepotGroup$GetLogDescriptorsTask.run(ServerModelLogDepotGroup.java:60)
    at com.sap.tc.logviewer.mbean.ServerModelLogDepotGroup.execute(ServerModelLogDepotGroup.java:173)
    at com.sap.tc.logviewer.mbean.ServerModelLogDepotGroup.getLogDescriptors(ServerModelLogDepotGroup.java:119)
    at com.sap.tc.logviewer.mbean.LogviewerServer.getLogs(LogviewerServer.java:137)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:61)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
    at javax.management.StandardMBean.invoke(StandardMBean.java:286)
    at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
    at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
    at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
    at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
    at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
    at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
    at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
    at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:776)
    at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
    at com.sap.tc.logviewer.client.j2ee.J2EELogviewerServerInvoker.invoke(J2EELogviewerServerInvoker.java:111)
    at com.sap.tc.logviewer.client.j2ee.J2EELogviewerServerProxy.getLogs(J2EELogviewerServerProxy.java:105)
    at com.sap.tc.logviewer.client.base.LogviewerClientImpl$GetLogs.run(LogviewerClientImpl.java:442)
    at java.lang.Thread.run(Thread.java:770)

    I am facing the same problem in portal. Whenever I try to click the (F4) button in record working time it goes to infinite loop and it generates the error messge in log. Can you please inform me what have you done to solve this issue.

  • Error: java.util.map can not be inherited with different arguments

    Hi,
    I am getting following error while building the source code.
    C:\venus\src\com\martquest\messaging\msgio\MqMessageIOObjectCarrier.java:36: java.util.Map cannot be inherited with different arguments: <> and <java.lang.Object,java.lang.Object>
    [javac] public class MqMessageIOObjectCarrier extends Properties implements IMqMessageIOObjectCarrier
    What should I do to resolve this issue?
    Thanks
    Prachi

    Hi,
    I am getting following error while building the
    source code.whose source code? If it's yours, you'd better look at where you are defining and using Map. The error code tells you exactly what's wrong.

  • Cannot send a null Map key for type 'java.util.HashMap'

    Hi All,
      I am haing an issue with sending data from Server to the client using the AMF Channel.
      Most of the method invocations on the RemoteObject are throwing the following Exception.
    [CODE]
    (mx.rpc.events::FaultEvent)#0
      bubbles = false
      cancelable = true
      currentTarget = (null)
      eventPhase = 2
      fault = (mx.rpc::Fault)#1
        content = (null)
        errorID = 0
        faultCode = "Server.Processing"
        faultDetail = (null)
        faultString = "Cannot send a null Map key for type 'java.util.HashMap'."
        message = "faultCode:Server.Processing faultString:'Cannot send a null Map key for type 'java.util.HashMap'.' faultDetail:'null'"
        name = "Error"
        rootCause = (null)
      headers = (null)
      message = (mx.messaging.messages::ErrorMessage)#2
        body = (null)
        clientId = "22E55FB1-910E-312F-E37A-ED5167139CB0"
        correlationId = "4DB54224-662A-C596-D165-F7C3EBB64DB8"
        destination = "TimeMap"
        extendedData = (null)
        faultCode = "Server.Processing"
        faultDetail = (null)
        faultString = "Cannot send a null Map key for type 'java.util.HashMap'."
        headers = (Object)#3
        messageId = "22E56255-D62F-2ACF-4DA5-CF1E4D6353BB"
        rootCause = (null)
        timestamp = 1266877198902
        timeToLive = 0
      messageId = "22E56255-D62F-2ACF-4DA5-CF1E4D6353BB"
      statusCode = 0
      target = (null)
      token = (mx.rpc::AsyncToken)#4
        message = (mx.messaging.messages::RemotingMessage)#5
          body = (Array)#6
          clientId = (null)
          destination = "TimeMap"
          headers = (Object)#7
            DSEndpoint = "my-amf"
            DSId = "22E53936-7E0E-B21C-C936-EF1078000306"
          messageId = "4DB54224-662A-C596-D165-F7C3EBB64DB8"
          operation = "getMapKey"
          source = (null)
          timestamp = 0
          timeToLive = 0
        responders = (Array)#8
          [0] (com.universalmind.cairngorm.events::Callbacks)#9
            conflictHandler = (null)
            faultHandler = (function)
            priority = 0
            resultHandler = (function)
        result = (null)
      type = "fault"
    [CODE]
    The Spring bean which is exposed as a Remote Object has the following method signature..
    [CODE]
    public String getMapKey() {
            return mapKey;
    [/CODE]
    I am unable to understand why AMF Channel or Blaze DS is treating the String as HashMap !!!
    This was working pefectly fine till yesterday !!
    The version of the BlazeDS i am using is : blazeds_turnkey_3-0-0-544
    and the Flex SDK Version is : flex_sdk_3.5.0.12683
    We recently upgraded to Flex 3.5.0 version earlier we were using 3.3 version
    Thanks
    mars

    Hi All,
    I chcked my server side java beans ( which are managed by Spring) and they are all returning the data property and none of the Keys in the returned hashmaps are null.
    Not sure why this is happening.
    Thanks
    kumars

  • Can we call a Java Map in Message  Map

    Hello,
    Can we call a Java Map in Message  Map
    Thanks and Regards
    Hemant

    Hello Vijay,
    I think this is your code:
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;
    I need this code to be converted in UDF if Java map cannot be called in Message Map.
    Can anyone help me how to write UDF for the same java map.
    Thanks and Regards
    Hemant

  • Weird exception: Cannot instantiate non-persistent class: java.util.Map

    java.lang.UnsupportedOperationException: Cannot instantiate non-persistent class: java.util.Map
         at com.sleepycat.persist.impl.NonPersistentFormat.newInstance(NonPersistentFormat.java:45)
         at com.sleepycat.persist.impl.PersistEntityBinding.readEntity(PersistEntityBinding.java:89)
         at com.sleepycat.persist.impl.PersistEntityBinding.entryToObject(PersistEntityBinding.java:61)
         at com.sleepycat.persist.PrimaryIndex.put(PrimaryIndex.java:338)
         at com.sleepycat.persist.PrimaryIndex.put(PrimaryIndex.java:299)
         at com.xx.support.dbd.IdentityDataAccessor.insert(IdentityDataAccessor.java:33)
         at com.xx.support.dbd.BerkeleyDBAccountStorage.saveUser(BerkeleyDBAccountStorage.java:95)
         at com.xx.support.bdb.BerkeleyDBAccountStorageTests.initBerkeleyDBData(BerkeleyDBAccountStorageTests.java:38)
         at com.xx.support.bdb.BerkeleyDBAccountStorageTests.setUp(BerkeleyDBAccountStorageTests.java:28)
         at junit.framework.TestCase.runBare(TestCase.java:125)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
    What's the root cause of this exception?

    I wrote a small test using the classes you included
    in your message and I am able to retrieve the user by
    key, as in the code above. So I'm not sure what
    you're doing that is causing the problem. Please
    send a small test that reproduces the problem.Oops, I forgot to include the source for the test I wrote. Here it is.
    import java.io.File;
    import java.util.HashMap;
    import java.util.Map;
    import com.sleepycat.je.DatabaseException;
    import com.sleepycat.je.Environment;
    import com.sleepycat.je.EnvironmentConfig;
    import com.sleepycat.persist.EntityStore;
    import com.sleepycat.persist.PrimaryIndex;
    import com.sleepycat.persist.StoreConfig;
    import com.sleepycat.persist.model.Entity;
    import com.sleepycat.persist.model.Persistent;
    import com.sleepycat.persist.model.PrimaryKey;
    public class Test {
        @Persistent
        public static class SimplePrincipal {
            protected String name;
            public SimplePrincipal(String username) {
                this.name = name;
            public SimplePrincipal() {}
        @Entity
        public static class SimpleUser extends SimplePrincipal {
            @PrimaryKey
            private String key;
            private Map properties;
            public SimpleUser() {
                super();
                this.properties = new HashMap();
            public SimpleUser(String username) {
                super(username);
                this.properties = new HashMap();
            public void setKey(String key){
                this.key = key;
            public void addPropertity(String name, String value) {
                this.properties.put(name, value);
            @Override
            public String toString() {
                return "[SimpleUser key: " + key + " name: " + name + ']';
        private Environment env;
        private EntityStore store;
        private PrimaryIndex<String, SimpleUser> primaryIndex;
        private void open()
            throws DatabaseException {
            EnvironmentConfig envConfig = new EnvironmentConfig();
            envConfig.setAllowCreate(true);
            envConfig.setTransactional(true);
            env = new Environment(new File("./data"), envConfig);
            StoreConfig storeConfig = new StoreConfig();
            storeConfig.setAllowCreate(true);
            storeConfig.setTransactional(true);
            store = new EntityStore(env, "test", storeConfig);
            primaryIndex = store.getPrimaryIndex(String.class, SimpleUser.class);
        private void close()
            throws DatabaseException {
            store.close();
            env.close();
        private void execute()
            throws DatabaseException {
            SimpleUser user = new SimpleUser("test");
            user.setKey("testkey");
            primaryIndex.put(user);
            user = primaryIndex.get("testkey");
            System.out.println(user);
        public static void main(String[] args)
            throws DatabaseException {
            Test test = new Test();
            test.open();
            test.execute();
            test.close();
    }Mark

  • BEA error: deleteTaskAttributes(int,java.util.Map)

    Hello,
    I have installed OIM 9100 on BEA with an Oracle Database.
    I got the following error message after starting OIM:
    <08.07.2008 11.07 Uhr CEST> <Warning> <EJB> <BEA-012034> <The Remote interface method: 'public abstract void com.thortec
    h.xl.scheduler.interfaces.SchedulerController.deleteTaskAttributes(int,java.util.Map) throws com.thortech.xl.scheduler.e
    xception.SchedulerGenericException,java.rmi.RemoteException' in EJB 'SchedulerController' contains a parameter of type:
    'java.util.Map' which is not Serializable. Though the EJB 'SchedulerController' has call-by-reference set to false, this
    parameter is not Serializable and hence will be passed by reference. A parameter can be passed using call-by-value only
    if the parameter type is Serializable.>
    Can anybody help me or tell me what it means?
    Thank you,
    Matthias

    BEA Weblogic normally throws a ton of these errors as it seems like OIM's ideas on what should be passed by reference and what should be passed by value does not play well with Weblogic.
    I have been told to ignore these warnings.
    Good luck
    /M

  • Java.util.EmptyStackException Mapping error

    Hi All,
    I am integrating SAP ECC 6.0 system with SAP SNC.
    For these i am using  standard content of SAP SNC
    I am getting following mapping error :
    TransformerConfigurationException occurred when loading XSLT InvoiceRequest_InvoicInvoic01_01.xsl; details: Could not load stylesheet.com.sap.engine.lib.xml.util.NestedException: Error parsing query. -> java.util.EmptyStackException
    Plz help me out
    Regards Milan

    hi,
    check the interaface mapping which is used in your flow
    inside integration repository - is it working over there?
    do you see the XSL file in the external archives in repository?
    Regards,
    Michal Krawczyk
    http://mypigenie.com XI/PI FAQ

  • User defined function in java for message mapping

    I wrote the following user defined function in java for message mapping and mapped vendor with this. The aim of this function is to write a error file at defined path when i send empty Vendor value from File to RFC-Function module BAPI_PO_CREATE. The "err.txt" error file is not written when i execute in TEST but the value "ERROR" is returned to destination Vendor Field.
    public String  validation(String a, Container container) {
    //write your code here
    if (a.equals("")) {
    try {
    String source = "Vendor cannot be empty";
    char buffer[] = new char[source.length()];
    source.getChars(0, source.length(), buffer, 0);
    for (int i = 0; i < buffer.length; i +=2)
       f0.write(buffer<i>);
    f0.close();
    FileWriter f1 =  new FileWriter("/10.10.0.55/sapmnt/trans/edixiin/err.txt");
    f1.write(buffer);
    f1.close();
    catch (IOException e) {}
    return "ERROR";

    Hi Senthil,
    Check these things :
    1) Whether you have permission to create a file in that directory.
    2) try giving this 
    10.10.0.55
    sapmnt
    trans
    edixiin
    err.txt
    3) Also check for permissions.
    Hope this will help you.
    Regards
    Suraj

  • Java Message Mapping : Dynamic FileName and Directory for ASMA

    How to Put Dynamic FileName and Directory for ASMA Properties of File Receiver adapter in Java Message Mapping ???
    I know How to Do this in UDF , But In Java Type Message Mapping . How to do this ????
    Regards
    PS.

    Hi
    chk this:
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=95093307
    Thanks
    Amit

Maybe you are looking for

  • Problem with cookies in FL4, Android 2.1, EVO4G?

    Got a 4G at work today and started putting some of our apps onto it.  First time using Flash Lite 4, so it was very exciting to see it running AS3 swfs right out of the box.  Very slick. Ran into a problem though.  When I talk to a server which creat

  • WebDynpro development in GP: only WD java ?

    Hi,   I want to develope a custom webdynpro component that can be used as a callable object, may i choose Webdynpro for ABAP as the development tool? I noticed that in some tutorial that certain APIs are necessary to develop webdynpro component, does

  • Nikal linux kernel 2.6.11.8 build fails

    I am trying to install nidaqmxbase-1.5.0-f2, but the install keeps failing. I tried installing with a stock FC3 kernel, but the build has failed. I have since tried again after building a stock linux 2.6.11.8 kernel, but I get the same error message.

  • HT1338 I try to update twice at the end it show me could not save file or corrupt

    I try to update twice at the end it show me could not save file or corrupt

  • Scheduling of SOA purge instances (11.1.1.7) generating logs

    What is best practice for scheduling the purging of SOA instances using the Oracle Soa purge strategy? Followed the instructions successfully http://docs.oracle.com/cd/E29542_01/admin.1111/e10226/soaadmin_partition.htm#SOAAG97268 My requirements: For