Websphere Application Server Classloader policy - websphere

How do I set "Classloader policy" to "Single" from config file or programatically on websphere apllication server , since I don't have access to admin console.

Take a look at the instructions for Modifying WAR class loader policies for applications using wsadmin scripting. If you also want to modify the application classloader policy for a server, take a look at the following wsadmin Jython example that modifies both the application classloader policy and delegation mode for server "server1". Be sure to synchronize configuration modifications to the nodes when using IBM WebSphere Application Server Network Deployment.
wsadmin> appSrv=AdminConfig.getid("/Server:server1/ApplicationServer:/")
wsadmin> AdminConfig.modify(appSrv, '[[applicationClassLoaderPolicy "SINGLE"] [applicationClassLoadingMode "PARENT_LAST"]]')
wsadmin> AdminConfig.save()

Related

How to set proxy for application running in IBM WebSphere

There are multiple enterprise applications running on IBM WebSphere 8.5
For one of our application, we want to set proxy level settings.
I know we can set proxy level on application server level by going to JVM Custom properties and setting http.proxyHost and http.proxyPort.
How can I set proxy level settings for single application on a server ?
Any help will be appreciated.
For example - employee-soap-services-0_1_0_war is my application which I want to run with proxy. Attached is the screen of all application in server.
As you told http.proxyHost setting is at JVM level and will have impact for every applications running on that JVM.
If your requirement is to route all the webservices calls through proxy, why cant you make the web services endpoint URL the address of a proxy server accessible over HTTP and route the request from their to the actual endpoint URL?
For example,
Your application ---> http://proxyserver.com:333/app=employee-soap ---> http://employee-soap-services-actual-endpoint/

How to make an application like JConsole?

I want to make an application like JConsole. Is it possible? If yes, what are the changes need to done at JVM level? I am planning to use Spring-Boot. As per my knowledge, JMX is enabled by default. Do I need to configure anything extra in my Spring-Boot app in order to access the JMXBeans which are exposed by default?
Here I'm not trying to expose any MBean instead I'm trying to access those beans which are already exposed by JVM. How to achieve it?
JConsole is a JMX compliant monitoring and management application. The architecture is quite simple. It's a client-server architecture. Where the client is the Remote application (Example JConsole or the one that you want to build) and the server is the JMX Agent. In your case, you want to build your own client which is possible.
I want to make an application like JConsole. Is it possible?
Yes, it is possible.
If yes, what are the changes need to done at JVM level?
What do you mean by changes at JVM level? You are simply creating a client application that connects to the server (JMX Agent) using a certain protocol. Remote Method Invocation (RMI) is the protocol used by JConsole for the connection to the JMX Agent. If you want to use RMI for communication, you don't have to do anything on the server side. But if you want to use some other protocol for communication, you can define your own Protocol adapter.
As per my knowledge, JMX is enabled by default.
As of Java SE 6 it is. But you can only monitor it locally. For connection from a remote machine, you need to define an RMI port to start listening for incoming connections.
Here I'm not trying to expose any MBean instead I'm trying to access those beans which are already exposed by JVM. How to achieve it?
Please check out the example from this link - Mimicking Out-of-the-Box Management Using the JMX Remote API. It shows you how to create a simple client application that connects to a remote JMX agent and access the MBeans. This should guide you in the right direction.

How to access mulesoft application metrics using JMX

I want to expose some custom application metrics like how many records processed to JMX in mulesoft flow.
My application is spring boot application.
Any idea on how to achieve this?
Thanks & Regards,
Vikas Gite
Using the Default JMX Support Agent
You can configure several JMX agents simultaneously using the element. When set, this element registers the following agents:
List item
JMX agent
RMI registry agent (if necessary) on rmi://localhost:1099
Remote JMX access on service:jmx:rmi:///jndi/rmi://localhost:1099/server
(Optional) Log4J JMX agent, which exposes the configuration of the Log4J instance used by Mule for JMX management
JMX notification agent used to receive server notifications using JMX notifications
(Optional) MX4J adapter, which provides web-based JMX management, statistics, and configuration viewing of a Mule instance
Also you can try below which can directly be configured under the MULE's wrapper.conf (under $MULE_HOME/conf/wrapper.conf) to enable JMX connectivity so that we can use tools like JMC (Java Mission Control), VisualVM, JConsole to pull the JMX attribute values from the Mule Server and the deployed applications -
wrapper.java.additional.<n>=-Dcom.sun.management.jmxremote
wrapper.java.additional.<n>=-Dcom.sun.management.jmxremote.port=9999
wrapper.java.additional.<n>=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.<n>=-Dcom.sun.management.jmxremote.local.only=false
wrapper.java.additional.<n>=-Dcom.sun.management.jmxremote.ssl=false
wrapper.java.additional.<n>=-Djava.rmi.server.hostname=<localhost ip>
wrapper.java.additional.<n>=-Djava.rmi.activation.port=9998
Here should be removed with the next incremental value of the java wrapper value and will be the ip of the the Mule runtime host/server
I hope you are looking for this, if not then please post further queries or clarity so that i will help you out.

Copy profile configuration in websphere server 6.1

I have a was6.1 server profile "AppSrv01" in which database and queue configuration is done and some applications are deployed.
I want to create one more profile in my system having the same configurations as AppSrv01 instead of doing it manually again.
Is this possible?
Thanks,
Sasank.
Best solution is to create administration scripts in order to configure your environment.
Samples for WebSphere Application Server

IBM Worklight - Can Worklight be deployed to an existing WAS server?

Can a Worklight Server be deployed to a WebSphere application server which also runs other non-Worklight .ear applications? Or does Worklight need its own separate instance of WAS?
Just like you can deploy multiple instances of Worklight (v6 and above) projects - multiple .war files to the same WAS application server, there should not be issues to deploy it to an application server running other services.
That said, possible issues to consider:
When deploying a Worklight project, you will want to enable "application security"
(in the WAS admin console, Security > Global Security). If there are some other web
applications for which application security is undesired, you need a different WAS server
instance.
Setting up, enabling and migrating security
The list of users that can use the web applications are configured through LDAP or
"federated repositories", or similar. If, for Worklight, you need to use a completely
different set of user logins than for the other web applications, then you need to use
multiple "security domains".
Configuring multiple security domains
The machine hosting the application server will probably need memory upgrades...
Deploying the Enterprise Archive (EAR) Using the WebSphere Admin Console
Probably also need to make clear seperation where required:
IBM WebSphere Developer Technical Journal: Co-hosting multiple versions of J2EE applications
Worklight is itself an application running inside a web container, whether that be Tomcat, WAS Liberty, or full WAS. It's essentially a layer running underneath the container to handle requests for Worklight applications, fielding their context root requests. If you create the WAR file for your Worklight app and extract out the deployment descriptor you'll find all the necessary filters and listeners that most other apps would have.
Things like adapters and wlapps are "installed" to this underlying layer, and are merely extracted and stored as whatever was packaged with them, such as the JS and CSS you used to make you app. In fact, with a standard Liberty install you can typically find your adapters in plain sight at (for the WL5.0.6 instance I have handy, it's different for WL6):
/opt/IBM/Worklight/server/wlp/usr/servers/worklightServer/worklight.home/worklight/data/export/adapters
So, in addition to what Idan has said, I also present you with the following docs (assuming WL6)
Overview of the Worklight Server installation process
Given my own experience, you should be perfectly able to install other EAR and WAR files to your existing WAS instance, just make sure your context roots are unique, as always ;)
I also second the memory considerations.

Resources