How to configure remote debugger for spring cloud data flow Local server - spring-cloud

I am using the spring cloud dataflow server to create a stream. I want to do a remote debugging on the spring cloud dataflow server.
Below is the command which I am trying but not able to connect on 5005 port.
java -jar spring-cloud-dataflow-server-2.5.3.RELEASE.jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005

Please refer to the guides that Sabby pointed for debugging applications and the SCDF/Skipper server in general. Apart from this, what I notice from your question above is you have the debug parameters as java program arguments which is incorrect.
What you actually need is something like this:
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -jar spring-cloud-dataflow-server-2.5.3.RELEASE.jar
The debug parameters need to be passed before -jar argument.

We have a FAQ describing what property to configure to debug the applications deployed by SCDF.
If you want to debug SCDF itself, you may want to review the Debug Data Flow Server guide from the Microsite. There's also a specific section to debug the Skipper application, as well.

Related

How to read a file on a remote server from openshift

I have an app (java, Spring boot) that runs in a container in openshift. The application needs to go to a third-party server to read the logs of another application. How can this be done? Can I mount the directory where the logs are stored to the container? Or do I need to use some Protocol to remotely access the file and read it?
A remote server is a normal Linux server. It runs an old application running as a jar. It writes logs to a local folder. An application that runs on a pod (with Linux) needs to read this file and parse it
There is a multiple way to do this.
If a continious access is needed :
A Watcher access with polling events ( WatchService API )
A Stream Buffer
File Observable with Java rx
Then creating an NFS storage could be a possible way with exposing the remote logs and make it as a persistant volume is better for this approach.
Else, if the access is based on pollling the logs at for example a certain time during the day then a solution consist of using an FTP solution like Apache Commons FTP Client or using an ssh client which have an SFTP implementation like JSch which is a native Java library.

JBOSS 7 Monitoring Tools

Any good suggestion for Monitoring JBOSS 7 in Production ? I would also like to configure alerts based on certain condition. Of course , It has to be Open source.
Thanks.
You can use standard JConsole that comes with JBoss dependencies added. It's used to monitor your servers state and mbeans, it's very useful.
To test it on localhost start your server and then run the JConsole from your server/bin directory and select JBoss in the Local process selection.
To use it on "remote" server, start your server on "REMOTE_HOST" and then run JConsole from an JBoss/bin directory and connect with the followin string
service:jmx:jmx-remoting://REMOTE_HOST_NAME:9999 (or the port you use) and enter the username and password.
Secondly, for more detailed info of objects creation, memory leaks, CPU% (profiling) there is another one as:
http://jbossprofiler.jboss.org/
You can try to use free open source APM like scouter.
It shows very useful realtime performance information of every request.
And also you can set a threshold of resources and can make plugin for alerting to external.
https://github.com/scouter-project/scouter
JBoss7 need to set module option.
-Djboss.modules.system.pkgs=~~~,scouter

Spring batch admin sample web app with command line arguments

I am trying to monitor the Spring Batch using Batch Admin Mbeans, by either jconsole or 'JBoss operations network'.
The sample application 'spring-batch-admin-sample-1.2.1.RELEASE.war' is deployed in Jboss EAP6.
But I don't know how to start the sample application with the usual command line options to expose the MBeanServer, as mentioned in reference doc' http://docs.spring.io/spring-batch-a...rence/jmx.html ' .
JBoss EAP 6 does not declare com.sun.management.jmxremote system properties by default, and according to the issue below, I can't start JBoss with com.sun.management.jmxremote properties in my standalone.conf file
https://issues.jboss.org/browse/AS7-1859
Any suggestions much appreciated.
I get around with it by the following,
The Mbeans are enabled in spring batch admin according to spring batch admin doc. So after deploying the 'spring-batch-admin-sample-1.2.1.RELEASE.war' in JBoss, we can get the details of MBeans as mentioned in here
And now i have extended the RHQ's generic JMX plugin to discover and list the spring batch admin metrics.

How do I get the list of SOAP services exposed by WSO2 Identity Server?

I've recently started looking at WSO2 Identity Server as an alternative to what my company is currently using.
I'm finding it difficult to determine what SOAP and REST services are exposed and what the URLs for those are.
I've tried starting the server (on my Windows machine) with wso2server.bat -DosgiConosle , but I can't seem to get the OSGi console after the server has started.
Is there any other way to get the list of services exposed by the product?
Also, I'm not aware of the service API being documented and made available - Are there plans to do this?
Any help in getting the list of services or an instruction on how to do it would be greatly appreciated.
WSO2 products currently do not have a documented service API. However you can use OSGi console to view the available service components details.
Make sure that when you start WSO2 IS with osgi console the following log is visible, which says that the console is enabled.
sh wso2server.sh -DosgiConsole
JAVA_HOME environment variable is set to /jdk1.6.0_30
CARBON_HOME environment variable is set to /wso2is-4.1.0
OSGi console has been enabled with options: -console
After server is properly started, press enter and osgi> console will be displayed.
[2013-07-24 16:33:57,215] INFO {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} - WSO2 Carbon started in 17 sec
[2013-07-24 16:33:57,437] INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} - Mgt Console URL : https://localhost:9443/carbon/
osgi>
By entering necessary osgi commands you can see the activated OSGI service etc. For example if you need to see available services use,
osgi> services
This will list down all the services in the runtime. Use appropriate filters to find the WSO2 IS services by referring this blog post.
osgi> ls
This shows all the osgi service components along with their component ID and life-cycle status. If you need to now on particular service component use ls -c command.
The following question thread has useful information on WSO2 IS API too.
WSO2 identity server api
start the server with the following command(case sensitive)
wso2server.bat -DosgiConsole
and you should see the osgi> console
This link leads to an information how to list admin services exposed on WSO2 product (osgi console must be enabled)
List all ws in wso2
1) Start the server with osgi console.
wso2server.bat -DosgiConsole
2) Run following command 'listAdminServices'
osgi> listAdminServices
This should show all the admin services exposed by the server.

Connect to JMX using PowerShell

I am not a developer so please keep that in mind when reading the following message:
I need to be able to use Windows PowerShell to connect to a JMX RMI agent on a host, is this even possible ?
The example string from the java client I have been given is as below:
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:7979/jmxrmi");
The reason for this is that I am doing other work in my PowerShell script and would like to keep it all in one place.
Thanks !
This is an unusual mix of two technologies, but it is possible.
On the off-chance that you are attempting to connect to a JBoss server, the quickest way may be for you to call twiddle, a command tool that will dispatch JMX requests to the target JBoss server and return the results to standard out.
Another way is to implement the Jolokia agent on the target servers. This will allow you to issue JMX requests using REST. Responses will also be returned in REST format which you can process in PowerShell using one of these solutions.
Thirdly, you can also deploy the JMX-WS service on your target servers which will allow you to communicate with the JMX server using web-services. This document provides some VBScript examples of this.
None of the above actually uses the JMXServiceURL syntax you outlined, and I cannot think of a way you could actually cleanly integrate this RMI based protocol into PowerShell, but hopefully one of the above will work for you.
========== UPDATE ==========
There may be a way to use the RMI implementation. Take a look at IKVM. It is a Java Byte Code to .NET compiler. I have successfully compiled JMX/RMI java code into a .Net assembly and used it from C#. I think PowerShell will do the same thing.