jsoliveira / javaapiforkml

Automatically exported from code.google.com/p/javaapiforkml
0 stars 0 forks source link

java.lang.NoClassDefFoundError: com/sun/xml/bind/marshaller/NamespacePrefixMapper #28

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The JAXB implementation bundled in JDK 1.6 (in its apple incarnation, at least) 
does not contain NamespacePrefixMapper.

It appears that de.micromata.opengis.kml.v_2_2_0.Kml.createMarshaller makes use 
of that class.

Depending on JAXB is perfectly ok, but depending on a particular implementation 
thereof does not make this library very usable... IMHO at least.

Original issue reported on code.google.com by giorgio....@geomercato.it on 14 Feb 2011 at 11:42

GoogleCodeExporter commented 8 years ago
The attached patch should solve the issue (preserving the nice namespace 
prefiexes).

Unit tests succede under JDK 1.6 (apple 64bit). 

Original comment by giorgio....@geomercato.it on 14 Feb 2011 at 2:55

Attachments:

GoogleCodeExporter commented 8 years ago
Where do i put this patch?

Original comment by andryw....@gmail.com on 4 Mar 2011 at 12:28

GoogleCodeExporter commented 8 years ago
On unixes:
$ patch -p0 < patch-file.diff 

Otherwise, I have no idea :)

Original comment by giorgio....@geomercato.it on 4 Mar 2011 at 1:12

GoogleCodeExporter commented 8 years ago
And how to do this in Eclipse on Windows?

Original comment by shers...@gmail.com on 18 Mar 2011 at 12:01

GoogleCodeExporter commented 8 years ago
You don't need to use a patch. Go to http://jaxb.java.net/, download the latest 
library (I used 2.2.4, which is JAXB2_20110512.jar). In Windows and Mac, just 
double-click the .jar file, and it will extract into a folder (for me 
JAXB2_20110512.jar, it extracted to jaxb-ri-20110512). In your Eclipse project, 
right-click your project, go to Properties->Java Build Path, click the Add 
External JARs... button, and finally select jaxb-ri-20110512/lib/jaxb-impl.jar. 
This should automatically add jaxb-api.jar, activation.jar, jsr173_1.0_api.jar, 
and jaxb1-impl.jar in addition to jaxb-impl.jar. Now there shouldn't be any 
more problems.

Original comment by jchan...@gmail.com on 16 May 2011 at 11:32

GoogleCodeExporter commented 8 years ago
I downloaded the  zip file from http://jaxb.java.net/ but it doesn't work with 
me when I double-click, so I had to download it manually as follows:
you need 2 jar files so it will work successfully.
1-jaxb-impl-2.2.jar
http://repository.jboss.org/maven2/sun-jaxb/jaxb-impl/2.2/
2-jaxb-xjc-2.2-sources.jar
http://repository.jboss.org/maven2/sun-jaxb/jaxb-xjc/2.2/

hope that will help.

Original comment by sara.ala...@gmail.com on 18 May 2011 at 8:31

GoogleCodeExporter commented 8 years ago
Thanks for the tips, only they need a small update

Those missing files (jaxb-impl and jaxb-xjc) can now be found at:
http://download.java.net/maven/2/com/sun/xml/bind/

kind regards,
Joey

Original comment by joeyvand...@gmail.com on 18 Jan 2012 at 9:27