Posts

Cloud Elasticity or Scalability, Whats the Difference?

I have heard and read at lot of places about Elasticity and Scalability of the cloud. In a discussion the point came across that what actually is the difference between Elasticity and the Scalability, when it comes to cloud. I myself could not find the demarcation, so I searched around the web. But to my surprise lot of people on the articles conviniently use Elasticity and Scalability interchangeably in relation the cloud. After reading around I could not find the answer, so I though to put my own thoughts since I dont agrre that both is same and let people decide if my understanding is right or not. What means by Elasticity in relation to cloud is that it could scale up or down the infrastructure to meet the requirement. Elasticity is about instantly bringing you the necessary resource when you need it and instantly decommission them when you don't need it. Elasticity is an important feature of the cloud offering as you are charged only during the time when you are using it. Sc...

Unable to load default SVN client

While installing the subversion plugin Subclipse in the Eclipse IDE I came across a problem. Subclipse uses "JavaHL (JNI)" to interface with subversion by default. Initially I was getting the following error message when accessing Windows->Preferences->Team->SVN->SVN Interface dropdown: JavaHL (JNI) Not Available When attempting to view a repository via the "SVN Repository Exploring" perspective I got a different error message: Unable to load default SVN client So I installed the below package sudo apt-get install libsvn-java Still the problem continued and I realized that I need to provide the liberary to Eclipse (3.6 Helios) I choose to set the path to the JavaHL libraries via a command line argument. I accomplished this by setting my Launcher icon for Eclipse to use the command /path/to/eclipse -vmargs -Djava.library.path=/usr/lib/jni Another option is to set the LD_LIBRARY_PATH environment variable to point to the /usr/lib/jni in your .profile file. ...

What is Web 2.0?

I know the article is too late. We are done with all type of definitions and I am now talking about it. I planned to write a five second explanation is because I keep bumping into this question and believe me there are numerous definitions poured on the person asking this question and he is looked upon as if he does not know what internet is but finally in the end of the discussion the person asking the question still does not have the answer. Even I came to know the answer pretty late and after some drilling on internet for the definition. Here's my take on it: Although the term Web 2.0 suggests a new version of the World Wide Web, it does not refer to new technology but rather to cumulative changes in the ways software developers and end-users use the Web World Wide Web inventor Tim Berners-Lee clarifies, "I think Web 2.0 is, of course, a piece of jargon; nobody even knows what it means. If Web 2.0 for you is blogs and wikis, then that is 'people to people.' But that...

Hibernate + Spring + MySql: Cannot convert value '0000-00-00 00:00:00' from column X to TIMESTAMP

Image
When I was trying to load an Hibernate object, I received the following error: nested exception is java.sql.SQLException: Cannot convert value '0000-00-00' from column 4 to TIMESTAMP. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQL This exception means that the column "X" has an invalid date "0000-00-00 00:00:00" According to http://bugs.mysql.com/bug.php?id=13030 "Datetimes with all-zero components ('0000-00-00 ...') - These values can not represented reliably in Java. Connector/J 3.0.x always converted them to NULL when being read from a ResultSet. When working with MySQL over JDBC and the driver encounters a zero DATE, TIME, or DATETIME value (that is, e.g, ‚0000–00–00‘ for DATE), this exception is thrown. This can be handled by adding the JDBC Parameter: zeroDateTimeBehavior=convertToNull to your JDBC connection. url=jdbc:mysql://localhost/test?connectTimeout=60000&autoReconnect=true&ze...

Hibernate: a different object with the same identifier value was already associated with the session

People working with Hibernate might be familiar with the below error. org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session This exception is generated when we try to load an instance object in session which has been already loaded by hibernate. Easier said than done. Hibernate considers two persistent entities identical if the two rows of the table can be said identical. Above error could be generated in many ways and there may be various solutions on net like using session merge etc to get away with the problem. I will discuss here the reason for me getting this problem and the way I resolved it. Below is the code which generated the exception for me. Following is the method which caused the exception @Transactional(propagation=Propagation....

Context initialization failed - java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

I received the following error while running a Spring and Hibernate application Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/ applicationContext.xml ]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder at org.slf4j.LoggerFactory. (LoggerFact...

org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

This Exception during the maven build in an hibernate based project could come due to various reasons. Primarily one should look into the complete stack trace. The further exception usually do give clue of the actual problem. I my case, the stack trace revealed the below issue Exception in thread "main" org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer] at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110) at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping. (EntityEntityModeToTuplizerMapping.java:80) at org.hibernate.tuple.entity.EntityMetamodel. (EntityMetamodel.java:323) at org.hibernate.persister.entity.AbstractEntityPersister. (AbstractEntityPersister.java:456) at org.hibernate.persister.entity.SingleTableEntityPersister. (SingleT...