Using old knime libs

Hi there,

I’m using tycho / maven together with old knime libs version 2.12. I know, this is pretty old, but I still have to care about some legacy code using java-1.7.

Now I’m a little bit confused, because (with knime-4.2.2) one of my nodes reports an error “DataLoadError: Unable to load port content for node xyz: Invalid spec class …”

When looking into the knime log, the line numbers and the error message wording in the traceback don’t match to those in my 2.12-libs, but to the current api.

I specified version 2.12 in my pom.xml like this
<project> ... <repositories> <repository> <id>eclipse-indigo</id> <url>http://download.eclipse.org/releases/indigo</url> <layout>p2</layout> </repository> <repository> <id>knime-2.12</id> <url>http://update.knime.org/analytics-platform/2.12</url> <layout>p2</layout> </repository> </repositories> </project>

My question: I thought, I can use this old api together with the current knime, but maybe I’m wrong?

I changed my “Require-Bundle” specification in MANIFEST.MF like
- org.knime.core;bundle-version=“2.12.2”,
+ org.knime.core;bundle-version="[2.12.2,2.13.0)",

to restrict not only the minimum, but also the maximum accepted version. Now, at least, I get an error when loading this plugin. I tried also to export my 2.12 knime-core.jar by adding it to the plugin/lib directory and adding

Bundle-ClassPath: lib/knime-core.jar,

But still something seems missing. Or is this way - explicitely shipping the needed lib - not possible at all?

Best, Frank

Hi @sonnenburg,

While you can explicitly ship needed libraries, this will deficiently not work with the KNIME core libraries in any safe or sane way. Are you trying to develop a plugin that works with these super old versions of KNIME AP at the same time as with the current version? In that case you should compile it for both version independently, once linking against the old, once against the new version.
Your legacy code should still work with the current knime-core version, even if it is java-7 based. Maybe if you can give me a more detailed explanation of your issues I can help you find a solution. BTW you should really try avoid using 2.12, that version is about 5 years out of date.

best
Gabriel

Hi Gabriel,

thanks a lot for your answer! I absolutely agree, this 2.12 api is really old, I’m currently in the process of getting rid of this legacy stuff, so I catch up to the current api.

Regarding my issue: I figured out, that the implementation changed, of how a PortObjectSpecSerializer class will be determined. The old way used a static factory method in the PortObjectSpec class, but now I have to register the SpecSerializer in a PortType extension.

I found the crucial code lines by looking into the current api, which, as I now understand, will be used with a current knime, no matter whether my plugin was built with a 2.12 api or some other. Thanks for spotting and clarifying.

Best regards

Frank

1 Like

Great to hear this worked for you, please let us know if you have any more questions, I am always happy to help you out :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.