Tuesday, December 6, 2011

Java Remote Debugging


Consider a scenario where you can't run the application in your development environment, e.g. say your application can run only on a server machine (because it is dependent on some third party interface that are not accessible in your development machine) and you have to resolve a problem (bug). What you can do?

The solution is Remote debugging. Remote debugging is debugging an application by connecting the remotely running application with your development environment ( i.e. you can say to connect with code in your IDE).

Remote debugging can be useful for application development, such as developing a program for a low-end machine that cannot host the development platform, or debugging programs on dedicated machines like Web servers, whose services cannot be shut down. Other examples include Java applications running with limited memory or CPU power, such as mobile devices, or developers wanting to separate the application and development environments, etc.

To debug the application remotely we need to follow following two steps.
  1. Start the application make JVM know that it will be debugged remotely
  2. Configure your IDE to be able to debug that remote application

 Starting the Application with Remote Debugging Enabled

Sun Microsystems' Java Platform Debugger Architecture (JPDA) technology is a multitiered architecture that allows you to debug Java applications in all situations easily. The JPDA consists of two interfaces (the JVM Tool Interface and JDI, respectively), a protocol (Java Debug Wire Protocol), and two software components that tie them together (back-end and front-end). It's designed for use by debuggers in any environment. JPDA is not only for desktop systems but works well with embedded systems, too.

Following are some of the arguments used in the process.

-Xdebug
Enables debugging features.

-Xrunjdwp:
Loads the implementation of JDWP in the target VM. It uses a transport and the JDWP protocol to communicate with a separate debugger application. Specific suboptions are described below. Starting from Java V5, you can use the -agentlib:jdwp option, instead of -Xdebug and -Xrunjdwp. But if you have to connect to the VM prior to V5, -Xdebug and -Xrunjdwp will be the only choice. Following are brief descriptions of the -Xrunjdwp suboptions.

transport
Generally, socket transport is used. But shared-memory transport can also be used on the Windows platform, if available.

server
If the value is y, the target application listens for a debugger application to attach. Otherwise, it attaches to a debugger application at the specified address.

address
This is the transport address for the connection. If the server is n, attempt to attach to a debugger application at this address. Otherwise, listen for a connection at this port.

suspend
If the value is y, the target VM will be suspended until the debugger application connects.
  
java -Xdebug -Xrunjdwp:transport=dt_socket, address=8998, server=y -jar application.jar

The above command says: start myapp.jar + start a server socket at port 8998 and publish the debugging messages using the Java Debug Wire Protocol (jdwp) there. This is helpful if you have the executable jar for starting the application.

Another way is to attach your Eclipse debugger to a running Java process you need to start that process with the following Java options.

-Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y,suspend=n
This entry is usually done in *.bat or *.sh files that starts the java process. For example if you want to debug any web application running on JBoss, you can place the following line in its run.bat
set JVM_ARGS=%JVM_ARGS% -Xdebug -Xrunjdwp:transport=dt_socket, address=8182, server=y,suspend=n
Once you have done this and have restarted the server, you can use following process from your Eclipse to attach to this running process.
Configuring Eclipse to Debug a Remotely Running Application
Follow the following steps:
  1. Start Eclipse.
  2.  Go to Run -> Debug Configurations
  3. Create a new Remote Java Application configuration
  4. Configure the remote application's details 
  5. If you would like to have this launch configuration in your favorites menu

Friday, December 2, 2011

Summarizing Workshop on Cloud Computing

After a long break, I am again starting my blog writing from the place from where I have left. Our workshop on cloud computing was a great success. It was attended by many research scholars, students, teachers and few people from industry. We had tried our best to make people taste different flavors of cloud computing. A practical hands on session on Google App engine and Android environment was also conducted. The main topics covered were:


  • Understanding Cloud Computing
  • Benefits of Cloud Computing
  • Service Model Architecture
    • Infrastructure-as-a-Service (IaaS)
      • Amazon EC2
    • Platform-as-a-Service (PaaS)
      • Microsoft Azure
    • Software-as-a-Service (SaaS)
      • SalesForce.com
  • Selecting the best Cloud
  • Load Balancing in Cloud Computing
  • Hands on Cloud Development using GAE
  • Mobile Contacts Backup Application

The presentation you can download from here.


Tuesday, April 12, 2011

Workshop on Cloud Computing


Title of the Workshop: Cloud Computing
Date: 20 July, 2011
Duration: 1 day for 6 hours
Venue: Chitkara University, Punjab, India
Expected Number of Participants: 40
URL:

Objective of the Workshop:
Making the participants aware of Cloud Computing frameworks and guide them to program Applications on Cloud framework. By taking one example cloud framework, a live demo for developing the cloud applications will also be presented.

Brief Technical Description of the Workshop:
Cloud Computing is an emerging computing paradigm envisioned to change all IT landscape facets including technology, business, services and human resources. It is a consumer/delivery model that offers IT capabilities as services, billed based on usage. In Cloud Workshop, we are going to make the audience aware about cloud computing. In this, the early adopters of Cloud Computing technologies will exchange ideas. The workshop will help the participants to answer following questions:
  • What are the economic benefits (e.g., for both providers and users) of cloud computing (e.g., for commercial clouds, government clouds)?
  • Which are the business models for cloud computing? (PaaS, SaaS, IaaS)
  • How performance can be predicted for clouds? (Load balancing, Automated testing, Version control, Scalability)
  • Which are the main decision criteria for service selection in clouds environments?
  • How to program applications on cloud frameworks? (A Live demo of programming cloud application on Google App Engine and hands on with other frameworks like MS Azure, SalesForce, Amazon EC2)

Wednesday, January 26, 2011

Google Cloud Print: Printing was never such simple

Google Cloud Print makes printing more intuitive, accessible and useful, by allowing you to print to your printers from Google Cloud Print enabled apps on any computer or smart phone. To connect your printer to Google Cloud Print, you will need to install the latest beta version of Google Chrome on a Windows XP, Vista, or Windows 7 computer that's connected to your printer. Once installed, enable the Google Cloud Print connector in Google Chrome.


Google Cloud Print is a web service offered by Google. Users associate printers with their Google Account via the service. Printers are treated in much the same way as documents are in Google Docs. Therefore, it is very easy to share printers with your coworkers, friends, and family anywhere in the world. No need for complex network setups to make print sharing work! In addition to associating printers with a user's Google Account, the capabilities of each particular printer model are stored so they can be shown to the user to select appropriate options when submitting a print job. Once the service receives a print job, it sends it to the printer. It also receives regular updates on the status of the print job which it makes available to the app.

For your printer to be connected to the Google Cloud, you must be logged into your Windows user account. Just as when your printer is offline, if you are using the Google Chrome proxy and your Windows user account is logged off, jobs will be saved and fetched normally when you log back in. You can connect any number of printers that you like to a device running the Google Cloud Print proxy in Google Chrome. For now, due to technical limitations, google recommend that users activate the proxy on no more than three devices for a given Google Account.

Saturday, January 15, 2011

Managing Supply Chain process using Cloud Computing

We are living through the exciting times in information technology. A wave of information explosion and the corresponding need to process it efficiently and effectively is placing relentless demands on IT. To handle this wave, the concept of cloud comes. Cloud Computing is the main buzzword now days. Many big IT leaders such as Amazon (EC2), Google (Google Apps), Microsoft (Azure), Salesforce and many more have embraced the concept of delivering software over the Internet, as it can mean lower costs and less maintenance for those who use the applications. IBM announced its Blue Cloud initiative, offering a package of hardware and software to allow its customers to create their own internal clouds. The company had already partnered with Google to provide cloud solutions for six American universities and hopes to grow the program to allow more universities and corporate and government entities to join in. Many companies are offering hardware designed to operate on cloud networks, including Hewlett Packard, Dell and Clear Cube. And according to industry analysts, Cloud Computing is here to stay:
  • By 2012, net new IT growth in spending will be $30.8 billion, 25% of which will be IT Cloud Services.
  • Cloud services will be essential tools for addressing the biggest business demands of IT: speed, cost, scale, rich variety of solutions.
  • Of the companies using cloud computing services to enable accessibility from anywhere; 83% are specifically using cloud computing services for software as a service.
Cloud is getting used in many of the areas where there is need to increase capacity or add capabilities on the fly without investing in new infrastructure, training new personnel, or licensing new software. Enterprise centric systems are one of the best example areas which are leveraging a cloud computing environment of shared infrastructure and platform for global collaboration, companies can take advantage of seamless end-to-end business processes, cross-community visibility, and lower costs to support these advanced capabilities to better meet their supply chain community’s ever more demanding business requirements.

A lot of effort and money has been expended especially into the traditional enterprise-centric systems and also most of the bandwidth of the IT staff is consumed by the run-and-maintain aspects. Another drawback of the traditional SCM systems is the wastage of lot of resources and money spent by companies for whole year, making sure their servers can handle peak loads during the holiday season. So what happens after the holidays have passed and the server loads slow down? Most companies will still be running and maintaining all this equipment until next Holiday season. It’s not uncommon for most companies to be running their servers at just 20% capacity most of the year and while there is a lot of capital and resources being used, they are providing no economic or environmental benefit at all. To avoid the wastage of 80% of servers computation power most of the year, cloud computing can be utilized to form the SCM cloud that will deliver the supply chain solutions as Software-as-a-Service (SaaS). SaaS in an on-demand paradigm of IT solutions delivery that allows for trial before usage, pay for what you use, and rapid value with minimal IT hassles.

Amitive is the first Supply Chain Management software solution to fully embrace and leverage cloud computing. Amitive enables a community of business partners to work together seamlessly on a real time, common platform and make smarter decisions faster with clear lines of cross-community visibility. Business intelligence developer PivotLink and visual order management provider OrderMotion also announced a new SaaS solution designed to provide retailers with on-demand sales and order management analysis. Its objective is to let businesses monitor and manage marketing, merchandising and operations by providing secure, collaborative real-time reports on each stage of the order life cycle.

Let’s discuss in somewhat more detail that how the SCM services are provided through Cloud infrastructure. The figure shows the basic SCM Cloud Architecture [Source: SupplyChainBrain]. Through this architecture, all the complexities of getting the SCM services are hidden to normal user. Let’s take an example, earlier retailers have to go through a laborious and time-consuming way of finding a suitable application that can place, manage and fulfil orders. They need to choose a product after evaluating many of the available solutions and accommodate technology constraints that come with it. Then the complete go live process involving setup, configure, deploy, and testing is done. Only the retailers who have the scope of huge investments can only afford such process. But using the SCM cloud, all this process is hidden from the retailers using abstraction layer. They are provided with the services that they want without taking into consideration the lengthy process to Go-Live. Another benefit of SCM cloud will be that now the small enterprises can also afford these costly processes at economical price. An SCM cloud enables small businesses to have a dedicated Sterling 8.0 instance for order management even when they neither have an IT department nor can lease a space in a data center.

Thus Cloud Computing solves a huge problem in capital inefficiency and helps companies save energy and the environment, by allowing companies to easily scale up IT resources when demand is high and scale down when activity slows. SCM cloud also helps in supporting the green initiative of saving the environment.

Thursday, January 13, 2011

Google Labs- URL Shrinker

Search engine giant Google has announced the availability of an API for URL shortening, the goo.gl API in Google Code Labs. The new service enables users to takes long URLs and squeezes them into fewer characters to make a link that is easier to share, tweet, or email to friends.
Users can shorten and expand URLs using the API, as well as fetch history and analytics. One could use these features for a wide variety of applications, enabling behaviors ranging from auto-shortening within Twitter or Google Buzz clients to running regular jobs that monitor usage statistics and traffic patterns.
Application developers can check the goo.gl API documentation at Google Code Labs.

Monday, January 10, 2011

2011 will be the year of Super Phones

At CES, Nvidia have come up with a term "SuperPhone" other than smartphone to distinguish these new classes of devices. Nvidia has declared that their Tegra 2 processor is a 'superphone' maker. Today’s devices running processors around the 1GHz level are capable of HD 720p encode and decode of video and render graphics. Super Phones on other hand will look virtually identical to smart phones, but are characterized by their Tegra 2 CPUs, will be fully capable of 1080p encode & decode of HD video, capture 1080p video and capable of achieving console level 3D graphics with 4G connectivity, and plethora of output ports, including HDMI. The Tegra 2 claims to be the first ever mobile dual-core CPU for speedier web browsing, enhanced performance and better response time.

The LG Optimus 2X’s is the first of the phones which will use the Tegra 2 processor from Nvidia. Its major specs cover a 4” WVGA screen, 8GB onboard, 1080p MPEG-4 and H.264 playback as also recording and HDMI mirroring. An 8MP camera sits on the phone’s back panel and 1.3MP front-facing camera.

Amidst these handhelds, Motorola Atrix seems to be the most fascinating . Remember the Redfly, a small, red, super-thin dummy laptop that hooked up to your phone to give it a large screen and keyboard (and nothing else)? Well this is that, but done in a way that makes a lot more sense. It has 13-inch phone charger and super phone dock that also sports its own LED screen, full-sized keyboard, and Webtop App, which acts as sort of a super-light, wrap-around OS. When connected, the phone automatically goes into a sort of "computer mode" and runs a desktop operating system interface, along with complete versions of Firefox, Adobe Flash, etc. You'll be able to download PC applications just like your normal computer. The only real difference is everything is being powered by, and saved to, the Atrix. You can even run virtualized desktop client apps through it. In other words, you may never need a real desktop or laptop for your office again.