Jersey WAS9 not able to depoy - jersey

I am trying to deploy my web application on WAS9 with JDK 1.8 , however it gives a error of CDI
Below is the error
java.lang.RuntimeException: com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound. Object type is com.sun.jersey.server.impl.cdi.CDIExtension.
at com.sun.jersey.server.impl.cdi.CDIExtension.initialize(CDIExtension.java:196)
I removed Jersey 1.X version from war , but still this error.
In my local it work good with tomcat and same other application runs good in WAS 8

Related

NullPointerException When Upgrading From Spring Boot 2.5.6 to 2.6.2 - Incompatibility With Wildfly

We are upgrading a Spring Boot App deployed on Wildfly from Spring Boot 2.5.6 to 2.6.2. The majority of the app is working fine. However, we see the following stack trace on several URL's. One example is the CXF page listing web services which worked fine on Spring Boot 2.5.6.
2022-01-12 08:02:08,130 ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] (default task-2) Forwarding to error page from request [/webservices] due to exception [HandlerMapping exception not suppressed]: java.lang.IllegalStateException: HandlerMapping exception not suppressed
at org.springframework.web.servlet.handler.HandlerMappingIntrospector.doWithMatchingMappingIgnoringException(HandlerMappingIntrospector.java:220)
at org.springframework.web.servlet.handler.HandlerMappingIntrospector.getCorsConfiguration(HandlerMappingIntrospector.java:161)
at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:86)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
....
Caused by: java.lang.NullPointerException
at io.undertow.servlet#2.0.27.Final//io.undertow.servlet.spec.HttpServletRequestImpl.getHttpServletMapping(HttpServletRequestImpl.java:250)
I set the CXF libraries to be the same at the previous version. I was wondering if people were seeing similar issues and what is the source of the difference.
UPDATE #1
I researched further and found what appears to be come incompatibility between Spring web classes and the implementation within Undertow packaged with Wildfly. I tried several Wildfly version with the following results:
Wildfly 18.0.1 : NullPointerException shown above
Wildfly 23.0.2 : NullPointerException shown above
Wildfly 24.0.1 : no issues
Wildfly 26.0.0 : no issues
Redhat EAP 7.4 : NullPointerException shown above
I further researched by exchanging the Undertow versions under the modules folder.
Wildfly 18.0.1 / Undertow 2.0.27.Final : NullPointerException
Wildfly 23.0.2 / Undertow 2.2.5.Final : NullPointerException
Wildfly 24.0.1 / Undertow 2.2.8.Final : no issues
Wildfly 26.0.0 / Undertow 2.2.14.Final : no issues
Redhat EAP 7.4 / Undertow 2.2.5.Final-redhat-00001 : NullPointerException
If I move undertow files under /modules folder for Wildfly 24.0.1 to Wildfly 23.0.2 or Redhat EAP 7.4, the system deploys and runs with no issues when I access the url.So it appears the issue was addressed in Undertow between 2.2.5 and 2.2.8.
So it appears that our clients are limited on upgrading their systems. Especially our clients who utilize Redhat EAP version, they will have to wait for an update.
UPDATE #2
After looking at the release notes for Undertow, the problem appears to be https://issues.redhat.com/browse/UNDERTOW-1866

ERROR The requested URL could not be retrieved after deploying in external tomcat server

I am using Spring boot to create a REST API. The API is perfectly working when I am running the project. It works for all the endpoints that I have created. However, When I deploy the application in an external tomcat I am shown an error just like the following image
But The same endpoint was working before getting deployed into tomcat.
I am unable to figure out where the problem lies. I am using
Java 8, Oracle 12C, tomcat 8.5 .
Same Problem when I used Tomcat 10
I found the issue. I accidentally forgot to mention the war file/application name which must be added.

Running Spring boot application in IntelliJ gives white label error

I am trying to run Spring boot web application in IntelliJ which gives me whitelabel error. However, I am able to run the application with eclipse and also external tomcat server.
I have the context mapping available where it is returned from the application but webpage always shows WhiteLabel Error 404.
Please suggest how does the same application works in eclipse and external tomcat but not with IntelliJ.
I am using IntelliJ community edition v 2020.2.3
web pages are available in webapp folder.
First download xammp server to your machine. Then run your spring boot application. I used this method to run my spring boot application. But keep in mind that IntelliJ community doesn't directly support to spring-boot. You have to use IntelliJ ultimate for that.

Deploying Jersey JAX-RS 1.1 application on WAS 9.0

I'm trying to deploy App bundled with Jersey 1.17.1 on WAS 9.0 and getting the CDIRuntimeException
java.lang.RuntimeException: com.ibm.ws.cdi.CDIRuntimeException: com.ibm.ws.cdi.CDIDeploymentRuntimeException: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
java.lang.RuntimeException: com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound. Object type is com.sun.jersey.server.impl.cdi.CDIExtension.
at com.sun.jersey.server.impl.cdi.CDIExtension.initialize(CDIExtension.java:196)
I tried this already without success from the link below i.e.
com.ibm.websphere.jaxrs.server.DisableIBMJAXRSEngine=true
Applications > WebSphere Enterprise Applications > {your.application} > Manage Modules > {your.module}, Change the Class loader order dropdown to: Classes loaded with local class loader first (parent last).
JAX-RS Jersey 2.10 support in Websphere 8
My goal is to use the war file as is with the bundled Jersey jars without having to create shared libraries. We are able to run this app on WAS 8.5.5 Is this not possible on WAS 9.0?
Thanks.

Can Spring Boot + Gradle generate a war file compatible with Servlet 2.4?

I've been reading about using Spring Boot and Gradle to quickly build RESTful services: https://spring.io/guides/gs/rest-service/. I'd like to give it a try but I need to build a war that's compatible with servlet 2.4 (I know.. life in the 1970's).
The error I get when attempting to deploy the war generated by following the guide above to Sun App Server 8.1 is:
Unknown deployable object type specified: "Cannot determine the J2EE
component type"
The generated war has no web.xml and there may be other expected artifacts.
Configuring a spring-boot application using web.xml seems to suggest that a web.xml can be packaged with a Spring Boot application but doesn't explain how.
Is Spring Boot compatible with older servlet specs? How can Spring Boot and Gradle be used to generate a war that works on older web containers?
Thanks.
The answer to the question you linked to didn't actually go as far as saying that you could easily create a fully-leaded Boot application with Servlet 2.4. I consider that quite a hard, but probably achievable, target if you are prepared to do some legwork, and accept some compromises. You might find this stuff useful: https://github.com/scratches/spring-boot-legacy (I managed to use it to push an app to GAE). But there are some limits to what can be supported for such old technology, and we aren't officially supporting anything other than Servlet 3.0.1 right now.

Resources