hyperjaxb3 icon indicating copy to clipboard operation
hyperjaxb3 copied to clipboard

Support for Java 11

Open lgwozniak opened this issue 6 years ago • 7 comments

does the project support java 11 i have a problem with configuration. I'm running Spring 5.1.3 and Hibernate 5.3.7

Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 13 counts of IllegalAnnotationExceptions at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check (IllegalAnnotationsException.java:106) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet (JAXBContextImpl.java:471) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init> (JAXBContextImpl.java:303) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init> (JAXBContextImpl.java:139) at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build (JAXBContextImpl.java:1156) at com.sun.xml.bind.v2.ContextFactory.createContext (ContextFactory.java:165) at com.sun.xml.bind.v2.ContextFactory.createContext (ContextFactory.java:289) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

One of this 13 elements:

Two classes have the same XML type name "entity". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at com.sun.java.xml.ns.persistence.orm.Entity at protected java.util.List com.sun.java.xml.ns.persistence.orm.EntityMappings.entity at com.sun.java.xml.ns.persistence.orm.EntityMappings at public com.sun.java.xml.ns.persistence.orm.EntityMappings com.sun.java.xml.ns.persistence.orm.ObjectFactory.createEntityMappings() at com.sun.java.xml.ns.persistence.orm.ObjectFactory this problem is related to the following location: at org.jvnet.hyperjaxb3.ejb.schemas.customizations.Entity at protected org.jvnet.hyperjaxb3.ejb.schemas.customizations.Entity org.jvnet.hyperjaxb3.ejb.schemas.customizations.Persistence.defaultEntity at org.jvnet.hyperjaxb3.ejb.schemas.customizations.Persistence at public javax.xml.bind.JAXBElement org.jvnet.hyperjaxb3.ejb.schemas.customizations.ObjectFactory.createPersistence(org.jvnet.hyperjaxb3.ejb.schemas.customizations.Persistence) at org.jvnet.hyperjaxb3.ejb.schemas.customizations.ObjectFactory

I found that one of them is in package hyperjaxb3-ejb-schema-customizations and secodn in hyperjaxb3-ejb-schema-persistance. My configuration is below:

            <groupId>org.jvnet.hyperjaxb3</groupId>
            <artifactId>maven-hyperjaxb3-plugin</artifactId>
            <version>0.6.1</version>
            <executions>
                <execution>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <dependencies>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-impl</artifactId>
                        <version>2.4.0-b180830.0438</version>
                    </dependency>
                <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-xjc</artifactId>
                        <version>2.4.0-b180830.0438</version>
                    </dependency>
                <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-core</artifactId>
                        <version>2.3.0.1</version>
                    </dependency>
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>2.4.0-b180830.0359</version>
                </dependency>
            </dependencies>
            <configuration>
                <extension>true</extension>
                <removeOldOutput>true</removeOldOutput>
                <verbose>true</verbose>
                <readOnly>true</readOnly>
            </configuration>
        </plugin>

lgwozniak avatar Jan 02 '19 12:01 lgwozniak

Java 11 is not yet supported.

highsource avatar Jan 02 '19 13:01 highsource

Are there plans to be supported ? Or is there any workaround ?

lgwozniak avatar Jan 02 '19 13:01 lgwozniak

There's no workaround. No specific plans but this will be implemented - eventually. The plugins should be basically rebuilt with the latest version of maven-jaxb2-plugin.

highsource avatar Jan 02 '19 14:01 highsource

Any chance to complete this issue? Or maybe there is any alternative library work on the java 11?

lgwozniak avatar Oct 08 '19 10:10 lgwozniak

Not really a good workaround, but did get it working by using multiple jdk:s in the toolchain. Then you can use JDK8 for hyperjaxb3 plugin but JDK11 for compile/test.

Reference https://github.com/Hack23/cia/blob/cia-all-2019.2.23/parent-pom/pom.xml .

pethers avatar Oct 08 '19 10:10 pethers

Hello, have support for Java 11 been added?

MarErm27 avatar Mar 21 '22 10:03 MarErm27

Version 2.1.0 of the HiSrc HyperJAXB fork is a updated release. The source/target (release) compatibility is at Java 11, up from Java 8. And, JDK 17 is used for the build.

patrodyne avatar May 01 '23 23:05 patrodyne

Hello, have support for Java 11 been added?

@MarErm27 : hyperjaxb3 was migrated into jaxb-tools and supports JDK8 to JDK21 (and also jakarta support)

laurentschoelens avatar Jul 24 '24 13:07 laurentschoelens