Override Spring jar in Weblogic 12c - spring

We have been facing an issue while overriding the Spring jar in Weblogic 12c. Basically we need to write a bean based on some 3rd party API calling their interfaces. Now they use Spring 2.5 jar for their own implementation. Since Weblogic inherently supports Spring 3.0 jar. As a result when we write our bean wrapping their interfaces and deploy it, it doesn't work. We replicated the issue by replacing Spring 2.5 jar with Spring 3 in local environment.
If we modify the server classpath to load the Spring 2.5 jar (preceding Spring 3.0), entire soa-infra application goes down, so what We wanted to know if it is possible to override the Spring jar only for our application itself? While loading the application it will override the Spring 3.0 jar with Spring 2.5 in the application context but server will keep using Spring 3.0?
Any ideas/suggestions highly appreciated!
Thanks,
Bhaskar

Try using prefer-application-packages in your weblogic.xml file.
<container-descriptor>
<prefer-application-packages>
<package-name>org.springframework</package-name>
<prefer-application-packages>
</container-descriptor>

Related

How to replace Spring custom configurations with the new JBossWS descriptor configuration in JBoss 7.4?

While upgrading JBoss server from 6 to 7.4, I got to know that Spring integration is no longer supported in JBoss EAP 7. But in my project we have used Apache CXF dependency injection to provide WS endpoints. But as spring integration is no longer supported, I need to replace Spring custom configurations with the new JBossWS descriptor configuration but I got no references anywhere.
This approach is specified in below URL at point no: 5.1.2
APPLICATION MIGRATION CHANGES
Can somebody help me with this migration?
I tried by removing servlet dependency from web.xml and it was working but then I WS endpoints stopped working as I removed the dependency injection. PFA for reference

Spring boot - unable to use web.xml with WAR deployment

I am not able to use web.xml with spring boot in war deployment.
I am aware that there are ways of converting web.xml using #Configuration, but I must stick with web.xml for now. I was following the official document, here: http://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html#howto-create-a-deployable-war-file-for-older-containers
I was able to deploy my application in WAR file, but it was not using web.xml.
Maybe I am not following the step 85.2 correctly, as I am not sure what it means by "load an applicationContext via a DispatcherServlet":
85.2 Create a deployable war file for older servlet containers
Older Servlet containers don’t have support for the
ServletContextInitializer bootstrap process used in Servlet 3.0. You
can still use Spring and Spring Boot in these containers but you are
going to need to add a web.xml to your application and configure it to
load an ApplicationContext via a DispatcherServlet.
Can you guide me or point me to any examples or working sample project using web.xml in spring boot? I am using weblogic server.

Migrating an existing spring jersey servlet2.5, Jersey2.3 webapp to springboot

Evaluating to port an existing mid to large sized multi module JEE application, this consists servlet 2.5, Jersey for rest and Spring 3.2.9 (JDK8, Maven 3. currently we build a war file and deploy it on to aws. My objective for this exercise is to be able to use spring-boot to create a self contained executable jar that can be installed on AWS and this would help us just run on cloud with java -jar
Is it possible to use spring boot considering the project is not using spring-web module, it is more traditional Servlet2.5 statically declaring all servlets and filters in web.xml
which approach is better, adding spring boot as a parent or dependency.
Any experience and info our senior spring community members have in this kind of migration.
This is absolutely possible to do even if you're not using Spring Web MVC.
You can use spring-boot-starter-parent like a BOM POM, so you can import its dependencies without having to change your POM's parent.
Take a look at the Spring Boot documentation for migrating a web.xml application to Spring Boot. The main points here for traditionally deployed servlets and filters are:
A #Bean of type Servlet or ServletRegistrationBean installs that bean
in the container as if it was a <servlet/> and <servlet-mapping/> in
web.xml.
A #Bean of type Filter or FilterRegistrationBean behaves
similarly (like a <filter/> and <filter-mapping/>.

Deploy a spring boot war to websphere 7.5

I have a Spring boot war(ReESTful webservice with Spring) built using a gradle build. Initially I built an executable jar and then converted into war. But I am not able to deploy this on websphere 7.5 app server. It can be deployed on Websphere 8.0. I read that spring boot war built without having web.xml is only supported in WAS 8 or above. How can i convert this to a war file that can be deployed on WAS 7.5?
I read that I need to add a web.xml to the war, but what what should be the content of the web.xml so that it can load all the controllers?
Spring Boot doesn't support Servlet 2.5 officially, but it doesn't take a lot to make it work. You might find this useful: https://github.com/scratches/spring-boot-legacy.
You can get more information at the official documantation.

Glassfish 2.1 Spring 3.0 - How-To Setup - No Web Application

I have googled around and I have not found satisfying informations about how to start to setup spring in a glassfish container.
Starting point is:
Glassfish 2.1 (no discussions about the version please cause we are forced to use this)
Spring (preferrable version 3.0 but if not possible also lower version is allowed)
EJB 3.0 (therefore I want to make use of the interceptor mechanism to inject a spring bean on the the stateless bean see: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ejb.html#ejb-implementation-ejb3 )
We don't have a web application in the ear file therefore I am lost at the moment how I could integrate spring into our ear file.
Therefore I have the following questions:
How do I have to configure glassfish/ear file to recognize the spring xml files?
Where should I place and how should I name the spring xml files so they are recognized correctly by the spring framework?
It would be great if anybody could help to find the approriate starting point.
Kind regards,
Walter

Resources