Tuesday, November 11, 2008

Using cxf-codegen-plugin on AIX

Have you ever seen this message while using cxf-codegen-plugin on AIX?
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] com.sun.org.apache.xerces.internal.impl.dv.DVFactoryException: 
DTD factory class com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl 
does not extend from DTDDVFactory.
The solution to this problem is easy, just add the
following to your project's pom file where you declare
use of the
cxf-codegen-plugin:

<plugin>
 <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-codegen-plugin</artifactId>
   <version>${cxf.version}</version>
    <dependencies>
     <!-- need to add this to get around the following error on
IBM's
JDK org.apache.xerces.impl.dv.DVFactoryException: DTD factory
class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend
from
DTDDVFactory.
     -->
     <dependency>
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>    
      <version>2.8.1</version>
     </dependency>
    </dependencies>
</plugin> 

This is another case of the small differences in the IBM
JDK and Sun SDK. In code that is expected to run on
multiple target platforms I would place this dependency
in a profile set to activate on detection of an IBM
JDK.
Cheers,

No comments: