How to override weblogic application libraries? - weblogic-10.x

I am developing a plugin for an application that is deployed in Weblogic 10.3.6. I need to use jersey 2.25 api in the plugin. The application ships jersey 1.8 in its APP-INF/lib folder. So, when I deploy the plugin the classes are all mixed up and throws class cast exception. I cannot modify the application. I have deployed the jersey 2.25 jars in DOMAIN_HOME/lib folder. Is there a way to use the new libraries instead of the supplied one in the application? If it is not possible can you suggest me any workaround to do so?

Do you deploy a share-lib which is based on jersey related jars. Remove that share lib. And try again, you may be success. But 10.3.6 don't support jersey 2.25.

Related

Bluemix Jersey 1.8 415 media error

In using bleumix liberty with jax-rs1.1 ( inclusive jersey 1.8)
But I get 415 errors media not supported when I use it.
It works on tomcat, but bluemix liberty gives an error.
Any thoughts
Regards
Marc
Liberty jax-rs 1.1 based on Apache Wink, not Jersey. Is your jax-rs implementation using wink? Verify you are providing a wink implementation. Also, remove all the wink jars from your war to avoid conflicts and use what's provided by Liberty. You can either remove them manually from the war WEB-INF/lib, or change your pom.xml and add <scope>provided</scope> for the wink dependencies so that they are not packaged with the war. If you want to use Jersey instead, you will have to disable jax-rs 1.1 by providing a customized server.xml feature set.
The Liberty for Java starter application shows a basic implementation example in src/com/ibm/cloudoe/samples/HelloResource

Upgrading jax-rs shared library on weblogic

Normally weblogic 12c doesnt support jax-rs 2.0 but by the help of jax-rs shared library which comes with weblogic itself it is possible to upgrade jax-rs version from 1.1 to 2.0. The problem is library implementation is jersey 2.5 which doesnt satisfy my needs. I found a link about upgrading jersey version on weblogic which looks a lil bit complex. Is it enough to replace jersey jars 2.5 with my jersey version 2.13? Do i need to do anything else?
I have created a simple maven project to produce the war file with the 2.19 jersey shared library for weblogic.
I have tested it with weblogic 12.1.3
You can clone from here weblogic-jax-rs
After cloning run mvn package to produce the war and then deploy it to the server.
Of course you must specify the new implementation version in your weblogic.xml which is now 2.19
If you are not familiar with maven you can download the war file from here
As of weblogic 12.2.1 - there is jersey 2.21.1 bundled with it so no additional installations are required.
weblogic 12.2.1.1 comes with jersey 2.22.1

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.

Using spring insight with an app that uses spring integration 1.0.4

I'm trying to deploy an existing app to tc-server. I have been using this app on tomcat for a couple of years and the production version already runs on tc-server. I have installed the version of tc-server that comes with spring insight. Everything goes well until I deploy a war file that has a dependency on spring integration. I'm getting a no class def found error and it is complaining about a class called
org/springframework/integration/transformer/AbstractMessageProcessingTransformer
I opened up the spring integration jar that is bundled with my war in the WEB-INF lib and did not see that class.
I poked around in the tomcat instance that I created with the bat files in tc-server and see a later version of spring-integration i.e.
.\insight\collection-plugins\insight-plugin-spring-integration-1.9.2.SR1.jar
Since my war is now getting a class not found exception (whereas it deploys fine on my normal tomcat 6.29 ) I'm assuming that this other version of spring-integration is being seen by my app somehow. My app is configured to use spring-integration-1.0.4.
Does anyone know how to get around this problem?
1.0.4 is an extremely old version (3+ years old) the current release is 2.2.4. That class was introduced in 2.0.0.
So you probably have a classpath issue - insight needs a more recent version of Spring Integration on the classpath.
The insight plugin version (1.9.2.x) is not related to the Spring Integration version (but it needs a much more recent version than 1.0.4).

How do I make JaxWsPortProxyFactoryBean use JAX-WS 2.1?

I'm working on a project that delivers web services using Jersey, which has a dependency on JAXB 2.1. I have to add a feature that fetches data from another web service. The way this has been implemented elsewhere uses a Spring JaxWsPortProxyFactoryBean.
When Spring tries to initialize this bean it fails with a : ClassCastException (com.sun.xml.bind.v2.runtime.JAXBContextImpl cannot be cast to com.sun.xml.bind.api.JAXBRIContext).
It appears that this is because JavaSE6 includes JAX-WS 2.0 API.
The only solution I have found suggests putting the 2.1 jars in the JRE endorsed directory. This isn't an option - I'm sharing a server with other application teams so I can't mess with the JRE.
Does anybody know of another way to make Spring use the 2.1 jars?

Resources