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

Taglet blocks javadoc generation with ClassNotFoundException #19

Open
jeremydouglass opened this issue Sep 20, 2018 · 4 comments

Comments

@jeremydouglass
Copy link
Contributor

commented Sep 20, 2018

When I run the Processing template targeting Java SE-1.8, the

[javadoc] Constructing Javadoc information...
[javadoc] Standard Doclet version 10.0.1
[javadoc] Building tree for all the packages and classes...
[javadoc] javadoc: error - Error - Exception java.lang.ClassNotFoundException thrown while trying to register Taglet ExampleTaglet...

In the Processing Library template there is a file

resources > code > ExampleTaglet.java

It begins with

import com.sun.tools.doclets.Taglet;

I think that in Java 8+ that would instead would be:

import java.jdk.Taglet;

...I'm not sure if there are other changes that would need to be made.

I am not familiar with doclets and Taglets -- looking over the code, it isn't clear to me why ExampleTaglet would actually be used -- although is referenced in Ant's build.xml:

<taglet name="ExampleTaglet" path="resources/code" />

Anyway, when it fails the documentation as a whole fails to build.

Assuming this is a problem for others, it seems like either ExampleTaglet should be fixed or it should be removed from build.xml to not block javadoc generation.

My solution was to remove the above line from build.xml.

@prisonerjohn

This comment has been minimized.

Copy link
Member

commented Nov 16, 2018

The ExampleTaglet is used to allow the use of @example tags in the javadocs for the class. The HelloLibrary class uses this, and when it's successful you'll notice that the contents of the Hello.pde example are included at the top of the javadoc for that class.

I just tested an Ant build in IntelliJ targeting Java 1.8 and it worked as expected (with no changes). Note that you need to keep the ExampleTaglet.class file in the code folder.

@jeremydouglass Can you give me more details on your environment so I can try to see why it failed for you?

@federico-pepe

This comment has been minimized.

Copy link

commented Sep 6, 2019

I'm developing a Processing Library for the first time and I got this problem too while generating the javadoc. Everything works correctly but the docs aren't created automatically.

 [javadoc] Generating Javadoc
  [javadoc] Javadoc execution
  [javadoc] Loading source file /Users/federicopepe/GitHub/nice-color-palettes/tmp/NiceColorPalettes/src/nice/palettes/ColorPalette.java...
  [javadoc] Constructing Javadoc information...
  [javadoc] 1 error
  [javadoc] javadoc: error - An internal exception has occurred. 
  [javadoc] 	(java.lang.NoClassDefFoundError: com/sun/tools/doclets/Taglet)
  [javadoc] Please file a bug against the javadoc tool via the Java bug reporting page
  [javadoc] (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com)
  [javadoc] for duplicates. Include error messages and the following diagnostic in your report. Thank you.
  [javadoc] java.lang.NoClassDefFoundError: com/sun/tools/doclets/Taglet
  [javadoc] 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
  [javadoc] 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
  [javadoc] 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
  [javadoc] 	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
  [javadoc] 	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
  [javadoc] 	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
  [javadoc] 	at java.base/java.security.AccessController.doPrivileged(Native Method)
  [javadoc] 	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
  [javadoc] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
  [javadoc] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.taglets.TagletManager.addCustomTag(TagletManager.java:229)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.initTagletManager(BaseConfiguration.java:837)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.finishOptionSettings0(BaseConfiguration.java:777)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration.finishOptionSettings0(HtmlConfiguration.java:861)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.setOptions(BaseConfiguration.java:798)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:200)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.doclets.toolkit.AbstractDoclet.run(AbstractDoclet.java:114)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.doclet.StandardDoclet.run(StandardDoclet.java:72)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:582)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:431)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:344)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
  [javadoc] 	at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
  [javadoc] Caused by: java.lang.ClassNotFoundException: com.sun.tools.doclets.Taglet
  [javadoc] 	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
  [javadoc] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
  [javadoc] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  [javadoc] 	... 23 more
@jeremydouglass

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2019

@jeremydouglass Can you give me more details on your environment so I can try to see why it failed for you?

I was using Eclipse 4(.8?) on OS X 10.12.

I believe the issue may have been (?) that I had JDK 10 and was using it to target 8. This largely works, except when it doesn't.

Possibly related: #20

@jeremydouglass

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.