Hi, I confronted one error when I developed customized node in Eclipse. Node cannot be created due the following reason: XXXXX/MyParameter. which is set into null as one class attribute in NodeModel at first, and configured later by using information from Dialog.
When I debug it, I can not step into NodeModel, it goes into exception procedure. so no useful information returned about MyParameter.
My questions come,
what kind of reasons to make a node not created with respect with object attributes??
why the debug failed in Eclipse?? Although there are information in KNIME Error Log, says FrameworkEventError, detail in belowā¦But when it concerns to other nodes, it works. Then I think the frame is fine, right??
org.knime.workbench.ui
Error
Thu Feb 28 14:50:03 CET 2019
FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.knime.workbench.ui [223784]
Another singleton bundle selected: osgi.identity; type=āosgi.bundleā; version:Version=ā3.7.0.v201809260727ā; osgi.identity=āorg.knime.workbench.uiā; singleton:=ātrueā
at org.eclipse.osgi.container.Module.start(Module.java:444)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1550)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Have you tried configuring a breakpoint for NullPointerException (caught and uncaught) and seeing if that throws anything up? You will almost certainly get a few spurious ones during the startup but it may also show you somewhere where your parameter is being accessed before you are expecting.
I dont hold out a huge amount of hope for this though, as the FrameworkException looks like something different is going wrong
Before I set it into Null for one of my parameter, I couldnāt step into the NodeModel, it jumped already into the bug. Then I changed some library which relates to my parameter, it steps into NodeModel class, and everything begins to work.
I wonder if there is some errors with java link, which I can debug into the class. Although, in Eclipse there is no sign for this error.
A reason with my side for node cannot be created might be ā The class for NodeModel is not well created(but the error is hidden from Eclipse IDE)ā¦ The other reasons are ??
It seems like there was a problem with the dependencies of your project, that would explain the behavior. Maybe the framework could not load the class of your parameter during runtime, so it failed.
Is the node correctly created now or are you still having issues?
Do you mean framework for KNIME, not the Eclipse Framwork?? After the dependency changed, the Node can be created in KNIME, but in Error Log, one view of KNIME, there are still the same errors shown about the FrameworkEventError.
OK, in Eclipse, if you are not already in the ādebugā perspective goto Window -> Perpsective -> Open Perspective and look for Debug. You should then have a view with tabs for Variables and Breakpoints:
Is the library you changed another eclipse project in your workspace, or are you including it as a .jar file in a lib folder in the project with the node?
If it is another workspace project, make sure you have it configured as a required dependency - otherwise the Eclipse classloader loads plugins in a pretty much random order, and so sometimes the dependency might load first, and you are OK, and other times it might load later, and you are not OK.
thanks at first. I use the debug mode but never used the Exception Caught in breakpoint. Great to know it!!
But the library, it is generated from another project and then put it into use manually. I think I put the same .jar twice, one is to lib folder, one is for the reference path in Build Configuration. So, according to the loader mechanism of Eclipse, it is better that I always put my /*.jar into lib folder??
I think put it in /lib, and make sure it is included in the classpath section of the Runtime tab, and also that your lib folder is included in both source and binary builds, and in the āextra classpath entriesā part of the build
One more exception related to dependency of the *.jar file import.
ERROR KNIME-Worker-1 Node
Execute failed: Found interface org.processmining.plugins.petrinet.replayresult.PNRepResult, but class was expected
I checked online and found out the explanation quite good in this link General Situation In Jave
But I donāt know how to solve the problems. It is due to the loading mechanism of KNIME, or it is because of the imported *.jar file??
This is a common occurence if you had a different version of a jar file on the compile time classpath than on the runtime classpath.
I would guess that maybe Eclipse is finding an two versions of the jar in different places? Not an error Iāve ever seen though, so thatās about as good as I can do
The problem is already solved!! The cause::
the library dependency on the external *.jar side. It is due to the dependency in chaos with some jar files. The error is not on KNIME side.
The solution:
Obtain the right version of jar files
To check the files in jar, no easy way, use the command jar tf *.jar | grep XXX.
To check the version, use unzip -p file.jar | head
inform the responsible people for those jar files development and update the *.jar files.
Clean the cache of .ivy dependency to build the new version
sometimes ivy donāt refresh the downloaded jar files, at least with me. So go to the cache, delete it, recompile to get the new versions.