Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
JaxbMarshaller scan should skip annotated interfaces [SPR-13221] #17812
Spring JAXB marshaller (
Problems is when package is being scanned used
So if you generating client from WSDL - webservice interface will have an anotation
Whis annotatio leads to the error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'marshaller' defined in class path resource [application.xml]: Invocation of init method failed; nested exception is org.springframework.oxm.UncategorizedMappingException: Unknown JAXB exception; nested exception is com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions org.cynic.test.client.Service is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at org.cynic.test.client.Service
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="packagesToScan" value="org.cynic.test.client"/> </bean> </beans>
The only dirty fix is to downgrade JAXB binding version from 2.1 to 2.0
Solution should be following:
I can create pull request (after discussion).
Referenced from: commits 18c4671