NodePit / knime-json-node-doc-generator

Generate KNIME node documentation as a structured JSON file.
GNU General Public License v3.0
6 stars 0 forks source link

ERROR main JsonNodeDocuGenerator Could not call getBundleName #38

Closed HaveF closed 8 months ago

HaveF commented 8 months ago

Hi, NodePit developers! ❤️

My environment is KNIME 5.2.2, I don't know if I messed up somewhere.

╰─$./knime -nosplash --launcher.suppressErrors -application de.philippkatz.knime.jsondocgen.application.JsonNodeDocumentationGenerator -destination docs_by_generator -plugin org.knime.expressions.base

CompileCommand: exclude javax/swing/text/GlyphView.getBreakSpot bool exclude = true
log4j:WARN No appenders could be found for logger (de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

...
...
...

ERROR    main JsonNodeDocuGenerator  Could not call getBundleName for org.knime.dynamic.js.v212.DynamicJSNodeFactory
java.lang.NoSuchMethodException: org.knime.dynamic.js.v212.DynamicJSNodeFactory.getBundleName()
    at java.base/java.lang.Class.getDeclaredMethod(Unknown Source)
    at de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.getBundleName(JsonNodeDocuGenerator.java:672)
    at de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.generate(JsonNodeDocuGenerator.java:419)
    at de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.generate(JsonNodeDocuGenerator.java:488)
    at de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.generate(JsonNodeDocuGenerator.java:488)
    at de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.generate(JsonNodeDocuGenerator.java:488)
    at de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.generate(JsonNodeDocuGenerator.java:488)
    at de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.generate(JsonNodeDocuGenerator.java:253)
    at de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.start(JsonNodeDocuGenerator.java:208)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
qqilihq commented 8 months ago

Hi HaveF,

nice to see that you're using our tool! The “error” log which you posted is actually meant to be more a “warning”. Our classification of logging it as error doesn't make much sense - it's meant to inform the user that we couldn't extract some information as desired, but the documentation should still be generated completely or successfully.

Can you confirm if you receive the desired data as output?

We will update the log output in the next update to be less alarming :-)

Best, P.

HaveF commented 8 months ago

@qqilihq hi, qq :-) I get nothing at the destination dir, even like this:

./knime -nosplash --launcher.suppressErrors -application de.philippkatz.knime.jsondocgen.application.JsonNodeDocumentationGenerator -destination docs_by_generato

I only got the above error message and nothing else. Still don't know if I messed up somewhere.

qqilihq commented 8 months ago

@danielesser Any idea if the configuration might be missing something?

@HaveF Could you post the complete log output here? Do you see any error message within a dialog? Is this a “fresh” KNIME installation or did you install any other extensions? If so, could you please retry with a clean KNIME installation with only the JSON generator installed? In whic OS and environment are you running this?

HaveF commented 8 months ago

I installed your new version of extension. And the error problem was located.

Mainly because of the destination parameter,

/Applications/KNIME\ 5.2.0.app/Contents/MacOS/knime -nosplash -application de.philippkatz.knime.jsondocgen.application.JsonNodeDocumentationGenerator -destination ~ -category /io

no problem.

/Applications/KNIME\ 5.2.0.app/Contents/MacOS/knime -nosplash -application de.philippkatz.knime.jsondocgen.application.JsonNodeDocumentationGenerator -destination ./docs_by_generator/ -category /io

and I get nothing. I have docs_by_generator dir already. There is no relevant error message.

I use MacOS 12.

qqilihq commented 8 months ago

I just gave this another try, I realized that in our NodePit crawler we supply some more parameters now - the readme seems outdated. Here's a more complete example which will also include logging output:

./knime \
  -nosplash \
  -data /path/to/temporary-workspace \
  --launcher.suppressErrors \
  -application de.philippkatz.knime.jsondocgen.application.JsonNodeDocumentationGenerator \
  -destination /path/to/node-docs \
  -category /io \
  -vmargs \
    -Dlog4j.debug=true \
    -Dlog4j.configuration=/path/to/log4j.xml \
    --add-opens=java.base/java.lang=ALL-UNNAMED \
    --add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
    --add-opens=java.base/java.net=ALL-UNNAMED \
    --add-opens=java.base/java.nio=ALL-UNNAMED \
    --add-opens=java.base/java.nio.channels=ALL-UNNAMED \
    --add-opens=java.base/java.util=ALL-UNNAMED \
    --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
    --add-opens=java.base/sun.nio=ALL-UNNAMED \
    --add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED \
    --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED

Use the following log4j.xml file for debug logging:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

  <appender name="console" class="org.apache.log4j.ConsoleAppender">
    <param name="Target" value="System.out"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d{HH:mm:ss.SSS} [%t] %-5p %c{1}:%L - %m%n"/>
    </layout>
  </appender>

  <root>
    <level value="DEBUG" />
    <appender-ref ref="console" />
  </root>

</log4j:configuration>

Let me know how that works please! If it still doesn't work then at least the log output should give some hints now :-)

HaveF commented 8 months ago

Thank you so much! With a complete log, it seems much more convenient. This should be a flaw in the program. If we use -destination docs_by_generator there is still no output JSON document. Judging from the log, there is no problem:

....
....
09:01:20.409 [main] DEBUG JsonNodeDocuGenerator:326 - Processing org.knime.core.node.port.AbstractSimplePortObject
09:01:20.409 [main] DEBUG JsonNodeDocuGenerator:326 - Processing org.knime.core.node.port.PortObject
09:01:20.410 [main] INFO  JsonNodeDocuGenerator:290 - Writing port types to docs_by_generator/portDocumentation.json
09:01:20.411 [main] DEBUG JsonNodeDocuGenerator:297 - Generating splash icons
09:01:20.422 [main] DEBUG JsonNodeDocuGenerator:300 - Found 4 splash icons
09:01:20.422 [main] INFO  JsonNodeDocuGenerator:303 - Writing splash icons to docs_by_generator/splashIcons.json

But I found that if I use the full path of docs_by_generator then the documentation will be generated without any problem. How awesome!

maybe we add some hints in the doc or cli?

Thanks for your help, again!(And your help in the forum ☕ ) @qqilihq

qqilihq commented 8 months ago

If we use -destination docs_by_generator there is still no output JSON document. Judging from the log, there is no problem:

Ahh, point taken. In this case the output is generated next to the knime executable, which doesn't make much sense.

For now, absolute paths (or using ~ to be expanded to absolute ones) must be used. I'll see if we can improve this or at least we will mention it in the documentation.

Thank you very much for your input!

HaveF commented 8 months ago

Ahh, point taken. In this case the output is generated next to the knime executable, which doesn't make much sense.

Aha, it turns out they are here, haha

qqilihq commented 8 months ago

@HaveF Thank you again for the feedback 👍 - we have improved the following things in v1.13.4 which I just pushed to the update site:

HaveF commented 8 months ago

@qqilihq Nice. thanks for this valuable tool!