How to set proxy for application running in IBM WebSphere - proxy

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/

Related

Websphere Application Server Classloader policy

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()

How to configure proxy url in weblogic to connect destination from source via Proxy

I have deployed an application in weblogic managed server which internally connects to cloud network, since this application where I deployed is a secured network so it should connect via proxy and hence I need to configure the proxy url settings in weblogic, I added below settings in server start option in weblogic managed server however application is getting fail to start.
For Example:-
Source Ip:- SourceIp
Destination Ip:- DestIP(which is configured in application properties file)
Proxy Url :- ProxyIp
Proxy port :- 8080
Configuration done in managed server as per below.
-Dhttp.proxyHost= ProxyIp-Dhttp.proxyPort=8080 -Dhttps.proxyHost=ProxyIp-Dhttps.proxyPort=8080 -Dhttp.nonProxyHosts=SourceIp
Note:- If I deploy the application in non secured network where I do not need to configure any proxy works fine and application gets started. I am expecting post proxy configuration in web logic, my app should up and running.However I get below error:
DestIp failed: Connection timed out (Connection timed out)

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.

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.

EJB Reference Configuration Error

I have 2 ears—say, Ear1 and Ear2—for my application, which are deployed in clusters. Ear2 is having Ejb which is being called from Ear1. EJB reference is required for communication between Ear2 and Ear1. I am setting the below value to
Target Resource JNDI Name: corbaloc::ClusterServer1:2810,:ClusterServer2:2810/cell/clusters/Cluster1/ejb/com/mycompanyName/projectName/ejb/facade/EjbFacadeHome
But I am getting the below error:
Caused by: javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "corbaloc::mums00100251.in.net.intra:2810,:mums00100392.in.net.intra:2810/cell/clusters/Cluster1/ejb/com/bnpparibas/tradefinance/ejb/facade/EjbFacadeHome". Make sure that any bootstrap address information in the URL is correct and that the target name server is running.
Please help.
The correct format for referencing remote EJB with WebSphere Application Server 6.1 in this case would be like:
corbaloc:iiop:mums00100251.in.net.intra:2810/ejb/com/bnpparibas/tradefinance/ejb/facade/EjbFacadeHome,iiop:mums00100392.in.net.intra:2810/ejb/com/bnpparibas/tradefinance/ejb/facade/EjbFacadeHome
2810 suggests you attempted to use either the bootstrap port of node agents or deployment manager. I would check the ports (you can find the BOOTSTRAP port from the management console under Ports section of the server preferences), and if they still fail use the actual application servers' bootstrap ports.
There could also be a scoping issue which would mandate that. If you deployed your application to the Cluster scope it is possible that the naming service only in the cluster members can actually resolve the EJB.

Resources