0

I'm creating a node extension for KNIME with the KNIME SDK (which is just an adapted Eclipse). I'm done with my code, I tested it in Eclipse, it worked perfectly. So I exported it, copied the .jar to the subfolder dropins in my KNIME installation, and started KNIME. Made a new workflow, added my node, tried to execute it and then the following error appeared:

Execute failed: Support code location could not be determined. Could not convert from URL to URI location. 
URL Location: file:/C:/Program Files/KNIME_2.11.2/configuration/org.eclipse.osgi/bundles/528/1/.cp/matlabcontrol-4.1.0.jar
Code Source: (file:/C:/Program Files/KNIME_2.11.2/configuration/org.eclipse.osgi/bundles/528/1/.cp/matlabcontrol-4.1.0.jar <no signer certificates>)
Protection Domain: ProtectionDomain  (file:/C:/Program Files/KNIME_2.11.2/configuration/org.eclipse.osgi/bundles/528/1/.cp/matlabcontrol-4.1.0.jar <no signer certificates>)
 null 
 <no principals>  
 java.security.AllPermissionCollection@6ac1c077 (  
 ("java.security.AllPermission" "<all permissions>" "<all actions>") 
)   


Class Loader: org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@b836456
Class Loader Class: class org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader

According to a thread on the KNIME forums, a similar problem also occurs with the community extension "Matlab Snippet", which builds on the same matlabcontrol framework I use (which is also the one mentioned in the error).

I tried evading the problem by including the matlabcontrol as a package in my project (it's open source, so I could just import the sources), then the same error appeared and mentioned the package .jar created by the OSGI system (in my case, matlab.jar, which is the name I chose in my build.properties), so I assume it was just the first one alphabetically and all of the files in the OSGI bundle folder are affected by this problem.

What confuses me is that the problem only occurs once I try to execute the node and connect to MATLAB. Unfortunately, the problem doesn't seem to have been resolved in the KNIME forum thread linked above, apparently an older version of that extension didn't have the issue and users just installed the old version.

So, can I somehow make the URL correctly convert to URI? Is the Protection Domain the cause and can I change it? Does it have anything to do with the default Class Loader?


I have now installed the plugin via a feature in a folder (see comments). The error persists, but the path changed:

Execute failed: Support code location could not be determined. Could not convert from URL to URI location.
URL Location: file:/C:/Program Files/KNIME_2.11.2/plugins/org.knime.ext.matlab_1.0.0/matlab.jar
Code Source: (file:/C:/Program Files/KNIME_2.11.2/plugins/org.knime.ext.matlab_1.0.0/matlab.jar <no signer certificates>)
Protection Domain: ProtectionDomain  (file:/C:/Program Files/KNIME_2.11.2/plugins/org.knime.ext.matlab_1.0.0/matlab.jar <no signer certificates>)
 null
 <no principals>
 java.security.AllPermissionCollection@2da869b5 (
 ("java.security.AllPermission" "<all permissions>" "<all actions>")
)


Class Loader: org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@372bf03c
Class Loader Class: class org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
scenia
  • 1,609
  • 14
  • 33
  • Some KNIME bundle best practices: create a feature and possibly an update site too for your bundle install the feature (it is best not using the `dropins` folder anymore); try using the dependencies as OSGi bundles, especially if other plugins also use it (not sure about the Matlab plugin, hope they follow this advice too). Regarding the URL to URI problem: have you tried with a path without whitespaces/special characters? – Gábor Bakos May 14 '15 at 17:45
  • @GáborBakos Thanks a lot, unfortunately I had to learn KNIME node development the hard way, by just doing it and looking at open source code, I wasn't able to find anything that explains it, so I have no idea about best practices. How do I install without the dropins folder? The KNIME website doesn't describe any different way... The URL/URI thing isn't actually part of my node, I thought that was something the Default Class Loader did to load the plugin or something... – scenia May 14 '15 at 17:59
  • [Here](https://github.com/aborg0/diffbot_knime) you can find a simple project with feature and update site projects. If you build the update site (probably also a source feature), you can host it on a website or just keep it as a folder. Installation goes the same way as other extensions, add an update site URL (can be `file://...`) and install the feature. Each plugin has a different classloader, so you are probably right about the main problem. – Gábor Bakos May 14 '15 at 18:14
  • Alright, I built a feature and an update site. Tried installing, both in Eclipse and in KNIME. In Eclipse, it worked, in KNIME, it failed and showed an error saying it didn't find the file `fropins/matlab.jar`. I've then simply copied the entire plugin folder from Eclipse to KNIME. It worked and installed (I have the nodes), but my original error appears again, this time using the path where I put my plugin. Seems to be a java security issue. I've updated the question with the new error message. – scenia May 14 '15 at 20:11

0 Answers0