Four in 10 Small Businesses Planning Cloud Computing, Says Microsoft

About Cloud Computing:

The term “cloud” is used as a metaphor for the internet, but what happens when you combine it with “computing?” Cloud computing makes infrastructure, applications, and business processes accessible entirely on the internet without breaking your budget or cloning your IT department.


Almost 40 percent of SMEs expect to be paying for one or more cloud services within three years, according to a Microsoft report.

View the full article on Four in 10 Small Businesses Planning Cloud Computing, Says Microsoft here

What is Cloud Computing and how does it work?

The term “cloud” is used as a metaphor for the internet, but what happens when you combine it with “computing?” Cloud computing makes infrastructure, applications, and business processes accessible entirely on the internet without breaking your budget or cloning your IT department.

The Picture below Illustrates the Cloud Computing Architecture.

http://www.wifinotes.com/img/cloud_computing.jpg

How it Works:
When a user accesses the cloud for a popular website, many things can happen. The user's IP for example can be used to establish where the user is located (geolocation). DNS services can then direct the user to a cluster of servers that are close to the user so the site can be accessed rapidly and in their local language. The user doesn't login to a server, but they login to the service they are using by obtaining a session id and/or a cookie which is stored in their browser.

Online resources for Cloud Computing:

http://en.wikipedia.org/wiki/Cloud_computing
http://cloudcomputing.sys-con.com/node/579826

What is CICS (Customer Information Control System)

CICS (Customer Information Control System) is an online transaction processing (OLTP) program from IBM that, together with the COBOL programming language, has formed over the past several decades the most common set of tools for building customer transaction applications in the world of large enterprise mainframe computing

IBM markets or supports a CICS product for OS/390, UNIX, and Intel PC operating systems. Some of IBM's customers use IBM's Transaction Server to handle e-business transactions from Internet users and forward these to a mainframe server that accesses an existing CICS order and inventory database.

Debugging an application that is running in a CICS JVM

PDA consists of the following layered APIs:
Java Debug Interface (JDI)
This is a Java programming language interface providing support for remote debugging. This is the highest level interface in the architecture, and can be used to implement a remote debugger user interface without having to write any code that runs in the application JVM or understand the protocol between the debugger and the JVM. Most third party debuggers that support JPDA currently use this API.
Java Debug Wire Protocol (JDWP)
This API defines the format of the flows that run between the application JVM and the debugger user interface. This protocol is for use by debuggers that need to exploit the communication at a lower level than the JDI, and for JVM suppliers or more advanced debugger developers who need to support the standard connection architecture from the application JVM side.
Java Virtual Machine Debug Interface (JVMDI)
This is a low-level native interface within the JVM. It defines the services a Java virtual machine must provide for debugging, and can be used by advanced debugger developers who wish to implement debugger code that runs inside the application JVM ( to implement an alternative transport mechanism for debugger connection, for example).
When you start the JVM in debug mode, the JVMDI interface is activated and additional threads are started in the JVM. One of these threads handles communication with the remote debugger, the others monitor the application that is running in the JVM. You can issue commands in the remote debugger, for example to set break points or to examine the values of variables in the application. These commands are activated by the listener and event handler threads in the JVM.

System.currentTimeMillis() | Sleep Less Than One Millisecond

The issue was with the following code snippet:

MyEntity a = new MyEntity();
        a.setUid("foo" + System.currentTimeMillis());
        a.setName("my entity");
        entityService.save(a);
As a general rule of thumb, it is a bad idea to rely on currentTimeMillis() to have a millisecond-resolution on windows, especially if you are using it to generate unique things like file names or db IDs. Looks like System.nanoTime() might tick faster.

Here are some links I found on StackOverflow about this:

ClassNotFoundExceptions in Eclipse WTP, Maven, Tomcat

Lately, I've been struggling off and on with ClassNotFoundExceptions when starting tomcat from within Eclipse (Springsource Tool Suite, to be exact). My projects are all dependency-managed by the Maven m2eclipse plugin (side note: its really important to install the m2eclipse WTP add-on, found here: http://m2eclipse.sonatype.org/sites/m2e-extras so that the web dependencies are all configured correctly).

Anyways, I would tend to encounter this error after restarting Eclipse. When I would investigate, by looking into the [tomcat_home]/wtpwebapps/[app]/WEB-INF/lib folder, it would of course be empty (hence, class not found). I would always flail about aimlessly for hours until it would magically start working again.

I have in the past week discovered a new trick, which has worked *both* times I've tried it: when I got the class not found error, I stopped tomcat, right clicked on my project in the Package Explorer, and clicked Maven -> Update Dependencies. For whatever reason, this caused WTP to publish the dependent jars into WEB-INF/lib, and everything worked again

Remote Debugging JVM Applications |Remote Debugging Tomcat & JBoss Apps with Eclipse

The JVM provides a useful feature called the Java Platform Debugger, or JPDA. When enabled via startup options, it provides a port through which debuggers (e.g. Eclipse) are able to connect and do their thing. This allows you to debug practically any application, such as Tomcat, or in my case, WebTest (running inside of an Ant process).

There are a bunch of available options for JPDA, but here is the basic incantation:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8008
  • jdwp: Java Debug Wire Protocol
  • transport: indicates that debuggers should attach using sockets, as opposed to the other option, which is shared memory (dt_shmem)
  • server: when 'y', listens for a debugger application to attach (otherwise, attempt to connect to the specified debugging instance)
  • suspend: the JVM should wait for a debugger application to attach before starting up
  • address: the port to expose for debugger applications (or address to connect to in order to debug)

*Note: you may have seen a different set of arguments for starting a JVM in debug mode:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8008
This is required for Java versions < 5.

You can find a full list of options here.

Now that you have your application faithfully waiting for you to debug it ('Listening for transport dt_socket at address: 8008'), you just have to set up a remote debug configuration in Eclipse and run it:
  1. Run > Debug Configurations... > new Remote Java Application
  2. Connection Type: Standard (Socket Attach)
  3. Connection Properties: host and port of JDWP application
  4. Allow termination of remote VM: if selected, when you are finished with the debugger and click the terminate button in Eclipse, the remote application will exit also

The JVM exits unexpectedly when requesting a thread dump

Question:
When I request a thread dump by pressing CTRL-BREAK, CTRL-\, or via the API, I get the following message in the log and the JVM is restarted:

Message:
wrapper  | JVM exited unexpectedly.
                 Solution:
Please make sure that you have not specified the -Xrs flag when launching the JVM. This flag is useful in some environments when using Java without the Wrapper. But it compromises the Wrapper's ability to respond to the the various system signals.
To tell the Wrapper and thus it's JVM to ignore system signals, use the wrapper.ignore_signals property instead. Make sure you have read the document first.

How to get original exception object from inside a nested or wrapped Exception (for example an EJBException or RemoteException)

  • When you have an javax.ejb.EJBException, you can use the getCausedByException() that returns a java.lang.Exception.
  • A java.rmi.RemoteException there is a public field called detail of type java.lang.Throwable
  • With a java.sql.SQLException you need to use the method getNextException() to get the chained java.sql.SQLException.
  • When you have an java.lang.reflect.InvocationtargetException, you can get the thrown target java.lang.Throwable using the getTargetException() method.
As usual, the best way to check how to get that piece of information is to read the documentation of the specific Exception.

weblogic.rjvm.PeerGoneException in JVM Runtime

weblogic.rjvm.PeerGoneException

Most users experience the below error in the Weblogic and JVM machines
weblogic.rjvm.PeerGoneException: ; nested exception is:
java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
java.io.InvalidClassException: com.sybase.jdbc2.tds.SybTimestamp; local class incompatible: stream classdesc serialVersionUID = 4038526507615253075, local class serialVersionUID = -4859870295624974195
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:191)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:315)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:250)
at com.bankofny.gdoasis.payment.ejb.PaymentCalculationManagerRemoteEJB_suyjh6_EOImpl_910_WLStub.rollInterestPeriod(Unknown Source)
at com.bankofny.gdoasis.batch.payment.RollInterestPeriod.main(RollInterestPeriod.java:96)
Caused by: java.rmi.UnmarshalException: Incoming message header or abbreviation processing failed ; nested exception is:
java.io.InvalidClassException: com.sybase.jdbc2.tds.SybTimestamp; local class incompatible: stream classdesc serialVersionUID = 4038526507615253075, local class serialVersionUID = -4859870295624974195
at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:430)
at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:362)
at weblogic.socket.AbstractMuxableSocket.dispatch(AbstractMuxableSocket.java:359)
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:851)

Reason:
This is due to invalid class compatibility. May be you are using the two different versions of classes. one at server side and another at your client side. please make sure both are having the SerialVersion Id's.

java.lang.OutOfMemoryError: Java heap space Exception in Java

Question java.lang.OutOfMemoryError: Java heap space
What does this error mean and how can I correct it?  

It means that the JVM has run out of all the memory that has been allocated to it. You can change the amount of memory allocated for use by your JVM using the -Xms and -Xmx command line parameters.

For example, the following says run MyApp in a JVM and allocate a minimum of 5 Megabytes and a maximum of 15 Megabytes off of the heap in order to do so.

   java -Xms5m -Xmx15m MyApp  

In tomcat the heap size can be passed to the java here.
"$_RUNJAVA" -Xmx512M $JAVA_OPTS $CATALINA_OPTS