views:

176

answers:

1

I am trying to run the eBaySDK (Java) on Windows, but I kept on getting the error:

com.ebay.sdk.SdkException: com.sun.org.apache.xerces.internal.dom.DocumentImpl

Now, when I tried to run the same sample code included in the eBay SDK on Linux (ubuntu), it ran perfectly. Without any changes in the code.


So, when I looked back in the build.xml file's classpath in my windows:

  <property name="jaxws.lib.home" value="${basedir}/../../externalLib/jaxws-ri-2.1.4/"/>
  <property name="apache.lib.home" value="${basedir}/../../externalLib/apache"/>
  <property name="dest" value="classes.ant"/>
  <property name="ebaysdklib.home" value="../../lib"/>
  <property name="src" value="src"/>
    <path id="run.classpath">
          <pathelement location="${jdk.home}/lib/tools.jar"/>
          <pathelement path="${dest}"/>
          <fileset dir="${jaxws.lib.home}">
              <include name="*.jar"/>            
          </fileset>
          <fileset dir="${apache.lib.home}">
            <include name="*.jar"/>            
          </fileset>
          <fileset dir="${ebaysdklib.home}">
            <include name="*.jar"/>
          </fileset>    
    </path>

So, I added jaxp in the classpath:

  <property name="jaxp.lib.home" value="${basedir}/../../externalLib/jaxp-1.4.2"/>
   ...............
   <fileset dir="${jaxp.lib.home}">
   <include name="*.jar"/>
   </fileset>

And it worked like a charm in windows too.

So, why is there a difference in behavior in the ANT file when I run it on Windows (where I had to add JAXP in the classpath) and in Linux (where it works file wihtout JAXP in the classpath of ANT file.)

Thanks


UPDATE 1

Java versions:

Ubuntu - java-6-sun-1.6.0.20

Windows - java6-ibm

But does that matter? if yes, then How?

+3  A: 

I think it's just a question of how ant has been packaged on Ubuntu - the Ubuntu version of Ant comes with Jaxp pre-installed (ant has a dependency on libjaxp-java ). So, jaxp is on the classpath already.

If you were to install ant manually instead on Ubuntu, I think you'd find the same issue as you did with Windows.

amir75
And the ANT for windows does not need jaxb libraries and it does not have it?
zengr
and I checked it, it needs libxerces2-java as a dependency.
zengr