Hello,
I'm trying to get jersey 2 and spring 4 working together (under Glassfish
4.1).
I'm using following dependency:
<dependency>
<groupId>org.glassfish.jersey.ext</groupId>
<artifactId>jersey-spring3</artifactId>
<version>2.21</version>
</dependency>
After starting application I've got following error:
ava.lang.ClassCastException: Cannot cast
org.glassfish.jersey.jaxb.internal.JaxbAutoDiscoverable to
org.glassfish.jersey.internal.spi.ForcedAutoDiscoverable
at java.lang.Class.cast(Class.java:3369)
at
org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:710)
at
org.glassfish.jersey.internal.ServiceFinder.toArray(ServiceFinder.java:395)
After several hours of googling and playing with exclusions I've provided
following one:
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-jaxb</artifactId>
<version>2.21</version>
<scope>provided</scope>
</dependency>
But then I've got WadlAutoDiscoverable vs ForcedAutoDiscoverable missmatch:
org.apache.catalina.LifecycleException: java.lang.ClassCastException:
Cannot cast org.glassfish.jersey.server.wadl.internal.WadlAutoDiscoverable
to org.glassfish.jersey.internal.spi.ForcedAutoDiscoverable
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at
org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
Please advise.