Menu

#607 java.lang.VerifyError: Bad type on operand stack

v6.0
open-accepted
None
High
2018-08-12
2016-05-25
No

This code is falling at runtime. I believe it's the multi-exception syntax in the catch is the issue. If I changed it to catch(Exception e) it works. Here is my proguard config,source code and exception

-dontwarn
-verbose
-dontshrink
-dontoptimize
-keepattributes Signature, Annotation, !LocalVariableTable,!LocalVariableTypeTable
-keep class com.coreinformatics.**{
public protected <fields>;
public protected <methods>;
}</methods></fields>

public MSExcelFileProcessor(InputStream in, String delimiter, boolean singleQuotedData)
throws FileProcessorException {
this.delimiter = delimiter;
data = new HashMap<>();
singledQuotedData = singleQuotedData;

    try {
        workbook = WorkbookFactory.create(in);
        workbook.setMissingCellPolicy(Row.CREATE_NULL_AS_BLANK);
    } **catch (IOException | InvalidFormatException e)** {
        LOG.error(e);
        throw new FileProcessorException(e);
    }
}


Exception in thread "Thread-23" java.lang.VerifyError: Bad type on operand stack

Exception Details:
Location:
com/coreinformatics/fileprocessor/processors/file/MSExcelFileProcessor.<init>(Ljava/io/InputStream;Ljava/lang/String;Z)V @66: invokespecial
Reason:
Type 'java/lang/Object' (current frame, stack[2]) is not assignable to 'java/lang/Throwable'
Current Frame:
bci: @66
flags: { }
locals: { top, 'java/lang/Object' }
stack: { uninitialized 61, uninitialized 61, 'java/lang/Object' }
Bytecode:
0x0000000: 2ab7 002a 2a01 b500 262a 2cb5 0027 2abb
0x0000010: 0016 59b7 0038 b500 242a 1db5 0028 2a2b
0x0000020: b800 3db5 0026 2ab4 0026 b200 29b9 0049
0x0000030: 0200 b14c b200 252b b900 4002 00bb 000a
0x0000040: 592b b700 2cbf
Exception Handler Table:
bci [30, 50] => handler: 51
bci [30, 50] => handler: 51
Stackmap Table:
full_frame(@51,{},{Object[#15]})</init>

Related

Bugs: #15
Bugs: #607

Discussion

  • Eric Lafortune

    Eric Lafortune - 2016-06-11

    Thanks for your report. I can't seem to reproduce the problem yet. Which compiler are you using? Do you have a small sample class that I can build and run?

     
    • Vico Minnocci

      Vico Minnocci - 2016-06-12

      Eric,
      Thank you for getting back to me. I'm compiling and running with Java 1.8. The constructor takes an MSExcel file as an input stream and the remaining arguments can be "," and false. Attached is a file in case you don't have MSExcel. The exception happens in the construction of this class.

      Thanks,
      Vico

      Gradle dependencies
      //Apache Commons
      compile 'org.apache.commons:commons-lang3:3.4'
      //Log4j
      def log4J2Version = '2.+'
      compile "org.apache.logging.log4j:log4j-api:${log4J2Version}"
      compile "org.apache.logging.log4j:log4j-core:${log4J2Version}"
      compile "org.apache.logging.log4j:log4j-slf4j-impl:${log4J2Version}"
      // Proguard Obfuscation
      compile 'net.sf.proguard:proguard-gradle:5.2.1'
      //Apache POI
      def poiVersion = '3.13'
      compile "org.apache.poi:poi:${poiVersion}"
      compile "org.apache.poi:poi-ooxml:${poiVersion}"
      

      /*

      • Copyright (c) 2015. Core Informatics
        */

      package com.coreinformatics.fileprocessor.processors.file;

      import com.coreinformatics.fileprocessor.mapping.MappingType;
      import org.apache.commons.lang3.StringUtils;
      import org.apache.logging.log4j.LogManager;
      import org.apache.logging.log4j.Logger;
      import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
      import org.apache.poi.ss.usermodel.Cell;
      import org.apache.poi.ss.usermodel.DataFormatter;
      import org.apache.poi.ss.usermodel.DateUtil;
      import org.apache.poi.ss.usermodel.Row;
      import org.apache.poi.ss.usermodel.Sheet;
      import org.apache.poi.ss.usermodel.Workbook;
      import org.apache.poi.ss.usermodel.WorkbookFactory;
      import java.io.IOException;
      import java.io.InputStream;
      import java.util.ArrayList;
      import java.util.HashMap;
      import java.util.List;

      /**

      • The type Ms excel file processor.
        */
        class MSExcelFileProcessor extends FileProcessor
        {
        private static final Logger LOG = LogManager.getLogger(MSExcelFileProcessor.class);
        private Workbook workbook = null;

        /**

        • Instantiates a new Ms excel file processor.
          *
        • @param in the in
        • @param delimiter the delimiter
        • @param singleQuotedData the single quoted data
        • @throws FileProcessorException the file processor exception
          */
          public MSExcelFileProcessor(InputStream in, String delimiter, boolean singleQuotedData)
          throws FileProcessorException
          {
          this.delimiter = delimiter;
          data = new HashMap<>();
          singledQuotedData = singleQuotedData;

          try
          {
          workbook = WorkbookFactory.create(in);
          workbook.setMissingCellPolicy(Row.CREATE_NULL_AS_BLANK);
          }
          catch (IOException | InvalidFormatException e)
          {
          LOG.error(e);

          throw new FileProcessorException(e);
          

          }
          }

        /**

        • No chunking just add the original stream
          *
        • @param map the map
        • @param stream
        • @return
          */
          @Override
          public List<inputstream> chunkStream(MappingType map, InputStream stream)
          {
          List<inputstream> result = new ArrayList<>();</inputstream></inputstream>

          result.add(stream);

          return result;
          }

        /**

        • clean up
          */
          @Override
          public void close()
          {
          try
          {
          data.clear();
          data = null;
          workbook = null;
          }
          catch (Exception e)
          {
          LOG.error(e);
          }
          }

        /**

        • Get the cell value by sheet, row and column
          *
        • @param sheetNumber the sheet number
        • @param row the row
        • @param column the column
        • @return
        • @throws FileProcessorException
          */
          @Override
          public String getCellValue(int sheetNumber, int row, int column) throws FileProcessorException, BlankRowException
          {
          String result = null;
          Sheet sheet = workbook.getSheetAt(sheetNumber - 1);

          if (sheet != null && sheet.getRow(row - 1) != null)
          {
          if (!checkIfRowIsEmpty(sheet.getRow(row - 1)))
          {
          Cell c = sheet.getRow(row - 1).getCell(column - 1);
          if (c != null)
          {
          result = getCellValue(c);
          }
          else
          {
          throw new FileProcessorException("Column number " + column + " not found.");
          }
          }
          else
          {
          throw new BlankRowException("Row number " + row + " in blank.");
          }
          }
          else
          {
          throw new FileProcessorException("Row number " + row + " not found.");
          }
          return result;
          }

        /**

        • Get the column index by sheet, row and column
          *
        • @param sheetNumber the sheet number
        • @param row the row
        • @param columnName the column name
        • @return
        • @throws FileProcessorException
          */
          @Override
          public int getColumnNumberByHeader(int sheetNumber, int row, String columnName) throws FileProcessorException
          {
          final int[] result = { -1 };
          Sheet sheet = workbook.getSheetAt(sheetNumber - 1);

          if (sheet != null)
          {
          Row r = sheet.getRow(row - 1);

          if (r != null)
          {
              r.forEach(cell -> {
                      if (cell
                      .toString()
                      .toUpperCase()
                      .replaceAll("\\s+", "")
                      .equals(columnName.toUpperCase().replaceAll("\\s+", "")))
                      {
                          result[0] = cell.getColumnIndex() + 1;
                      }
                  });
          
              if (result[0] < 0)
              {
                  throw new FileProcessorException("Column name " + columnName + " not found.");
              }
          }
          else
          {
              throw new FileProcessorException("Row number " + row + " not found.");
          }
          

          }
          else
          {
          throw new FileProcessorException("Sheet number " + sheetNumber + " not found.");
          }

          return result[0];
          }

        /**

        • Get the number of records in a sheet
          *
        • @param sheet
        • @return
          */
          @Override
          public int getNumberOfRecords(int sheet)
          {
          return workbook.getSheetAt(sheet - 1).getLastRowNum() + 1;
          }

        private String getCellValue(Cell c)
        {
        String result;

        if ((c.getCellType() == Cell.CELL_TYPE_NUMERIC) && DateUtil.isCellDateFormatted(c))
        {
            DataFormatter df = new DataFormatter();
        
            result = df.formatCellValue(c);
        }
        else
        {
            c.setCellType(Cell.CELL_TYPE_STRING);
            result = c.toString();
        }
        
        return result;
        

        }

        private boolean checkIfRowIsEmpty(Row row)
        {
        boolean isEmptyRow = true;

        if (row == null)
        {
            return isEmptyRow;
        }
        
        if (row.getLastCellNum() <= 0)
        {
            return isEmptyRow;
        }
        
        for (int cellNum = row.getFirstCellNum(); cellNum < row.getLastCellNum(); cellNum++)
        {
            Cell cell = row.getCell(cellNum);
            if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK && StringUtils.isNotBlank(cell.toString()))
            {
                isEmptyRow = false;
            }
        }
        return isEmptyRow;
        

        }
        }

      From: Eric Lafortune [mailto:lafortune@users.sf.net]
      Sent: Saturday, June 11, 2016 4:49 PM
      To: [proguard:bugs] 607@bugs.proguard.p.re.sf.net
      Subject: [proguard:bugs] #607 java.lang.VerifyError: Bad type on operand stack

      Thanks for your report. I can't seem to reproduce the problem yet. Which compiler are you using? Do you have a small sample class that I can build and run?


      [bugs:#607]https://sourceforge.net/p/proguard/bugs/607/ java.lang.VerifyError: Bad type on operand stack

      Status: open
      Group: v5.2
      Created: Wed May 25, 2016 05:58 PM UTC by Vico Minnocci
      Last Updated: Wed May 25, 2016 05:58 PM UTC
      Owner: nobody

      This code is falling at runtime. I believe it's the multi-exception syntax in the catch is the issue. If I changed it to catch(Exception e) it works. Here is my proguard config,source code and exception

      -dontwarn
      -verbose
      -dontshrink
      -dontoptimize
      -keepattributes Signature, Annotation, !LocalVariableTable,!LocalVariableTypeTable
      -keep class com.coreinformatics.**{
      public protected <fields>;
      public protected <methods>;
      }</methods></fields>

      public MSExcelFileProcessor(InputStream in, String delimiter, boolean singleQuotedData)
      throws FileProcessorException {
      this.delimiter = delimiter;
      data = new HashMap<>();
      singledQuotedData = singleQuotedData;

      try {
      
          workbook = WorkbookFactory.create(in);
      
          workbook.setMissingCellPolicy(Row.CREATE_NULL_AS_BLANK);
      
      } **catch (IOException | InvalidFormatException e)** {
      
          LOG.error(e);
      
          throw new FileProcessorException(e);
      
      }
      

      }

      Exception in thread "Thread-23" java.lang.VerifyError: Bad type on operand stack

      Exception Details:
      Location:
      com/coreinformatics/fileprocessor/processors/file/MSExcelFileProcessor.<init>(Ljava/io/InputStream;Ljava/lang/String;Z)V @66: invokespecial
      Reason:
      Type 'java/lang/Object' (current frame, stack[2]) is not assignable to 'java/lang/Throwable'
      Current Frame:
      bci: @66
      flags: { }
      locals: { top, 'java/lang/Object' }
      stack: { uninitialized 61, uninitialized 61, 'java/lang/Object' }
      Bytecode:
      0x0000000: 2ab7 002a 2a01 b500 262a 2cb5 0027 2abb
      0x0000010: 0016 59b7 0038 b500 242a 1db5 0028 2a2b
      0x0000020: b800 3db5 0026 2ab4 0026 b200 29b9 0049
      0x0000030: 0200 b14c b200 252b b900 4002 00bb 000a
      0x0000040: 592b b700 2cbf
      Exception Handler Table:
      bci [30, 50] => handler: 51
      bci [30, 50] => handler: 51
      Stackmap Table:
      full_frame(@51,{},{Object[#15]https://sourceforge.net/p/proguard/bugs/15/})</init>


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/proguard/bugs/607/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/


      Confidentiality Notice: The information transmitted in this email, including attachments, is intended only for the person(s) or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the designated recipient of this email, any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error, please contact the sender and destroy all copies of this information.
      Core Informatics, LLC, 36 East Industrial Road, Branford, Connecticut, USA 06405

       

      Related

      Bugs: #15
      Bugs: #607

  • Eric Lafortune

    Eric Lafortune - 2016-06-11
    • status: open --> open-works-for-me
    • assigned_to: Eric Lafortune
     
  • Nathan Sweet

    Nathan Sweet - 2016-11-07

    I've also run into a "VerifyError: Bad type on operand stack" problem. I am not using multi-catch. I am compiling with JDK 1.7.0_45 and tried both Proguard 5.2.1 and 5.3.1. I will email you a JAR and Proguard settings that consistently reproduce the problem, hopefully that helps!

     
  • Doug Duthie

    Doug Duthie - 2017-03-10

    I'm also running into this issue. The simplest case to reproduce is below. The catch block catches multiple exceptions and gives "Exception in thread "main" java.lang.VerifyError: Bad type on operand stack".

    As previously mentioned, changing the catch to just catch Exception, or having separate catch blocks for each exception both work. I'm compiling with jdk 1.8.0_91 and using proguard 5.3.2


    package com.doug.test;
    
    import java.security.NoSuchAlgorithmException;
    import java.util.Random;
    import javax.crypto.NoSuchPaddingException;
    
    
    public class App {
      public static void main(String[] args) {
    
        System.out.println("App:main() Test16: Test multi-exception...");
        Random rand = new Random();
        int n = rand.nextInt(1);
        try {
    
          if (n > 0) {
            throw new NoSuchAlgorithmException();
          } else {
            throw new NoSuchPaddingException();
          }
        }
    
        catch ( NoSuchPaddingException | NoSuchAlgorithmException e){
          System.out.println(e.getMessage());
        }
      }
    }
    

    Error: A JNI error has occurred, please check your installation and try again
    Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
    Exception Details:
    Location:
    com/doug/test/App.main([Ljava/lang/String;)V @47: invokevirtual
    Reason:
    Type 'java/lang/Object' (current frame, stack[1]) is not assignable to 'java/security/GeneralSecurityException'
    Current Frame:
    bci: @47
    flags: { }
    locals: { top, top, top, 'java/lang/Object' }
    stack: { 'java/io/PrintStream', 'java/lang/Object' }
    Bytecode:
    0x0000000: b200 0b12 01b6 000c bb00 0959 b700 104c
    0x0000010: 2b04 b600 113d 1c9e 000b bb00 0859 b700
    0x0000020: 0fbf bb00 0a59 b700 12bf 4eb2 000b 2db6
    0x0000030: 000e b600 0cb1
    Exception Handler Table:
    bci [22, 42] => handler: 42
    bci [22, 42] => handler: 42
    Stackmap Table:
    chop_frame(@34,1)
    same_locals_1_stack_item_frame(@42,Object[#5])

        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
    

    Proguard configuration file is below


    -injars 'C:\ProGuardTest\out\artifacts\ProGuardTest_jar\ProGuardTest.jar'
    -outjars 'C:\ProGuardTest\out\artifacts\ProGuardTest_jar\ProGuardTestObf.jar'
    
    -libraryjars Library\Java\JavaVirtualMachines\jdk1.8.0_91.jdk\Contents\Home\jre\lib\rt.jar
    -libraryjars 'C:\ProGuardTest\out\artifacts'
    
    -keepdirectories
    -target 1.8
    -dontshrink
    -printusage usage.txt
    -dontoptimize
    -optimizations !code/allocation/variable
    -optimizationpasses 0
    -printmapping mapping.txt
    -keepattributes *Annotation*,SourceFile,LineNumberTable,Signature,InnerClasses,EnclosingMethod,MethodParameters,RuntimeVisibleAnnotations,RuntimeVisibleParameterAnnotations,RuntimeVisibleTypeAnnotations,Exceptions
    -verbose
    -dontnote com.**,org.**,javax.**,!milestonegroup.**,**
    -dontwarn com.**,org.**,javax.**,!milestonegroup.**,**
    -ignorewarnings
    
    #Keep - Applications. Keep all application classes, along with their 'main'
    # methods.
    -keepclasseswithmembers public class * {
        public static void main(java.lang.String[]);
    }
    
     

    Related

    Bugs: #5

  • Himanshu Patel

    Himanshu Patel - 2017-04-14

    Hi Eric,

    Has this bug been fixed in v5.3.2? I am getting this "java.lang.VerifyError: Bad type on operand stack" error at run time. I feel i too have a similiar problem in my code.

    I am getting the similiar error. Below is the error stack. I have a source java class that has multi exception syntax in it. I am using ProGuard v5.3.2, Maven Proguard Plugin with plugin version 2.0.14.

    My proguard configuration is after the error stack trace.

    Error Stack:

    ERROR org.apache.storm.util - Async loop died!
    java.lang.VerifyError: Bad type on operand stack
    Exception Details:
    Location:
    com/mycompany/dmip/procjobstep/formatter/a.a(Lcom/mycompany/dmip/jobstep/f/c;Lcom/mycompany/dmip/jobstep/strategy/w;)Ljava/util/Map; @185: invokevirtual
    Reason:
    Type 'java/lang/Object' (current frame, stack[3]) is not assignable to 'java/lang/Exception'
    Current Frame:
    bci: @185
    flags: { }
    locals: { top, top, top, top, top, top, top, 'java/lang/Object' }
    stack: { uninitialized 170, uninitialized 170, 'java/lang/StringBuilder', 'java/lang/Object' }
    Bytecode:
    0x0000000: 2ab4 002f 2cb6 003a b800 44b9 004e 0200
    0x0000010: c000 1d4e 2dc7 0024 2cb6 0038 3a04 2a19
    0x0000020: 0412 08b6 003b 4e2a b400 2f2c b600 3ab8
    0x0000030: 0044 2db9 004f 0300 572b 120a b900 4c02
    0x0000040: 003a 0519 05c1 002a 9900 0d19 05c0 002a
    0x0000050: 3a04 a700 252c b600 3912 0ab6 0032 b600
    0x0000060: 3303 b900 4d02 00c0 000f b600 3119 05b8
    0x0000070: 003c b800 3d3a 04bb 0021 59b7 0042 3a06
    0x0000080: b200 303a 0719 0412 0719 07b9 004f 0300
    0x0000090: 57b2 002e 120c 1904 b900 5003 002d 1904
    0x00000a0: 1906 b600 40a7 0023 3a07 bb00 1259 bb00
    0x00000b0: 2659 1205 b700 4619 07b6 0043 b600 47b6
    0x00000c0: 0048 1907 b700 34bf 1906 b600 453a 07b2
    0x00000d0: 002e 1202 1907 b900 5003 0012 0b19 07b8
    0x00000e0: 003c b0
    Exception Handler Table:
    bci [128, 165] => handler: 168
    bci [128, 165] => handler: 168
    Stackmap Table:
    full_frame(@57,{Top,Object[#20],Object[#23],Object[#29]},{})
    full_frame(@85,{Top,Top,Object[#23],Object[#29],Top,Object[#36]},{})
    full_frame(@119,{Top,Top,Top,Object[#29],Object[#42]},{})
    full_frame(@168,{},{Object[#36]})
    full_frame(@200,{Top,Top,Top,Top,Top,Top,Object[#33]},{})

    at com.mycompany.dmip.procjobstep.formatter.FormatterStrategyBuilder.getInstance(SourceFile:42) ~[formatter-jobstep-3.0.0.0.2-SNAPSHOT-obfuscate.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:68) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:1) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.procjobstep.c.prepare(SourceFile:220) ~[dmipDPC.jar:?]
    at org.apache.storm.daemon.executor$fn__8058$fn__8071.invoke(executor.clj:795) ~[storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.util$async_loop$fn__624.invoke(util.clj:482) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
    

    2017-04-13 16:25:45.188 [Thread-6-formatter-executor[2 2]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} ERROR org.apache.storm.daemon.executor -
    java.lang.VerifyError: Bad type on operand stack
    Exception Details:
    Location:
    com/mycompany/dmip/procjobstep/formatter/a.a(Lcom/mycompany/dmip/jobstep/f/c;Lcom/mycompany/dmip/jobstep/strategy/w;)Ljava/util/Map; @185: invokevirtual
    Reason:
    Type 'java/lang/Object' (current frame, stack[3]) is not assignable to 'java/lang/Exception'
    Current Frame:
    bci: @185
    flags: { }
    locals: { top, top, top, top, top, top, top, 'java/lang/Object' }
    stack: { uninitialized 170, uninitialized 170, 'java/lang/StringBuilder', 'java/lang/Object' }
    Bytecode:
    0x0000000: 2ab4 002f 2cb6 003a b800 44b9 004e 0200
    0x0000010: c000 1d4e 2dc7 0024 2cb6 0038 3a04 2a19
    0x0000020: 0412 08b6 003b 4e2a b400 2f2c b600 3ab8
    0x0000030: 0044 2db9 004f 0300 572b 120a b900 4c02
    0x0000040: 003a 0519 05c1 002a 9900 0d19 05c0 002a
    0x0000050: 3a04 a700 252c b600 3912 0ab6 0032 b600
    0x0000060: 3303 b900 4d02 00c0 000f b600 3119 05b8
    0x0000070: 003c b800 3d3a 04bb 0021 59b7 0042 3a06
    0x0000080: b200 303a 0719 0412 0719 07b9 004f 0300
    0x0000090: 57b2 002e 120c 1904 b900 5003 002d 1904
    0x00000a0: 1906 b600 40a7 0023 3a07 bb00 1259 bb00
    0x00000b0: 2659 1205 b700 4619 07b6 0043 b600 47b6
    0x00000c0: 0048 1907 b700 34bf 1906 b600 453a 07b2
    0x00000d0: 002e 1202 1907 b900 5003 0012 0b19 07b8
    0x00000e0: 003c b0
    Exception Handler Table:
    bci [128, 165] => handler: 168
    bci [128, 165] => handler: 168
    Stackmap Table:
    full_frame(@57,{Top,Object[#20],Object[#23],Object[#29]},{})
    full_frame(@85,{Top,Top,Object[#23],Object[#29],Top,Object[#36]},{})
    full_frame(@119,{Top,Top,Top,Object[#29],Object[#42]},{})
    full_frame(@168,{},{Object[#36]})
    full_frame(@200,{Top,Top,Top,Top,Top,Top,Object[#33]},{})

    at com.mycompany.dmip.procjobstep.formatter.FormatterStrategyBuilder.getInstance(SourceFile:42) ~[formatter-jobstep-3.0.0.0.2-SNAPSHOT-obfuscate.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:68) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:1) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.procjobstep.c.prepare(SourceFile:220) ~[dmipDPC.jar:?]
    at org.apache.storm.daemon.executor$fn__8058$fn__8071.invoke(executor.clj:795) ~[storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.util$async_loop$fn624.invoke(util.clj:482) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
    

    2017-04-13 16:25:45.198 [Thread-10-SourceInbound-executor[1 1]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} INFO com.mycompany.dmip.g - ++ loading software version information: {MAJOR_RELEASE=3, SVN_REVISION=10932, MINOR_RELEASE=0, DMIP_RELEASE=3.0.0.0.2-SNAPSHOT}
    2017-04-13 16:25:45.200 [Thread-10-SourceInbound-executor[1 1]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} INFO com.mycompany.dmip.g - Creating Version instance (should be once per JVM on DPC)
    2017-04-13 16:25:45.323 [Thread-6-formatter-executor[2 2]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} ERROR org.apache.storm.util - Halting process: ("Worker died")
    java.lang.RuntimeException: ("Worker died")
    at org.apache.storm.util$exit_process_BANG_.doInvoke(util.clj:341) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.RestFn.invoke(RestFn.java:423) [clojure-1.7.0.jar:?]
    at org.apache.storm.daemon.worker$fn8663$fn8664.invoke(worker.clj:765) [storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.daemon.executor$mk_executor_data$fn7875$fn7876.invoke(executor.clj:274) [storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.util$async_loop$fn**624.invoke(util.clj:494) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
    2017-04-13 16:26:03.077 [Thread-10-SourceInbound-executor[1 1]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} INFO STDIO - loading software version information: {}{MAJOR_RELEASE=3, SVN_REVISION=10932, MINOR_RELEASE=0, DMIP_RELEASE=3.0.0.0.2-SNAPSHOT}
    2017-04-13 16:26:03.084 [Thread-6-formatter-executor[2 2]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} ERROR org.apache.storm.util - Async loop died!
    java.lang.VerifyError: Bad type on operand stack
    Exception Details:
    Location:
    com/mycompany/dmip/procjobstep/formatter/a.a(Lcom/mycompany/dmip/jobstep/f/c;Lcom/mycompany/dmip/jobstep/strategy/w;)Ljava/util/Map; @185: invokevirtual
    Reason:
    Type 'java/lang/Object' (current frame, stack[3]) is not assignable to 'java/lang/Exception'
    Current Frame:
    bci: @185
    flags: { }
    locals: { top, top, top, top, top, top, top, 'java/lang/Object' }
    stack: { uninitialized 170, uninitialized 170, 'java/lang/StringBuilder', 'java/lang/Object' }
    Bytecode:
    0x0000000: 2ab4 002f 2cb6 003a b800 44b9 004e 0200
    0x0000010: c000 1d4e 2dc7 0024 2cb6 0038 3a04 2a19
    0x0000020: 0412 08b6 003b 4e2a b400 2f2c b600 3ab8
    0x0000030: 0044 2db9 004f 0300 572b 120a b900 4c02
    0x0000040: 003a 0519 05c1 002a 9900 0d19 05c0 002a
    0x0000050: 3a04 a700 252c b600 3912 0ab6 0032 b600
    0x0000060: 3303 b900 4d02 00c0 000f b600 3119 05b8
    0x0000070: 003c b800 3d3a 04bb 0021 59b7 0042 3a06
    0x0000080: b200 303a 0719 0412 0719 07b9 004f 0300
    0x0000090: 57b2 002e 120c 1904 b900 5003 002d 1904
    0x00000a0: 1906 b600 40a7 0023 3a07 bb00 1259 bb00
    0x00000b0: 2659 1205 b700 4619 07b6 0043 b600 47b6
    0x00000c0: 0048 1907 b700 34bf 1906 b600 453a 07b2
    0x00000d0: 002e 1202 1907 b900 5003 0012 0b19 07b8
    0x00000e0: 003c b0
    Exception Handler Table:
    bci [128, 165] => handler: 168
    bci [128, 165] => handler: 168
    Stackmap Table:
    full_frame(@57,{Top,Object[#20],Object[#23],Object[#29]},{})
    full_frame(@85,{Top,Top,Object[#23],Object[#29],Top,Object[#36]},{})
    full_frame(@119,{Top,Top,Top,Object[#29],Object[#42]},{})
    full_frame(@168,{},{Object[#36]})
    full_frame(@200,{Top,Top,Top,Top,Top,Top,Object[#33]},{})

    at com.mycompany.dmip.procjobstep.formatter.FormatterStrategyBuilder.getInstance(SourceFile:42) ~[formatter-jobstep-3.0.0.0.2-SNAPSHOT-obfuscate.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:68) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:1) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.procjobstep.c.prepare(SourceFile:220) ~[dmipDPC.jar:?]
    at org.apache.storm.daemon.executor$fn__8058$fn__8071.invoke(executor.clj:795) ~[storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.util$async_loop$fn__624.invoke(util.clj:482) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
    

    2017-04-13 16:26:03.101 [Thread-6-formatter-executor[2 2]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} ERROR org.apache.storm.daemon.executor -
    java.lang.VerifyError: Bad type on operand stack
    Exception Details:
    Location:
    com/mycompany/dmip/procjobstep/formatter/a.a(Lcom/mycompany/dmip/jobstep/f/c;Lcom/mycompany/dmip/jobstep/strategy/w;)Ljava/util/Map; @185: invokevirtual
    Reason:
    Type 'java/lang/Object' (current frame, stack[3]) is not assignable to 'java/lang/Exception'
    Current Frame:
    bci: @185
    flags: { }
    locals: { top, top, top, top, top, top, top, 'java/lang/Object' }
    stack: { uninitialized 170, uninitialized 170, 'java/lang/StringBuilder', 'java/lang/Object' }
    Bytecode:
    0x0000000: 2ab4 002f 2cb6 003a b800 44b9 004e 0200
    0x0000010: c000 1d4e 2dc7 0024 2cb6 0038 3a04 2a19
    0x0000020: 0412 08b6 003b 4e2a b400 2f2c b600 3ab8
    0x0000030: 0044 2db9 004f 0300 572b 120a b900 4c02
    0x0000040: 003a 0519 05c1 002a 9900 0d19 05c0 002a
    0x0000050: 3a04 a700 252c b600 3912 0ab6 0032 b600
    0x0000060: 3303 b900 4d02 00c0 000f b600 3119 05b8
    0x0000070: 003c b800 3d3a 04bb 0021 59b7 0042 3a06
    0x0000080: b200 303a 0719 0412 0719 07b9 004f 0300
    0x0000090: 57b2 002e 120c 1904 b900 5003 002d 1904
    0x00000a0: 1906 b600 40a7 0023 3a07 bb00 1259 bb00
    0x00000b0: 2659 1205 b700 4619 07b6 0043 b600 47b6
    0x00000c0: 0048 1907 b700 34bf 1906 b600 453a 07b2
    0x00000d0: 002e 1202 1907 b900 5003 0012 0b19 07b8
    0x00000e0: 003c b0
    Exception Handler Table:
    bci [128, 165] => handler: 168
    bci [128, 165] => handler: 168
    Stackmap Table:
    full_frame(@57,{Top,Object[#20],Object[#23],Object[#29]},{})
    full_frame(@85,{Top,Top,Object[#23],Object[#29],Top,Object[#36]},{})
    full_frame(@119,{Top,Top,Top,Object[#29],Object[#42]},{})
    full_frame(@168,{},{Object[#36]})
    full_frame(@200,{Top,Top,Top,Top,Top,Top,Object[#33]},{})

    at com.mycompany.dmip.procjobstep.formatter.FormatterStrategyBuilder.getInstance(SourceFile:42) ~[formatter-jobstep-3.0.0.0.2-SNAPSHOT-obfuscate.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:68) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:1) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.procjobstep.c.prepare(SourceFile:220) ~[dmipDPC.jar:?]
    at org.apache.storm.daemon.executor$fn__8058$fn__8071.invoke(executor.clj:795) ~[storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.util$async_loop$fn__624.invoke(util.clj:482) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
    

    2017-04-13 16:26:03.107 [Thread-10-SourceInbound-executor[1 1]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} INFO com.mycompany.dmip.g - ++ loading software version information: {MAJOR_RELEASE=3, SVN_REVISION=10932, MINOR_RELEASE=0, DMIP_RELEASE=3.0.0.0.2-SNAPSHOT}
    2017-04-13 16:26:03.113 [Thread-10-SourceInbound-executor[1 1]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} INFO com.mycompany.dmip.g - Creating Version instance (should be once per JVM on DPC)
    2017-04-13 16:26:03.430 [Thread-6-formatter-executor[2 2]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} ERROR org.apache.storm.util - Halting process: ("Worker died")
    java.lang.RuntimeException: ("Worker died")
    at org.apache.storm.util$exit_process_BANG_.doInvoke(util.clj:341) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.RestFn.invoke(RestFn.java:423) [clojure-1.7.0.jar:?]
    at org.apache.storm.daemon.worker$fn__8663$fn__8664.invoke(worker.clj:765) [storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.daemon.executor$mk_executor_data$fn__7875$fn__7876.invoke(executor.clj:274) [storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.util$async_loop$fn__624.invoke(util.clj:494) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
    2017-04-13 16:26:20.548 [Thread-10-SourceInbound-executor[1 1]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} INFO STDIO - loading software version information: {}{MAJOR_RELEASE=3, SVN_REVISION=10932, MINOR_RELEASE=0, DMIP_RELEASE=3.0.0.0.2-SNAPSHOT}
    2017-04-13 16:26:20.544 [Thread-6-formatter-executor[2 2]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} ERROR org.apache.storm.util - Async loop died!
    java.lang.VerifyError: Bad type on operand stack
    Exception Details:
    Location:
    com/mycompany/dmip/procjobstep/formatter/a.a(Lcom/mycompany/dmip/jobstep/f/c;Lcom/mycompany/dmip/jobstep/strategy/w;)Ljava/util/Map; @185: invokevirtual
    Reason:
    Type 'java/lang/Object' (current frame, stack[3]) is not assignable to 'java/lang/Exception'
    Current Frame:
    bci: @185
    flags: { }
    locals: { top, top, top, top, top, top, top, 'java/lang/Object' }
    stack: { uninitialized 170, uninitialized 170, 'java/lang/StringBuilder', 'java/lang/Object' }
    Bytecode:
    0x0000000: 2ab4 002f 2cb6 003a b800 44b9 004e 0200
    0x0000010: c000 1d4e 2dc7 0024 2cb6 0038 3a04 2a19
    0x0000020: 0412 08b6 003b 4e2a b400 2f2c b600 3ab8
    0x0000030: 0044 2db9 004f 0300 572b 120a b900 4c02
    0x0000040: 003a 0519 05c1 002a 9900 0d19 05c0 002a
    0x0000050: 3a04 a700 252c b600 3912 0ab6 0032 b600
    0x0000060: 3303 b900 4d02 00c0 000f b600 3119 05b8
    0x0000070: 003c b800 3d3a 04bb 0021 59b7 0042 3a06
    0x0000080: b200 303a 0719 0412 0719 07b9 004f 0300
    0x0000090: 57b2 002e 120c 1904 b900 5003 002d 1904
    0x00000a0: 1906 b600 40a7 0023 3a07 bb00 1259 bb00
    0x00000b0: 2659 1205 b700 4619 07b6 0043 b600 47b6
    0x00000c0: 0048 1907 b700 34bf 1906 b600 453a 07b2
    0x00000d0: 002e 1202 1907 b900 5003 0012 0b19 07b8
    0x00000e0: 003c b0
    Exception Handler Table:
    bci [128, 165] => handler: 168
    bci [128, 165] => handler: 168
    Stackmap Table:
    full_frame(@57,{Top,Object[#20],Object[#23],Object[#29]},{})
    full_frame(@85,{Top,Top,Object[#23],Object[#29],Top,Object[#36]},{})
    full_frame(@119,{Top,Top,Top,Object[#29],Object[#42]},{})
    full_frame(@168,{},{Object[#36]})
    full_frame(@200,{Top,Top,Top,Top,Top,Top,Object[#33]},{})

    at com.mycompany.dmip.procjobstep.formatter.FormatterStrategyBuilder.getInstance(SourceFile:42) ~[formatter-jobstep-3.0.0.0.2-SNAPSHOT-obfuscate.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:68) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.jobstep.strategy.c.build(SourceFile:1) ~[dmipDPC.jar:?]
    at com.mycompany.dmip.procjobstep.c.prepare(SourceFile:220) ~[dmipDPC.jar:?]
    at org.apache.storm.daemon.executor$fn__8058$fn__8071.invoke(executor.clj:795) ~[storm-core-1.0.2.jar:1.0.2]
    at org.apache.storm.util$async_loop$fn__624.invoke(util.clj:482) [storm-core-1.0.2.jar:1.0.2]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.7.0.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
    

    2017-04-13 16:26:20.554 [Thread-6-formatter-executor[2 2]] itemId= { jobName="FormatterPH1PU1" ,jobTemplateId="test" ,userOrAppId="1" ,tenantId="1", jobStep=""} ERROR org.apache.storm.daemon.executor -
    java.lang.VerifyError: Bad type on operand stack
    Exception Details:

    ProGuard Configuration.
    <plugin>
    <dependencies>
    <dependency>
    <groupid>net.sf.proguard</groupid>
    <artifactid>proguard-base</artifactid>
    <version>5.3.2</version>
    </dependency>
    </dependencies>
    <groupid>com.github.wvengen</groupid>
    <artifactid>proguard-maven-plugin</artifactid>
    <version>2.0.14</version>
    <executions>
    <execution>
    <id>obfuscate-jobstep-framework</id>
    <phase>compile</phase>
    <goals>
    <goal>proguard</goal>
    </goals>
    </execution>
    </executions>
    <configuration>
    <proguardversion>5.3.2</proguardversion>
    <obfuscate>true</obfuscate>
    <options></options></configuration></plugin>

    <option>-injars ${work.folder}/rt-repo-jars-${project.version}.jar(!org/springframework/integration/gateway/MessagingGatewaySupport.class)</option> <option>-outjars ${project.build.directory}/dmpstreaming/modules/dpc/files/dmipDPC.jar</option> <option>-injars ${work.folder}/job-builder-${project.version}-jar.jar(!org/springframework/integration/gateway/MessagingGatewaySupport.class)</option> <option>-outjars ${project.build.directory}/dmpstreaming/modules/job_builder/files/job-builder.jar</option> <option>-injars ${work.folder}/formatter-jobstep/formatter-jobstep-${project.version}/lib/formatter-jobstep-${project.version}.jar</option> <option>-outjars ${work.folder}/formatter-jobstep/formatter-jobstep-${project.version}/lib/formatter-jobstep-${project.version}-obfuscate.jar</option> <option>-libraryjars ${work.folder}/spring-integration-core-4.3.0.RELEASE.jar(!org/springframework/integration/gateway/MessagingGatewaySupport.class)</option> <option>-libraryjars ${work.folder}/storm-core-1.0.2.jar</option> <option>-libraryjars ${work.folder}/jdom2-2.0.6.jar</option> <option>-libraryjars ${work.folder}/AdvCommon-7.3.0.jar</option> <option>-libraryjars ${work.folder}/Advisor-7.3.0.jar</option> <option>-libraryjars ${work.folder}/AdvisorSvr-7.3.0.jar</option> <option>-libraryjars ${work.folder}/InnovatorRT-7.3.0.jar</option> <option>-libraryjars ${work.folder}/OROMatcher-7.3.0.jar</option> <option>-libraryjars ${work.folder}/quartz-2.1.0.jar</option> <option>-keep class !com.mycompany.** { *; }</option> <option>-keep,includedescriptorclasses public class com.mycompany.dmip.common.builder.manager.JobBuilderManager { public static void main(java.lang.String[]); }</option> <option>-keep class com.mycompany.dmip.jobstep.strategy.AbstractBaseInJobStepStrategyBuilder { ]]>(...); ]]>; ]]>; } </option> <option>-keep class com.mycompany.dmip.cache.manager.CacheManagerFactory { ]]>(...); ]]>; ]]>; } </option> <option>-keep class org.apache.storm.topology.OutputFieldsDeclarer { *; }</option> <option>-keep class com.mycompany.dmip.procjobstep.formatter.FormatterStrategyBuilder { *; }option> </option><option>-dontusemixedcaseclassnames</option> <option>-dontskipnonpubliclibraryclasses</option> <option>-dontskipnonpubliclibraryclassmembers</option> <option>-useuniqueclassmembernames</option> <option>-dontoptimize</option> <option>-dontshrink</option> <option>-dontnote</option> <option>-dontwarn</option> <option>-keepattributes SourceFile,LineNumberTable</option> <option>-renamesourcefileattribute SourceFile</option> <option>-keepattributes *Annotation*,Signature,RuntimeVisible</option> <option>-keepattributes InnerClasses,Deprecated,EnclosingMethod</option> <option>-keepclassmembers enum * { *; }</option> <option>-keepclassmembers class * implements java.io.Serializable { static final long serialVersionUID; private static final java.io.ObjectStreamField[] serialPersistentFields; !static !transient ]]>; private void writeObject(java.io.ObjectOutputStream); private void readObject(java.io.ObjectInputStream); java.lang.Object writeReplace(); java.lang.Object readResolve(); } </option> <option>-keepclasseswithmembernames,includedescriptorclasses class * { native ]]>; } </option> <option>-printmapping ${project.build.directory}/mycompany_map.map</option> <option>-verbose</option> ***Java Class:***
    package com.mycompany.dmip.procjobstep.formatter;
    
    import java.io.IOException;
    import java.io.StringReader;
    import java.io.StringWriter;
    import java.io.Writer;
    import java.util.HashMap;
    import java.util.Map;
    
    import javax.annotation.Nonnull;
    
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    import com.mycompany.dmip.jobstep.TupleProcessingStyle;
    import com.mycompany.dmip.jobstep.exception.FailTupleException;
    import com.mycompany.dmip.jobstep.exception.JobStepConfigurationException;
    import com.mycompany.dmip.jobstep.strategy.AbstractPartialJobStepStrategy;
    import com.mycompany.dmip.jobstep.strategy.PartialTupleIterationContext;
    import com.mycompany.dmip.jobstep.tuple.IDmipTuple;
    import com.google.common.collect.ImmutableMap;
    import com.google.common.collect.Maps;
    
    import freemarker.template.Configuration;
    import freemarker.template.Template;
    import freemarker.template.TemplateException;
    
    
    public class FormatterStrategy extends AbstractPartialJobStepStrategy {
        public static final String LOGICAL_INPUT_FIELD_NAME = "input";
        public static final String LOGICAL_OUTPUT_FIELD_NAME = "instantiatedTemplate";
        private static final String CONVERSION_TEMPLATE = "conversionTemplate";
    
        private static final Logger logger = LoggerFactory.getLogger(FormatterStrategy.class);
    
      /**
    
          * The default constructor is removed during obfuscation.
      */
        public FormatterStrategy() {
        }
    
        @Override
        public void setGlobalJobStepParams(@Nonnull final Map<String, Object> globalJobStepParams) { }
    
        /**
    
         * Defines the strategy for the job step.
         */
        @Nonnull
        @Override
        public TupleProcessingStyle getTupleProcessingStyle() {
            logger.debug("Processing style for this job step is {}.",
                    TupleProcessingStyle.PARTIAL_ITERATION_CONTEXT);
            return TupleProcessingStyle.PARTIAL_ITERATION_CONTEXT;
        }
    
        private final Map<Integer, Template> templates = new HashMap<>();
    
        @Nonnull
        @Override
        @SuppressWarnings("unchecked")
        public Map<String, Object> process(@Nonnull final IDmipTuple inputTupleWithRequiredFieldsIndexedByInternalName,
                                           @Nonnull final PartialTupleIterationContext context) {
            Template template = templates.get(context.getCurrentIteration());
            if (template == null) {
                final Map<String, Object> parameters = context.getIterationParameters();
                template = getTemplate(parameters, CONVERSION_TEMPLATE);
                templates.put(context.getCurrentIteration(), template);
            }
    
            Map<String,Object> dataMap;
            Object dataObject = inputTupleWithRequiredFieldsIndexedByInternalName.get(LOGICAL_INPUT_FIELD_NAME);
            if (dataObject instanceof Map) {
                dataMap = (Map<String, Object>) dataObject;
            } else {
                // We've got just a single input stream field configured for our required input stream,
                // so build a map from that.
                dataMap = Maps.newHashMap(ImmutableMap.of(
                        context.getProcessingIterationParamBlock().getRequiredFieldByLogicalFieldName(LOGICAL_INPUT_FIELD_NAME)
                                .getInputSchemaFields().get(0).getStreamFieldName(),
                        dataObject));                   
            }
    
            final Writer out = new StringWriter();
            try {                                  
                // Add the helper class to the dataMap
                FreeMarkerHelper helper = FreeMarkerHelper.INSTANCE;
                dataMap.put("__helper", helper);
    
                // Process the data map with the template
                logger.debug("invoking template engine using dataMap {}",dataMap);                  
                template.process(dataMap, out);
            } /*catch (TemplateException | IOException e) {
                throw new FailTupleException("Problem processing the conversion template: " + e.getMessage(), e);
            }*/
            catch (Exception e) {
                throw new FailTupleException("Problem processing the conversion template: " + e.getMessage(), e);
            }
    
            // Get the result of that processing and wrap in a map for return, as expected by framework
            final Object document = out.toString();
            logger.debug("FormatterStrategy completed format of tuple into string - {}", document);
            return ImmutableMap.of(LOGICAL_OUTPUT_FIELD_NAME, document);
    
        }
    
        protected Template getTemplate(final Map<String, Object> parameters, final String lookupKey) {
            final String  conversionTemplate = (String) parameters.get(lookupKey);
            logger.debug("FormatterStrategy running with template: {}", conversionTemplate);
            if (conversionTemplate == null) {
                throw new JobStepConfigurationException("Conversion template must be defined for Formatter job step.", lookupKey);
            }
    
            try {
                System.setProperty("org.freemarker.loggerLibrary", "none");
                // Create a FreeMarker Template instance from the configured conversion template
                return new Template("formatter-job-step", new StringReader(conversionTemplate), new Configuration());
            } catch (IOException e) {
                throw new JobStepConfigurationException("Problem creating the FreeMarker template from string: " + conversionTemplate, e);
            }
        }
    }
    
     

    Related

    Bugs: #20
    Bugs: #23
    Bugs: #29
    Bugs: #33
    Bugs: #36
    Bugs: #42

  • Justis R

    Justis R - 2018-06-21

    I am also receiving this error when running progaurd6.0.3 on any code using multi-catch.
    Simply changing my multi-catch blocks to single catch blocks, and duplicating the code resolves the issue, but it is a serious hinderance.
    Why has this not been fixed? And still on "works for me" status.

     

    Last edit: Justis R 2018-06-21
    • Trejkaz

      Trejkaz - 2018-08-08

      Do you have a reproduction? I was trying to reproduce this one to narrow it down, but I used one of the other examples above, and couldn't get it to happen.

       
      • Eric Lafortune

        Eric Lafortune - 2018-08-09

        Reviewing the issue again, I can reproduce it with the sample of Doug Duthie (higher up). Sorry about the delay. I'll look into it.

         
        • Eric Lafortune

          Eric Lafortune - 2018-08-09

          The problem in Doug's sample is masked by -ignorewarnings. Specifying -libraryjarswith the Java 9 runtime jmods/java.base.jmod instead of the Java 8 runtime lib/rt.jar solves the issue. ProGuard can then find the referenced javax.crypto.NoSuchPaddingException and its class hierarchy.

           
          • Justis R

            Justis R - 2018-08-10

            Hey Eric, what you pointed out was helpful. It seems Doug was referencing the java rt.jar as though it were located on MacOS (I use Mac), rather than Windows, and given the rest of his library references, I'm certain he's using windows, so his rt.jar reference was likely pointing to something nonexistent.
            Doug try C:\Program Files\Java..etc ensure your library reference is correct.

            I also realized I was improperly referencing rt.jar; I fixed my reference to 1.8's rt.jar and all of my problems were gone.
            However, I couldn't find any documentation on migrating from 1.8 to 1.9 and above. I've tried referencing java.base.jmod as you've suggested:

            Reading library directory [/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home/jmods/java.base.jmod]
            

            However, doing this results in the exact same problem as previously existed, ProGaurd couldn't find any of the java class references from this.
            Any ideas why this would be working for you and not me?

            EDIT: Just found a bug report regarding this, it's still open but as priority 7: https://sourceforge.net/p/proguard/bugs/551/

             

            Last edit: Justis R 2018-08-10
            • Eric Lafortune

              Eric Lafortune - 2018-08-12

              PgoGuard 6.0 is out, so issue #551 should have been closed. If you still see a similar problem, make sure that you specify the runtime libraries and other external libraries that your application requires:

              • Choose a suddiciently high version of Java.
              • You may need to specify other relevant jmod libraries beside java.base.jmod. ProGuard doesn't automatically load additional jmod files based on any metadata that might be present.

              The console output lists any classes that are missing and that may lead to corrupt output. Avoid -ignorewarnings or -dontwarn unless you know why it's applicable.

              You can currently find some documentation in the examples, e.g. examples/standalone/applications.pro

               
              • Justis R

                Justis R - 2018-08-12

                Using "(!.jar;!module-info.class)" at the end of the jmod path as suggested in the examples resulted in the library not being able to be read. Not sure why the example uses that. However, I did get it to work without the "(!.jar;!module-info.class)".
                Thanks for all of your help Eric.

                I believe you can close this request. Since the OP didn't specify any libraryjar at all, and Dough and I both incorrectly referrenced our java librarys, I believe it's safe to conclude that the output jars being broken upon usage of a multi exception catch line as reported in this bug is only a direct result of not properly specifying our java runtime libs.

                 
  • Eric Lafortune

    Eric Lafortune - 2018-08-09
    • status: open-works-for-me --> open-accepted
    • Group: v5.2 --> v6.0
    • Priority: 5 --> High
     

Log in to post a comment.

MongoDB Logo MongoDB