Websphere Application Server : what is com.ibm.wsspi.bootstrap.WSPreLauncher - websphere

In IBM Websphere Application Server (WAS) what are the purpose of com.ibm.wsspi.bootstrap.WSPreLauncher and com.ibm.ws.bootstrap.WSLauncher? Every morning we are restarting the Websphere Application Server. So on the stat of WAS it will always be called to load applications war file? Or there are certain action on which these two are used by WAS?

WSPreLauncher and WSLauncher are main entry points in the starting the OSGi framework and server processes. If you look at startServer script, you'll see it invokes the WSLauncher class with a number of additional arguments that are essential to proper server startup. To your question, when using the serverStart script, WSLauncher will be called and as a part of starting all the components of the server, applications, including war files, may be started depending on your specific configuration. You should not invoke either the WSPreLauncher or WSLauncher entry points yourself and instead should use the provided scripts like startServer, startNode, etc.

Related

Start a spring boot application inside another java application?

I have two java applications:
a server starting with spring boot
a client using it (through REST api)
For the time, I start both applications in differents processes.
How could I start the server from the client to obtain a "standalone" application? The use of ProcessBuilder to call java.exe is a solution, but it has drawbacks: it will be OS dependant and cannot assure the server process will be shutdown / killed as the client leaves.
From the architecture point of view leave them separate is the best option, as you have a server and a client separate, it will be the behavior in a productive environment.
If you need it only during the development phase, and your reason to run both together is to save time, you can build both in containers using Docker. Basically create two applications, building from two different folders, and then you will start both together.
I found a solution in https://www.toptal.com/spring-boot/spring-boot-application-programmatic-launch . Igor Delac
opens the jar file containing the server to find the class ...loader.archive.JarFileArchive (and some other)
instanciates it and uses it to start the application on the jar itself.
The jar file is not extracted nor modified. Only a few classes are read.

Add Another Context Root Simulate webseal - Websphere 8.5

I need to simulate the presence of a Load Balancer (WebSeal) in my local installation of WebSphere 8.5. In detail, when an application is exposed through webseal is added into the URL, before the Application Context Root, the webseal Junction name. For example, an application with context-root "myapp":
Without webseal: localhost:8080/MyApp/......
With webseal: localhost:8080/JunctionName/MyApp/......
So i need to simulate this because i have shared DB with common configuration between my local installation, without webseal, and test installation balanced by webseal.
There is the possibility to configure a common context-root that the AS have to add to the URL of the deployed app in WebSphere 8.5?
I'm not aware of a way for one app to have two context roots, but for your local installation testing purposes you might be able to install two copies of the app, one at each context-root. It's probably a change to application.xml, or if you're deploying through the console UI, I think it's
configurable there.

Update for JavaEE application

Our application are built on Spring boot, the app will be packaged to a war file and ran with java -jar xx.war -Dspring.profile=xxx. Generally the latest war package will served by a static web server like nginx.
Now we want to know if we can add auto-update for the application.
I have googled, and people suggested to use the Application server which support hot deployment, however we use spring boot as shown above.
I have thought to start a new thread once my application started, then check update and download the latest package. But I have to terminate the current application to start the new one since they use the same port, and if close the current app, the update thread will be terminated too.
So how to you handle this problem?
In my opinion that should be managed by some higher order dev-ops level orchestration system not by either the app nor its container. The decision to replace an app should not be at the dev-ops level and not the app level
One major advantage of spring-boot is the inversion of the traditional application-web-container to web-app model. As such the web container is usually (and best practice with Spring boot) built within the app itself. Hence it is fully self contained and crucially immutable. It therefore should not be the role of the app-web-container/web-app to replace either part-of or all-of itself.
Of course you can do whatever you like but you might find that the solution is not easy because it is not convention to do it in this way.

How to invoke custom (java) program on Websphere Liberty Profile startup

How can i start a specific java program when a server instance has been started from within Websphere Liberty Profile?
eg. '> server start test' should start the server + start my specific java program (with a parameter if possible)
There is no builtin mechanism for this, so your best option would be to write a Liberty profile product extension that launches the extra program when the server starts. Specifically, write a feature that contains an OSGi bundle that contains a BundleActivator with a start method that launches the program.

Jboss deploying a ear and war file in the same server instance

Is it possible in Jboss deploying a ear and war file in the same server instance? If so any good source to get started? Any suggestion.
I have two applications deployed under my default deploy folder of jboss. I am running one application from which i have to call the other application to get some data. Is this possible? If so how to get started??
It is actually recommended that you only put 1 application in a server instance as a time. That said, I have had multiple ears and wars running in the same instance while I am developing. But for production it is better to separate them out. Since there is no extra cost involved this makes it easier to observe and debug apps.
Do you have a specific reason for wanting them to run side by side?
What version of JBoss are you running.

Resources