Getting started with node development

Experienced developer, KNIME newbie, trying to get started on developing a new node and getting nowhere.

My installation of KNIME does not have a “File->New->Other-> Konstanz Information Miner->Create a new KNIME Node-Extension”. Where do I find it?

Would also like to see some source code, for the platform and nodes I expect to work with. Again no joy. I can check out from Github but where do I put the code? I can’t Import anything except workflows.

I read the FAQ and “Accessing KNIME’s source code” but they just don’t match anything I can find.

What am I missing? Do I have to add bits to Eclipse first? It sure looks different from other times I’ve used it.

3 Likes

Hello! Does this help https://docs.knime.com/2019-12/analytics_platform_new_node_quickstart_guide/index.html?

Best,

Christian

3 Likes

Better. At least now I know why it didn’t work before. But still no success.

Followed the instructions to the letter down to cloning the repo. That seemed to work fine, but the repo is tiny. I was expecting something quite large.

The next two steps seemed to work, but in zero time. Nothing got added to Eclipse and double-click on " KNIME Analytics Platform.launch" failed with “Unrecognized VM option ‘UnsyncloadClass’”.

I didn’t see any error messages, but I found a .log in the workspace directory with errors in it. The first is:

org.osgi.framework.BundleException: Could not resolve module: org.eclipse.mylyn.bugzilla.core [293]
Unresolved requirement: Require-Bundle: org.eclipse.mylyn.commons.xmlrpc; bundle-version=“[3.8.0,4.0.0)”

Any assistance much appreciated. I’m way out of my depth here.

Hi @dandl,

what jvm do you have configured in the launch config? KNIME needs a hotspot based java 8 jvm to run.
Please take a look at your launch / debug configuration and make sure a valid jvm is selected:


best,
Gabriel

1 Like

Ran it again selecting KNIME-AP.target. This time it ran much longer, but still the error:
cannot create JVM
Unrecognized VM option ‘UnsyncloadClass’

Java version looks OK. Was only installed very recently.

java version “1.8.0_231”
Java™ SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot™ Client VM (build 25.231-b11, mixed mode)

image

But you’ve selected a Java 13 environment in that config not a java 8 one like you’ve detailed.

2 Likes

Sorry, must have clicked by accident while screen clipping. Here is the right clip.
image

Makes absolutely no difference, I tried a few and they all produce the same error.This was the latest version of the JDK when I installed it about a month ago, for a different project. It worked for that.

I know you’re trying to help, but this is most frustrating. I’ve used Eclipse occasionally for many years, and never had this kind of problem.What do I try next?

Should I uninstall/reinstall Java, and if so which should I use? Is there anything critical to do with the path or environment variables or 32/64-bit?

It still looks like your using jdk 13, maybe running with Java 8 compatibility? I’m not sure what JavaSE-1.8(jdk-13.0.1) actually means.

It looks like KNIME is trying to load with the VM option of ‘UnsyncloadClass’ which looks to have been deprecated and then removed by Java 13.

I’m not particularly familiar with this end of KNIME development but the error does seem to be implying you’re using an incompatible Java VM.

You could try downloading Adopt OpenJDK which I believe is the version KNIME deploys with:

image

Select for Java 8 and Hotspot.

Once installed/downloaded you should be able to add this as an environment from eclipse:

Window > Preferences > Java > Installed JREs

Then add the AdoptOpenJDK one following the dialog.

Hope it works!

Cheers

Sam

3 Likes

So I:

  • uninstalled and scrubbed clean any trace of a Java install
  • installed the one shown above.
  • installed Eclipse RCP RAP 2019-12 v4.14 (it said use the latest >= 4.7)
  • Cloned the repo GitHub - knime/knime-sdk-setup: KNIME Analytics Platform - SDK Setup
  • Selected KNIME-AP-complete.target, which failed (again): missing salesforce extension.
  • Selected KNIME-AP.target, which appeared to complete successfully.
  • This time there is no Run configuration for KNIME. So…
  • Ran the .launch file.

And it works, with this error message:

ERROR main CategorySorter CODING PROBLEM After-ID ‘social-media’ of [Id: report Name: Reporting After-id: social-media] does not exist - in plug-in org.knime.base

There are also several errors in the workspace .log file, none look critical.

Thank you for your patience, but I can’t help feeling there are some issues in there needing to be addressed, hopefully to save us all some time.

  • Is it really so sensitive about the precise version of Java?
  • If it fails, how about some better diagnostics?
  • The Run configuration thing worked previously, but not this time.
  • The sales force thing must be a bug.
  • At least some of the log messages must be bugs.

Now to get started on the actual project.

Is it really so sensitive about the precise version of Java?

Well, you can probably get away with using others but only if they provide the features required. I for example use an old Oracle distribution and Amazon Corretto as AdoptOpenJDK doesn’t have JavaFX - this are both JDK 8 versions though. Jumping from 8 to 13 is a fairly big change and you got his by features being deprecated in 11 and removed in 12 or 13. I would assume it could be reconfigured to work in the sense of launching but that would be somewhat not worth the effort as the production version comes bundled with AdoptOpenJDK so you really want to be using that one for the development.

Whether all the libraries work on Java 13 is another question. I believe some ML libraries were caught out by using internal API that got removed.

Someone on the KNIME team will have to answer that one properly though.

The sales force thing must be a bug.

I’d assume so, could it not resolve the jars? I’d probably avoid using this target platform anyway unless you need the community contributions in your dev environment.

I do this kind of stuff often. I usually just install the latest of everything and mostly it just works, or I get a diagnostic that says why not.

Java versioning is always confusing, but if I read it correctly Java 8 is from 2014 and just barely on LTS, expiring this year. KNIME really needs to move on.

On top of that I’m reasonably sure there are bugs in the KNIME code, which just adds to the confusion. I know how hard it is to keep all the balls in the air, but it’s just not a good look.

I don’t know whether the KNIME team watch these forum topics, but one would hope so. I don’t know enough to raise an issue, and by the time I do these problems will be just history.

But thanks for the tips anyway. I foresee more questions before long.

Hi @dandl,

I am sorry you got caught in the confusion with the salesforce plugin, it is an in-development plugin and not yet fully released. I am looking into it today, to ensure it will work in the near future.

To avoid such problems we recommend using a release branch of the knime-sdk-setup repository. The releases/2019-12 branch is the one related to our latest release. Developing against the master branch target platform can be unstable, as it contains unreleased and still changing software.

PS: We do monitor these forums topics, and I am looking forward to answering your future questions.

best,
Gabriel

1 Like

Thanks for chipping in.

Sorry to contradict, but the setup instructions clearly recommend using the master branch. I agree wholeheartedly it would be better for a newbie such as myself to be directed toward a stable release branch in the first instance. Perhaps you should change that?

In my view you should also make it much clearer that KNIME platform and extension development is rev-locked on Java 8. Or perhaps do the work to bring it up to a more modern version? I read that (wrongly) as a minimum version, not a maximum. It failed, and not in a good way.

[My intent here is not to criticise, but to provide feedback to help make KNIME better.]

Further questions:

  • Is there a KNIME roadmap?
  • How closely is KNIME tied to Subversion? Will this change? Will issues be enabled on GitHub?
  • How closely is KNIME tied to Swing? Is that a problem for Eclipse integration?

Happy to break those out into separate topics or raise issues if you prefer.

While I leave everything related to SDK Setup to @gab1one, I can answer some of the other questions :-). First and most importantly: thanks for your feedback! That’s actually exactly what we need to improve our SDK setup (and also KNIME in general). So please, don’t hesitate to provide more feedback.

Is there a KNIME roadmap?

We don’t have a public or external roadmap somewhere on our website or so at the moment. However, at our summits we usually give an outlook over current activities and next projects.

How closely is KNIME tied to Subversion?

Not at all. We used to work with Subversion and some of our community extensions still use our subversion to host their extensions. However, all of KNIME code got migrated to BitBucket (Bitbucket) and many community extensions already today host their code in BitBucket or GitHub repositories themselves. We still offer the build system and hosting of the update-sites (no matter where your code is hosted, as long as we can access it somehow).

Will issues be enabled on GitHub?

We thought about that, but decided for now we’ll use the forum for issues etc. Could change in the future, but no plans at the moment.

How closely is KNIME tied to Swing? Is that a problem for Eclipse integration?

Dialogs of nodes have to be written in Swing. Views of nodes can be written in JavaScript and/or Swing. We also support SWT for other types of extensions.

I hope this helps. Have a great weekend!

Christian

2 Likes

OK. I’ve done the quickstart at https://docs.knime.com/2019-12/analytics_platform_new_node_quickstart_guide/index.html, but this just generates canned code. There is another different one at https://www.knime.com/developer/example/node-model, which looks more interesting but seems incomplete and possibly broken.

Question: what should I best do next to learn about node development?

I’ve managed to import knime.core source code, but it won’t browse. I keep getting:
image
Question: how to fix?

Question: why Swing? Is that historical?

1 Like

Hi @dandl,

If you want to learn from actual extension source code, don’t worry about at knime-core which contains the code for the inner workings of the analytics platform. Instead, take a look at some extensions, that usually add nodes that focus on solving a specific problem.

For example the knime-stats repo contains nodes related to calculating statistics:

You can also take a look at community extensions, the following one is very cool and it uses some more advanced KNIME concepts such as custom data ports:

An example on how to integrate a remote data source can be found here:

In general, the best way into KNIME development is trying to build an extension that solves one of your problems. This way you are both motivated and guided towards your goal.
In any case please always feel free to ask questions here.

best,
Gabriel

1 Like

Thanks for the tips. I agree – best to read real code and try to solve a real problem.

My interest is relational database theory so I went looking for JOIN. It’s not easy. Someone really should write better READMEs for the KNIME repos on GitHub.A few signposts for the standard nodes would help.

But I tracked it down via the ‘nodepit’ to source code deeply nested in knime-base. Now I’m just struggling with getting it loaded properly in Eclipse so it will browse and build.

My real problem also requires closer integration with Eclipse. I assume that’s the workbench project? But I don’t know how to load and build those core Knime projects in a way I can investigate them. Any suggestions?

Hi @dandl,

thank you for your feedback. You should be able to just import these projects into your workspace after setting the target platform as described in the getting started guide. I am doing the same when I work with these projects.

best,
Gabriel

That all works, but then I get these errors. It seems to browse OK, but it won’t build or run.

The formatting is messy, but basically it looks like two POM errors and one tagsoup. Any suggestions how to fix?

|Archive for required library: ‘org.knime.product/lib/tagsoup-1.2.1.jar’ in project ‘knime-product’ cannot be read or is not a valid ZIP file|knime-product||Build path|Build Path Problem|

|Project build error: Non-resolvable parent POM for org.knime:knime-core:${revision}${changelist}: Failure to transfer org.knime.maven:parent-pom:pom:4.1.0-SNAPSHOT from ${knime.shared.p2} was cached in the local repository, resolution will not be reattempted until the update interval of p2-knime-shared has elapsed or updates are forced. Original error: Could not transfer artifact org.knime.maven:parent-pom:pom:4.1.0-SNAPSHOT from/to p2-knime-shared (${knime.shared.p2}): Cannot access ${knime.shared.p2} with type p2 using the available connector factories: AetherRepositoryConnectorFactory, BasicRepositoryConnectorFactory and ‘parent.relativePath’ points at wrong local POM|pom.xml|/knime-core|line 8|Maven pom Loading Problem|

|Project build error: Non-resolvable parent POM for org.knime:knime-workbench:3.8.0-SNAPSHOT: Failure to transfer org.knime.maven:parent-pom:pom:1.0.0-SNAPSHOT from ${knime.base.p2} was cached in the local repository, resolution will not be reattempted until the update interval of knime.base.p2 has elapsed or updates are forced. Original error: Could not transfer artifact org.knime.maven:parent-pom:pom:1.0.0-SNAPSHOT from/to knime.base.p2 (${knime.base.p2}): Cannot access ${knime.base.p2} with type p2 using the available connector factories: AetherRepositoryConnectorFactory, BasicRepositoryConnectorFactory and ‘parent.relativePath’ points at wrong local POM|pom.xml|/knime-workbench|line 8|Maven pom Loading Problem|

|The project cannot be built until build path errors are resolved|knime-product||Unknown|Java Problem|
|The project cannot be built until build path errors are resolved|org.knime.base||Unknown|Java Problem|
|The project was not built since it depends on org.knime.base, which has build path errors|org.knime.examples.numberformatter||Unknown|Java Problem|

Hi @dandl,

it looks like you did not use git-lfs when cloning the knime-product project, that is why the file is not downloaded correctly. Secondly you can ignore the maven errors, or better just remove the maven nature from the projects in eclipse (rightclick -> configure -> remove maven nature).

best,
Gabriel

2 Likes