Missing dependency to xalan-serializer?

2,851 views
Skip to first unread message

Nebelmann

unread,
Jun 5, 2012, 11:21:03 AM6/5/12
to docbkx-to...@googlegroups.com
Hello everyone,

I started playing with DocBook today and tried to transform my XML file into a PDF using docbkx-maven-plugin 2.0.14. I have a problem when I run a maven build:

Caused by: java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:821)
at com.agilejava.docbkx.maven.AbstractFoMojo.postProcessResult(AbstractFoMojo.java:145)
at com.agilejava.docbkx.maven.AbstractTransformerMojo.execute(AbstractTransformerMojo.java:166)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
Caused by: java.lang.ClassNotFoundException: org.apache.xml.serializer.TreeWalker
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 24 more

I googled this class and it seems that it's not contained in the xalan artifact but in the xalan-serializer artifact. Adding an extra dependency to the plugin works:

            <plugin>
                <groupId>com.agilejava.docbkx</groupId>
                <artifactId>docbkx-maven-plugin</artifactId>
                <version>2.0.14</version>

                <executions>
                    <execution>
                        <goals>
                            <goal>generate-pdf</goal>
                        </goals>
                        <phase>pre-site</phase>
                        <configuration>
                            <includes>myfile.xml</includes>
                        </configuration>
                    </execution>
                </executions>

                <configuration>
                    <paperType>A4</paperType>
                    <foCustomization>src/docbkx/docbook-fo.xsl</foCustomization>
                </configuration>

                <dependencies>
                    <dependency>
                        <groupId>net.sf.docbook</groupId>
                        <artifactId>docbook-xml</artifactId>
                        <version>5.0-all</version>
                        <classifier>resources</classifier>
                        <type>zip</type>
                        <scope>runtime</scope>
                    </dependency>

                    <dependency>
                        <groupId>xalan</groupId>
                        <artifactId>xalan-serializer</artifactId>
                        <version>2.7.0</version>
                        <scope>runtime</scope>
                    </dependency>
                </dependencies>
            </plugin>

Has anyone faced the same problem? Is it something missing from the maven plugin?

Thanks for your help.

Mimil

unread,
Jun 7, 2012, 12:05:58 PM6/7/12
to docbkx-to...@googlegroups.com
Hello,

We never had issues about that but I will add the dependency, that way the issue will go away in any case.

Cedric,
--
You received this message because you are subscribed to the Google Groups "Docbkx Tools Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/docbkx-tools-users/-/yj-51nV-360J.
To post to this group, send email to docbkx-to...@googlegroups.com.
To unsubscribe from this group, send email to docbkx-tools-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/docbkx-tools-users?hl=en.

Nebelmann

unread,
Jun 8, 2012, 7:17:48 AM6/8/12
to docbkx-to...@googlegroups.com
Thanks. Perhaps the dependency was already in your classpath thanks to another dependency?


On Thursday, June 7, 2012 6:05:58 PM UTC+2, Mimi...@gmail.com wrote:
Hello,

We never had issues about that but I will add the dependency, that way the issue will go away in any case.

Cedric,
To post to this group, send email to docbkx-tools-users@googlegroups.com.
To unsubscribe from this group, send email to docbkx-tools-users+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages