tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Error With JaxB when working with libTiled

Open independence106 opened this issue 2 years ago • 4 comments

Feb 18, 2022 1:32:03 PM org.mapeditor.io.MapReader unmarshal SEVERE: null javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.

I'm using the libTiled TMXViewer Example and getting this error.

What's happening ?'

[EDIT] Ok, I fixed some errors with dependencies but I still get "Implementation of JAXB-API has not been found on module path or classpath."

I am using 'javax.xml.bind', and 'org.glassfish.jaxb'

[More EDITS] when running with maven, " Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.14.0:generate (default) on project libtiled: Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.14.0:generate failed: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "com.sun.xml.bind.v2.runtime.reflect.opt.Injector.defineClass" is null "

independence106 avatar Feb 18 '22 21:02 independence106

I have the same problem after migration to new hibernate version 6.

khasanovbi avatar May 08 '22 08:05 khasanovbi

@khasanovbi A few people have tried to find a solution for this but no solution has been found so far as far as I know. There is a bit more information at issue #3284. Any help resolving this would be really appreciated!

bjorn avatar May 09 '22 10:05 bjorn

My problem is dependency conflicts. hibernate 6 has jaxb version 3. libtiled has jaxb version 2. Maven implicitly takes a new one. I tried to fixate jaxb 2 in my pom.xml, but this break hibernate) Maybe we could migrate just for new version of jaxb? But this is not a perfect solution, because it could break some other packages that use old jaxb. I'm not a big java expert, but maybe this can still be solved somehow through ClassLoaders and a multiple jaxb dependencies.

khasanovbi avatar May 09 '22 10:05 khasanovbi

Maybe we could migrate just for new version of jaxb? But this is not a perfect solution, because it could break some other packages that use old jaxb.

I don't know what it could break, but first of all, what would be required to migratie libtiled-java to a newer jaxb?

bjorn avatar May 09 '22 11:05 bjorn