cannot access javax.ws.rs.ext.MessageBodyReader while using JacksonJsonProvider.setMapper - spring

Im facing cannot access javax.ws.rs.ext.MessageBodyReader while upgrading to spring 6.
Im using glassfish jersey 3.1.0 for REST services in spring 6 application and com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider 2.14.1.
Im facing this compilation error while calling JacksonJsonProvider.setMapper()
i cant able to figure out how to solve this issue.

I have solved this issue by replacing
com.fasterxml.jackson.jaxrs
jackson-jaxrs-json-provider
with
com.fasterxml.jackson.jakarta.rs
jackson-jakarta-rs-json-provider

Related

wiremock issue when upgrading to Spring Boot 3

When upgrading my Spring Boot 2.5 to 3.0 , I am facing some issues with Wiremock, probably due to the move to jakarta namespace. Even upgrading to latest wiremock-jre8 , ie 2.35.0 (as of december 2022) doesn't seem to help. I get this error :
java.lang.NoClassDefFoundError: javax/servlet/DispatcherType
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.getServerConstructor(JettyHttpServerFactory.java:37)
at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.<clinit>(JettyHttpServerFactory.java:30)
Looks like this is a know issue related to jakarta namespace and Jetty 11 support, that will take a while to get properly fixed :
https://github.com/wiremock/wiremock/issues/1760
As indicated in the issue, using wiremock-jre8-standalone instead of wiremock-jre8 helps working around the issue, until it gets properly fixed in Wiremock 3.x
E.g. Wiremock version 1.58 works (if you don't mind using an older version) in combination with Spring Boot 3

Spring LDAP core not compatibile with Spring 5?

I'm developing a Java Web Application with Spring 5 (not Spring Boot) and I'm facing a problem with the library spring-ladp-core (2.3.2.RELEASE).
I get this error:
java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.accessibleConstructor(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:155)
and I can't understand exactly what's the problem, maybe a dependencies version problem but I don't know how to solve it. I mean the spring-ldap-core is no more updated since 2017 so is it outdated? Is supposed no longer be used?
I need to build an authentication mechanism with Spring security and LDAP, is the spring-security-ldap library the correct way to implement this?
I have an "old" project with Spring 4 and spring-ldap-core and it works fine, is spring-ldap-core no more compatibile with recent versions of Spring (Spring > 4)?
Thanks.

does spring security jars have dependency on java version?

I was using spring secuirty jars with version 4.1.0 and spring version 4.2.6 with java 7 and the code was working fine.
But when I shifted my code to java 1.6(due to some internal policies) and it stopped working. the frontEnd code is not even hitting the middle tier.
Also I am not getting any compile time or startup error in logs?
Any help around this, is highly appreciated.
Thanks

Jersey and Spring integration

I am developing a Jersey RESTful service using the Spring framework integration with Hibernate. I get a NoSuchMethodException on a org.jboss.logging.logger.debugf call. As I noticed, the class is indeed loaded from the bean-validator.jar included alongside the jersey-spring3 library, eventhough I have specifically referenced the jboss logging artifact.
Has anyone encountered this issue? And if so, how should I solve it?
Update
I have found a workaround, but it is far from being a solution. In order for the required classes to have the same signature, I have downgraded the hibernate-entitymanager to version 4.2.8.Final. However, this leads the way to other compatibility issues.
Update 2
In the end, I have chosen to implement the REST service functionality using the Spring Framework instead of using the aforementioned integration.
Check out the answers in the following post, your issue might be similar:
Error "java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger"

Spring 3 xml parser issue -XSDException

I have a web application where i am using spring 3.0 rest mvc .The application runs perfectly fine on my local machine. But when in deploy the war in server(tomcat 6 & java 5) the below error occurs
Caused by: oracle.xml.parser.schema.XSDException: Duplicated
definition for: 'identifiedType'
I Googled and found that this issue is related to xmlparserv2.jar and this issue can be fixed by forcing the app to use apache xerces jars.
But i have not found any link explaining how to solve this issue.I do not want to changes at server level.
Can we fix these issues at application level?
Thanks in advance
My issue got resolved by including the xerces jars in the POm file

Resources