writing my first node... including JSch

Hi,
I am writing my first node: remote execute a specified program.
By following your tutorial I got an empty node set up in KNIME. Now I am trying to add the JSch functionality by simply copying code from an example. Everything seems to be compiling fine. But when trying to move node to the project I get the following message:
The selected node could not be created due to the following reason:
com/jcraft/jsch/UserInfo

When I comment the following lines out it works:
UserInfo ui=new MyUserInfo();
session.setUserInfo(ui);

Naturally I want them to be included…

I don’t know how to interpret the error message.
I couldn’t the debugger stop at any line breakpoints. Is there anything I have to look out for?
Do I have to register the JSch Jars somewhere else other than in the node?

Thanks,

Bernd

I found in the FAQ the following:
http://www.knime.org/developer/faq#q19 (which basically answers my previous question)

I created a new plugin and within that a new node. (Everything worked). Then I followed the instructions in the FAQ and now I get (after applying the FAQ modifications to MANIFEST.MF):

ERROR RepositoryManager Node org.pasteur.pf2.ngs.Novoalign2_03NodeFactory’ from plugin ‘org.pasteur.pf2.ngs’ could not be created. The corresponding plugin bundle could not be activated!
ERROR main RepositoryManager Node org.pasteur.pf2.ngs.Novoalign2_03NodeFactory’ from plugin ‘org.pasteur.pf2.ngs’ could not be created. The corresponding plugin bundle could not be activated!

Have a look at “runtime-workspace”/.metadata/.log. There Eclipse writes error messages about why a certain plugin/bundle cannot be loaded. Usually it’s missing dependencies or classes.

There I find the following:
!ENTRY org.eclipse.osgi 2 0 2009-09-10 10:36:01.875
!MESSAGE The activator org.pasteur.pf2.ngs.Novoalign2_03NodePlugin for bundle org.pasteur.pf2.ngs is invalid
!STACK 0
org.osgi.framework.BundleException: The activator org.pasteur.pf2.ngs.Novoalign2_03NodePlugin for bundle org.pasteur.pf2.ngs is invalid

and

Root exception:
java.lang.ClassNotFoundException: org.pasteur.pf2.ngs.Novoalign2_03NodePlugin
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:434)

Do you really need a plugin activator? If not, remove its definition in the META-INF/MANIFEST.MF (first tab).

I unselected the “Activate this plug-in when one of its classes is loaded” and it still doesn’t work.
(Same error message.)

I guess one of my problems is that i don’t fully understand the concept of a plug-in verses a node. Where could I read up on this?

Second, I found somewhere a note that the novoalign.jar file is not found. I don’t think this jar is being created and it actually should be called novoalign2_03.jar if at all. Where would this be defined? I.e. the target of the compilation…

Under Runitime it says:
exported Packages:
org.pasteur.pf2.ngs
Classpath:
bin/org/pasteur/pf2/ngs
lib/jsch-0.1.42.jar

I checked on the file system that the classes are there and they are there.

The node-id in “plugin.xml” is the same as in Novoalign2_03NodePlugin.java
public static final String PLUGIN_ID = “org.pasteur.pf2.ngs.Novo”;

I also don’t understand the “Builders” (Java Builder, Plug-in Manifest Builder, Extension POint Schema Builder) under properties of my project (org.pasteur.pf2.ngs)

don’t know if this is good or bad:
under Properties for org.pasteur.pf2.ngs -> Plug-in Development -> Runtime Classpath it reads:
/org.pasteur.pf2.ngs/bin (and it is selected)

Otherwise the selections under Properties seem to make sense to me and seem to be fine.

In the .log file there are a lot of reference to something like:
!MESSAGE Missing required bundle org.eclipse.birt.chart.device.svg_[2.1.0,3.0.0).
!SUBENTRY 2 org.eclipse.birt.chart.device.pdf 2 0 2009-09-09 13:18:11.734
!MESSAGE Missing required bundle org.eclipse.birt.chart.engine_[2.1.0,3.0.0).
!SUBENTRY 2 org.eclipse.birt.chart.device.pdf 2 0 2009-09-09 13:18:11.734

are those of any importance?

So I guess I am a little bit lost …

Thanks for your kind help.

Bernd

You must not deselect the “Activate this plug-in when one of its classes is loaded”-option but remove the class name in the “Activator” field just above the option.
The classpath for a plugin when being run from inside Eclipse is different than that defined in the Manifest, which is used when the plugin is used in standalone KNIME.
Did you use KNIME’s Node Wizard? That should have created you a working plugin (if there isn’t a bug, we don’t known about).
The Builders-section in the Project properties look fine.
Regarding the “Missing bundle” messages, they may not be necessarily a problem, especially if your plugin does not use Birt or depend on it in some way.

Thor,
I checked the box “Activate this plug-in when one of its classes is loaded” and still get the same error message:
ERROR RepositoryManager Node org.pasteur.pf2.ngs.Novo’ from plugin ‘org.pasteur.pf2.ngs’ could not be created.
ERROR main RepositoryManager Node org.pasteur.pf2.ngs.Novo’ from plugin ‘org.pasteur.pf2.ngs’ could not be created.

Otherwise I don’t see any error message in the .log file.

Yes I created the node using the wizard, but afterwards I applied the changes from the FAQ. Then it didn’t work anymore…

Don’t know where to look anymore…

Best,

bernd

Here is the MANIFFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Novoalign-Node extension for KNIME Workbench
Bundle-SymbolicName: org.pasteur.pf2.ngs;singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: bin/org/pasteur/pf2/ngs/,
lib/jsch-0.1.42.jar
Bundle-Vendor: Bernd Jagla
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.knime.workbench.core,
org.knime.workbench.repository,
org.knime.base
Eclipse-LazyStart: true
Export-Package: org.pasteur.pf2.ngs

Plugin.xml:

  <extension
     point="org.knime.workbench.repository.categories">
  <category
        description="NGS related nodes"
        icon="icons/plate.gif"
        level-id="NGS"
        name="NGS"
        path="/"/>



build.properties:
output.novoalign.jar = bin/
bin.includes = plugin.xml,
plugin.properties,
META-INF/,
lib/jsch-0.1.42.jar,
bin/org/pasteur/pf2/ngs/
src.includes = src/,
plugin.xml,
plugin.properties,
META-INF/,
lib/jsch-0.1.42.jar
jars.extra.classpath = lib/jsch-0.1.42.jar
jars.compile.order = lib/

I added in build.properties:
source.bin/org/pasteur/pf2/ngs/ = src/

and now I can see the node…

This entry “Bundle-ClassPath: bin/org/pasteur/pf2/ngs/” looks wrong. The classpath folder must be the top-level bin-folder (and it is by default).

But, now I get in the console:
ERROR Novoalign2_03NodeFactory CODING PROBLEM XML node file does not conform with DTD: The content of element type “shortDescription” must match “null”.
ERROR main Novoalign2_03NodeFactory CODING PROBLEM XML node file does not conform with DTD: The content of element type “shortDescription” must match “null”.

here is the Novoalign2_03NodeFactory.xml:

<?xml version="1.0" encoding="utf-8"?> Novoalign
<shortDescription>
    Node to execute novo align on a remote machine. for more information see <li>http://novoalign.org</li>
</shortDescription>

<fullDescription>
    <intro>Insert long description here...</intro>
    
    
    <option name="short name of first option (like in the dialog)">description of first option</option>
    <option name="short name of second option (like in the dialog)">description of second option</option>
</fullDescription>

<ports>
    <outPort index="0" name="Out-Port name">Description of first output port...</outPort>
    <!-- possibly more output ports here-->
</ports>    
<views>
    <view index="0" name="name of first view">Description of first view...</view>
    <!--view index="1" name="name of second view">Description of second view...</view-->
</views>

?? don’t know how to past xml…

I had some XML in the short description… that was that problem

One more thing:
Where can I find output from System.err.println()???

Thanks

Bernd

found it. Its the console as expected, but before it was hidden by some other messages that flooded the screen…
Thanks
B