(Another) Issue with getting tag cloud image when running in Batch mode [SOLVED/Workaround]

I have a very simple workflow that runs the tag cloud node fine in KNIME with the GUI but breaks in batch.  (to simplify: Table Creator w/ String, Double; String to Tag node; Tag Cloud; ... image save to file -- see sample attached)

Two Questions:

  1. Has anyone gotten tag clouds working with KNIME_BATCH_APPLICATION?  If so, can you please let me know your config. below so I can try it?
  2. Is there a recommended way to handle the .knimeLock that's being left?  (Once I get this running, I'm planning to run with the workingFile attribute pointing at a .zip of the workflow instead of workingDir attribute, so maybe this isn't too much of a concern, assuming the .knimeLock file won't be left in the .zip file.) 

From the dump log (attached), the error appears to be swing/awt related, I think.  The last item in the stack is: 

    j  sun.awt.windows.ThemeReader.getThemeMargins(JIII)Ljava/awt/Insets;+0

This makes a certain amount of sense to me because KNIME is running headless, so if the tag cloud node is using swing/awt to place words, maybe it needs a graphical environment.  

I have reviewed this link, and adding the suppressErrors flag does not help: http://tech.knime.org/forum/knime-users/issue-with-getting-tag-cloud-image-when-running-in-batch-mode

I'm running on a Windows Server 2012 R2 (i.e., Windows 8.1) with Java 64-bit (the v7u60 that comes with the KNIME download) and KNIME v.2.11.1 (64-bit).  I'm running w/ 512MB max perm and 6GB max heap.

The command line is: 

knime "--launcher.suppressErrors" -reset -consoleLog -nosplash -nosave -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="D:/knime-workspace/TagCouldTest/" -preferences="D:/output/.preferences.epf" 

With the batch, I see in the console that the first few nodes actually execute OK.  However, when it gets to the Tag Cloud node:

  1. execution stops,
  2. a .knimeLock file is left in the workflow directory,
  3. two dump files are placed in the knime.exe directory:
    1. hs_err_pid1848.log (attached)
    2. hs_err_pid1848.mdmp

Thanks in advance!

For what it's worth, I found a workaround to my TagCloud question and figured I'd share:  

Workaround:  I had success creating a Java snippet in my workflow that set the UI look and feel prior to calling the TagCloud node -- I connected them via flow ports so I was sure it was completed first:

try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
    //do nothing for test
}

Not an ideal solution, but it is allowing me to move forward...

Background and Log File:

  • AFAIK, the problem only occurs (i) on Windows machines while (ii) running in KNIME_BATCH_APPLICATION mode.  
  • I could run successfully on Linux in batch mode. 
  • I could run successfully on Windows (Server 2012 and Win 7) with KNIME GUI -- i.e., not in batch mode
  • I could not run in batch mode on either Windows Server 2012 or Win 7
  • From the log, I noticed that my problem is related to the TagCloud node using the system default LookAndFeel, which on my machines appears to be the com.sun.java.swing.plaf.windows.WindowsLookAndFeel look and feel (this is from the log file I attached to my original post):
    • sun.awt.windows.ThemeReader.getThemeMargins(JIII)Ljava/awt/Insets;+0
    • ...
    • com.sun.java.swing.plaf.windows.XPStyle.getMargin
    • ...
    • j com.sun.java.swing.plaf.windows.WindowsLookAndFeel$XPBorderValue.getXPValue(Ljavax/swing/UIDefaults;)Ljava/lang/Object;+11
  • It looks like there have been outstanding Java bugs related to this.  E.g., https://bugs.openjdk.java.net/browse/JDK-6899701?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel 

 

Attempted Solutions that Didn't Work:

I couldn't get KNIME to respect the parameter:

  • -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel

None of these worked -- I added it:

  1. in the knime.ini file to try to update KNIME itself
  2. on the command line, running the Eclipse loader .jar directly through a java call so I could pass in JVM parameters (this link was very helpful for that: https://tech.knime.org/forum/knime-developers/how-to-run-workfow-bypass-knimeexe-to-run-java-batch)
  3.  in a swing.properties file in the jre's lib folder

... I also looked through the KNIME preferences to try to find a setting for this, but I didn't see anything.

Hope this helps someone some day....

Thanks for the workaround.

I was facing the same issue but while executing the workflow in the server. Locally it works perfect, but in the server the tag cloud node crashed.

 

 

What is the exact error message you are getting?

I had the same issues while trying to use TagClound in batch mode. Thank you very much for the workaround, it works. I am attaching the log-file which led me to the TagCloud: hs_err_pid7000.log.

Best regards.