Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR main JsonNodeDocuGenerator Could not call getBundleName #38

Closed
HaveF opened this issue Mar 17, 2024 · 10 comments · Fixed by #39
Closed

ERROR main JsonNodeDocuGenerator Could not call getBundleName #38

HaveF opened this issue Mar 17, 2024 · 10 comments · Fixed by #39

Comments

@HaveF
Copy link

HaveF commented Mar 17, 2024

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
Copy link
Member

qqilihq commented Mar 18, 2024

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.

qqilihq added a commit that referenced this issue Mar 18, 2024
* there's nothing we can do about these exceptions, anyways, and they are treated as graceful as possible, so `error` doesn't make sense
* shorten log output and remove stacktrace
* closes #38
qqilihq added a commit that referenced this issue Mar 18, 2024
* there's nothing we can do about these exceptions, anyways, and they are treated as graceful as possible, so `error` doesn't make sense
* shorten log output and remove stacktrace
* closes #38
@HaveF
Copy link
Author

HaveF commented Mar 18, 2024

@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 qqilihq reopened this Mar 18, 2024
@qqilihq
Copy link
Member

qqilihq commented Mar 18, 2024

@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
Copy link
Author

HaveF commented Mar 18, 2024

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
Copy link
Member

qqilihq commented Mar 18, 2024

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
Copy link
Author

HaveF commented Mar 19, 2024

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
Copy link
Member

qqilihq commented Mar 19, 2024

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
Copy link
Author

HaveF commented Mar 19, 2024

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
Copy link
Member

qqilihq commented Mar 20, 2024

@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:

  • Enable logging output per default (the manual log4j setup is no longer needed)
  • Clarified the readme and help output regarding the output path

@HaveF
Copy link
Author

HaveF commented Mar 20, 2024

@qqilihq Nice. thanks for this valuable tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants