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

taskdef class cannot be found #2

Open
super-structure opened this issue Oct 3, 2019 · 8 comments
Open

taskdef class cannot be found #2

super-structure opened this issue Oct 3, 2019 · 8 comments

Comments

@super-structure
Copy link

I'm have a problem getting this plugin to work in DITA-OT v3.3.4. I'm not entirely sure how to interpret the error other than perhaps the named class is missing from the xmltask.jar file?

The output from the build is simply:
clean.samples.html5:

 samples.html5:
 
 BUILD FAILED
 D:\DITA\DITA-OT_3.3.4\docsrc\samples\ant_sample\sample_html5.xml:10: The following error occurred while executing this line:
 D:\DITA\DITA-OT_3.3.4\build.xml:19: The following error occurred while executing this line:
 D:\DITA\DITA-OT_3.3.4\plugins\org.dita.base\build.xml:42: taskdef class com.oopsconsultancy.xmltask.ant.XmlTask cannot be found
  using the classloader AntClassLoader[D:\DITA\DITA-OT_3.3.4\lib\dost.jar;D:\DITA\DITA-OT_3.3.4\lib\dost-configuration.jar]

 Total time: 0 seconds

This is using a completely "clean" install of the DITA OT v3.3.4 and following the (rather straighforward) instructions in the Readme.md file. I'm using the following batch file script to initiate a build:

  SET JAVA_HOME=C:\Program Files (x86)\Java\jdk-13
  SET Path=%Path%;%JAVA_HOME%;D:\DITA\DITA-OT_3.3.4\bin
  bin/ant -f docsrc/samples/ant_sample/sample_html5.xml -l Build_Sample_HTML5.log
  EXIT /B

Is there something else I'm missing in order to get the xmltask plugin working? I've tried modifying the build.xml file to remove the classpath attribute from the taskdef (per the current documentation https://www.dita-ot.org/dev/topics/plugin-javalib.html) but that has no effect on the error. Thanks.

-Jason

@saprentice
Copy link

Were you ever able to get this to work? We have a plugin that has been using xmltask for years, and now it's broken when I try to build through Oxygen 25 (exact same OT and plugins works fine in Oxygen 23, apparently a Java environment incompatibility). If I replace the older xmltask.jar with the JAR from org.doctales.xmltask the build succeeds. But I can't figure out how to integrate it using the installed org.doctales.xmltask plugin.

I guess I'm okay just dropping in the updated JAR file, but it would be nice to see how this is supposed to work using the plugin.

After adding the to my plugin's plugin.xml file, I assume that I need to include in the ant script that uses .

<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" />

Should that include a classpath or classpathref that points to the lib folder in org.doctales.xmltask, or is there some other way to instantiate the xmltask object?

cc/ @super-structure @jason-fox @xephon2

@stefan-jung
Copy link
Owner

@saprentice @super-structure, the only thing that you should need to do is a pure

dita --install https://github.com/doctales/org.doctales.xmltask/archive/master.zip

As you can see in the plugin.xml the library is integrated to the toolkit via the dita.conductor.lib.import extension point. The <taskdef> is automatically slurped in via the dita.conductor.target.relative extension point.

@stefan-jung
Copy link
Owner

Afterwards you should be able to do what is explained in the oops docs.

@stefan-jung
Copy link
Owner

@saprentice and @super-structure, please confirm that this works now. I have updated the library 5 months ago. But is should work as normal.

@stefan-jung
Copy link
Owner

@super-structure use the dita command, not the Ant script of the DITA-OT. The dita command loads all jars for you and has more convenience features.

@saprentice
Copy link

@xephon2 .. thanks for the quick reply! I'll try the install again. I copied the org.doctales.xmltask folder into the plugins folder then ran dita install. It reported installing the plugin, but xmltask didn't seem to be available. Will try installing from the ZIP .. although I'd hope that isn't any different. Will let you know what I see.

@stefan-jung
Copy link
Owner

@saprentice please publish with the dita command also. Please share the build log. Activate verbose mode.

@saprentice
Copy link

@xephon2 .. sorry, can't do that. Client confidentiality, blah, blah, blah. But I will sanitize and post what I can. May be next week before I can get back to this. Thanks!

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

No branches or pull requests

3 participants