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

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

Related

migration spring-boot 1 to spring-boot 2.2.5, used JSP

I'm looking to make JSP work in Spring Boot 2.
This is a port of an application running on an old version of Spring Boot 1.
This app worked very well. But as soon as I migrated to Spring Boot 2 .. impossible to access the JSP page (the mapping is done well but impossible to find the JSP !!)
This application ships with tomcat and is delivered as a JAR.
Could someone help me or give me an example?

How to obfuscate spring boot war file?

I have tried ProGuard, YGuard tools.
These tools are able to obfuscate the code, but at runtime Spring IOC fails. The obfuscation renames all the packages and classes, thus bean injection does not work at runtime. Am using spring boot 1.5.7 and Maven.
DashO has support for Spring (i.e. the Wizard will automatically identify and configure Spring beans) and we published an article earlier this year about how to use DashO with a Spring Boot app (you have to extract BOOT-INF/classes manually, and configure the entry point manually).
You can download a trial for free, and have full access to our technical support if you have trouble getting it working.
Full disclosure: I work for the company that makes DashO.

Override Spring jar in Weblogic 12c

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>

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.

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