Posts

Showing posts with the label maven

A required class was missing while executing org.mortbay.jetty:jetty-maven-plugin

When I was running the command mvn jetty:run I got the message [ERROR] Failed to execute goal org.mortbay.jetty:jetty-maven-plugin:8.1.1.v20120215:run (default-cli) on project CabShareService: Execution default-cli of goal org.mortbay.jetty:jetty-maven-plugin:8.1.1.v20120215:run failed: A required class was missing while executing org.mortbay.jetty:jetty-maven-plugin:8.1.1.v201202 15:run: org/slf4j/impl/StaticLoggerBinder My Jetty settings were org.mortbay.jetty jetty-maven-plugin 8.1.1.v20120215 com.jolbox bonecp 0.7.1.RELEASE /${project.artifactId} src/test/resources/jetty.xml true 10 ${project.artifactId}-stop 9999  The reason of the error was that the slf4j implementation was not defined. Tried setting the Logback as the one of the better implementation ( detailed post  ) . Added the following dependency in the jetty dependencies section. ...

Application logging through SLF4J : Quick Reference

The detailed information on SLF4J is available on http://www.slf4j.org . The primary reason of writing the blog is that there is lot of information but usually people do not have the time to do into the details, hense a quick reference is required to get it going. So I would be trying to put forward all the important aspects. The Simple Logging Facade for Java or (SLF4J) serves as a simple facade or abstraction for various logging frameworks, e.g. java.util.logging, log4j and logback, allowing the end user to plug in the desired logging framework at deployment time. Reason The obvious next question was that this is what JCL (Jakarta Commons Logging: http://commons.apache.org/ ) is all about. Why was the need for another facade? SLF4J does answer to few of drawbacks but there is no specific answer to why JCL was not modified. The drawbacks which are taken care as part of SLF4J are: Parameterized log messages solve an important problem associated with logging performance. Mark...

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...