How to display Glassfish data using Java? - java

I want to create JSF page which displays Glassfish connections. The web page will be hosted on the server. How I can get this information from Glassfish?
Best wishes

Why not use a 3rd party JMX monitoring tool instead of building your own tool to monitor performance? The Performance Monitor comment above is valid for GlassFish 2.x, but not GlassFish 3.x (Performance Monitor is not available for GlassFish 3.x). If you are using GlassFish 3.x, read on.
Otherwise, the monitoring data you want is available via the RESTful Monitoring API. Here are some resources you can utilize to help you.
http://engineeringnotebook.org/building-a-glassfish-monitoring-client-using-rest/
http://blogs.steeplesoft.com/2010/08/glassfish-administration-the-rest-of-the-story/
http://docs.oracle.com/cd/E18930_01/html/821-2416/gjipx.html#scrolltoc
Also, the RESTful API will render in HTML, JSON, and XML. So, you can begin by perusing the monitoring tree by pointing your browser to http://localhost:4848/monitoring/domain, and the RESTful monitoring will render in HTML.
Also note that you will have to enable monitoring to get to the data you want. The admin guide will show you how to enable monitoring.
Hope this helps.

Related

Publish WebService for public access

So, i have some experience developing Java WebServices.
The problem is, all i do is deploy them to localhost.
My question is:
How can we deploy a WebService to a server other than localhost?
How can i search the web and find the WSDL description for my WebService so that i, or anybody else around the world, can call its services?
If i have it in localhost, nobody else but me on my computer can acess it right?...
Thank you for your time
I don't think you'd want to make an application running in your development environment accessible to anybody else around the world for a variety of reasons. Others on your local network could access your local host via its network hostname, but this isn't users around the world.
Let's discuss your two questions individually:
How can we deploy a WebService to a server other than localhost?
You'll want to establish a server environment that is available (on) as much as possible. If you want to keep using Apache Tomcat, you could sign up with a variety of service providers that host Apache Tomcat applications - there are many who offer tiered pricing based on number and size of pre-configured virtual servers (CPU, memory, disk space, and/or monthly data transfer of the application). You could even sign up with a cloud service provider such as Google Cloud, Amazon Web Services, or Microsoft Azure. All provide the tools to build, provision, and manage virtual server(s) which you would then deploy Tomcat and web service application into. Here's a detailed tutorial on setting up a Tomcat virtual server on Azure. You'd then need to manage those server(s), watch them to see how much they're utilized (which will impact how much they cost you per month, by the way).
If server management isn't what you're looking for - you could also explore "serverless" options such as Google AppEngine or AWS Elastic Beanstalk. In this model, you just upload your WAR file and the hosting service manages things like how many servers are needed to handle all the application SOAP requests your users around the world are making. You'll need to read the specifications for each, as you technically aren't providing Tomcat itself - in Google's example, you're actually running in their own proprietary container, so your app may need some changes depending on what it does.
Depending on what hosting or cloud service provider you select, your "how to deploy" steps vary wildly. On the bright side, all offer tutorials on how to specifically deploy applications into them "their way."
How can i search the web and find the WSDL description for my WebService so that i, or anybody else around the world, can call its services?
Once you've settled on a hosting or cloud services provider and have deployed your application, you'll have a URL to reach it, but you'll need to work on getting the word out. There are some open specifications on (SOAP) web service discovery, but more than likely that's not what you're really looking for. You could also submit your WSDL URL to an online API directory such as ProgrammableWeb or Public APIs.
The simplest way to do-it-yourself would be to run a web site that links to the WSDL, then use search engine optimization techniques to list the site on search engines and make it (and the WSDL it links to) relevant to web searches.
Getting fancier, you can treat your web service as a product via an API Management system. At a high level, this works by hiding the real URL to your web service on its server(s) and instead direct clients to a small website for developers where you document, market, facilitate discovery of your service as well as offer a sign up to use it (so you can track and manage who around the world is using your web service). Clients then consume the web service via separate URL behind what's called an API Gateway. You could charge for access or offer it for free but limit the amount of concurrent requests a client can make - after all, you're likely paying your hosting provider for utilization. Some of the cloud service providers Amazon, Azure, standalone API management vendors such as Apigee, Mashery, and many others.

Integration of a web application with a third party application

I am developing an integration solution where my web application has to communicate with a third party application. Web application can call the services of the third party application only by calling its executable with specific parameters. Third party application then produces results in form of files that are stored on the server where it is installed. These files are to be used and processed by the web application. The web application and the third party application will not necessarily be on the same servers. The web application is built with Spring framework.
At the moment I am trying to search for the best methodologies and best practices that should be used to perform this integration. Since I am new to this area I do not know the exact terminologies that I should use to search for. I also do not know the exact term that describes such a setting where a web application is integrated with such a third party application.
I need some guidance about what kind of information to search for and what terminologies to use during the search. This is important for me because I also need to document to whole search process and the solution based on current methodologies and best practices.
Thanks a lot in advance!
Asma
You should be able to use Spring Web-Service client APIs, see below links help you to find an approach.
http://static.springsource.org/spring-ws/site/reference/html/client.html
Spring Web Service Client Tutorial or Example Required

CMS external upload of files

I am looking for a java based CMS that exposes an API for external file upload.
So for instance I have a Tomcat server with a running CMS. I also have a (standalone) client that needs to add content to the CMS automatically (without user interference).
I already looked into Liferay (using Jackrabbit) but there is no way to upload documents/files from a client.
Does anyone know of a java CMS where this is possible ?
Thanks!
Coenos
If you are ready to take time in coding then you could make use of Liferay webservices to create a client yourself. Liferay exposes its core api as web service, using which you can do most of the things. To see the list of services that Liferay exposes check this url
http://localhost:8080/tunnel-web/axis
Replace localhost:8080 with yours.
To know more about this check out this wiki link
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Web+services+-+Manage+Users,+Organizations,+User+Groups,+and+Roles+via+SOAP

iGoogle platform for intranet page

Does it exists a platform or container capable of running google gadgets written for iGoogle.
Basicly what I want is to have my private "iGoogle" intranet page.
I found out that LifeRay, Sun Java System Portal Server, Weblogic Portal Server and JBoss Portal Server should be capable of running google gadgets and i'd like to know if this is true.
Are this implementations compatible with those of an iGoogle ?
Many thanks and best regards to you all.
I don't know about the platforms you mention, but you can create private gadgets for use on a Google Apps Google Sites Start Page. You create the gadgets, upload them to Google using FSCT, and use the Google Secure Data Connector to get to your data.
Shindig is opensource implementation of iGoogle container (gadgets api and open social api).
Beside shindig you can use GateIn, Jboss or liferay portal. At the end we choose GateIn.

Java Web Service for .NET 2.0 Client on Linux (Fedora)

I'm tasked with creating a Java Web Service for a .NET 2.0 client to consume.
What would your suggestions for the implementation be?
The solution doesn't need to be very heavyweight (don't need a full Java EE container I believe) but what do you think is the best solution for this? I have thought about using Glassfish v2 with JAX-WS annotations (#WebService), and JAXB XML Bindings(e.g. #XmlElement), which I assume the .NET client would be able to consume?
Has anyone tried this scenario?
Would Glassfish be overkill though, since I'm merely using the Web Service as a mechanism for .NET on Windows to communicate to the Linux box, the underlying application is extremely small.
Any suggestions are more than welcome :)
Thanks,
James
P.S. Other notes - would you use Axis/CXF instead of Glassfish? Would you use a servlet container such as Tomcat? etc.
I have used Axis2 and it works.
I had the same problem of making Data Exposing API (Web Service in my case) in Java.
I made the web service using Axis2 and Spring (to access database) and the WSDL created via Axis2 was easily consumed via ASP.NET Application via its Add Web Service Dialog Box and the corresponding Proxy Classes were created easily.

Categories