java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

December 4, 2009

Problem:
Null ModelAndView returned to DispatcherServlet with name ”: assuming HandlerAdapter completed request handling

Solution:

When I was working with this exception, I found something wierd happening in Spring Annotations. The following happened:

In my spring-servlet.xml file, I had not included the following lines

Still, I was able to work with all annotations like @Repository,@Controller,@Service,@RequestMapping and the like.

But the absence of these lines in the xml file resulted in this eexception since Spring was not able to decipher the annotation @RequestParams

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

December 1, 2009

<strong>Problem:</strong>
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory error on trying to run a hibernate application with logger implemented

<strong>Solution:</strong>

Download the couple of files from http://www.slf4j.org/dist/ and add it to your classpath to solve the problem

slf4j-api-1.5.2
slf4j-jcl-1.5.2

java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager

December 1, 2009

Problem:

java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/ReflectionManager

Solution:

Just include the following file in classpath and your problem would get resolved.

hibernate-annotations-3.4.0.GA\hibernate-annotations-3.4.0.GA\lib\hibernate-commons-annotations

PostgreSQL Error: Relation does not exist

November 30, 2009

<strong>Problem:</strong>

CREATE TABLE tutorials (
         id INT NOT NULL PRIMARY KEY default nextval(‘public.TUTORIALS_ID_SEQ’),
         name VARCHAR(100),
         description TEXT,
         key_text TEXT,
         use_text TEXT,
         done_text TEXT

       );

ERROR:  relation “public.tutorials_id_seq” does not exist

<strong>Solution:</strong> PostgreSQL automatically converts everything to lower case and hence the problem. Change the query to CREATE TABLE “TUTORIALS” (
         “ID” INT NOT NULL default nextval(‘”TUTORIALS_ID_SEQ”‘),
         name VARCHAR(100),
         “DESCRIPTION” TEXT,
         “KEY_TEXT” TEXT,
         “USE_TEXT” TEXT,
         “DONE_TEXT” TEXT,
         CONSTRAINT “PK_Tutorials” PRIMARY KEY (“ID”)

       );
and this works fine. Either the sequence name can be within double quotation or the query can be modified to accommodate constraints

LifecycleException: No UserDatabase component found under key UserDatabase

November 30, 2009

Problem:

When I installed tomcat 6.0.20 and started tomcat server, after adding a few lines to tomcat-users.xml, by using sysdeo plugin from eclipse europa 3.3.2, I got the following error and tomcat 6.0.20 server failed to start.

Nov 30, 2009 2:30:47 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\MyInstallations\SUN\JDK1.5\jdk\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\MyInstallations\SUN\JDK1.5\jdk\jre\bin\client;C:\MyInstallations\SUN\JDK1.5\jdk\jre\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\MyInstallations\SUN\JDK1.5\bin;C:\MyInstallations\SUN\JDK1.5\jdk\jre\bin;.;
Nov 30, 2009 2:30:47 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Nov 30, 2009 2:30:47 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 387 ms
Nov 30, 2009 2:30:47 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 2 column 1: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocumentScannerImpl.java:899)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1663)
    at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:402)
    at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
    at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 30, 2009 2:30:47 PM org.apache.naming.NamingContext lookup
WARNING: Unexpected exception resolving reference
org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1269)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1663)
    at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:402)
    at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
    at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 30, 2009 2:30:47 PM org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans
SEVERE: Exception processing Global JNDI Resources
javax.naming.NamingException: Content is not allowed in prolog.
    at org.apache.naming.NamingContext.lookup(NamingContext.java:805)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
    at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
    at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
    at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 30, 2009 2:30:47 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 30, 2009 2:30:47 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
Nov 30, 2009 2:30:47 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 2 column 1: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(XMLDocumentScannerImpl.java:899)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1663)
    at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:402)
    at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:253)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 30, 2009 2:30:47 PM org.apache.naming.NamingContext lookup
WARNING: Unexpected exception resolving reference
org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1269)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1663)
    at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:402)
    at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
    at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
    at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:253)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 30, 2009 2:30:47 PM org.apache.catalina.realm.UserDatabaseRealm start
SEVERE: Exception looking up UserDatabase under key UserDatabase
javax.naming.NamingException: Content is not allowed in prolog.
    at org.apache.naming.NamingContext.lookup(NamingContext.java:805)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
    at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:253)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 30, 2009 2:30:48 PM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start:
LifecycleException:  No UserDatabase component found under key UserDatabase
    at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:261)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 30, 2009 2:30:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 101 ms

Solution:

After researching for around 2 hours over the Internet, I found the fix to be the following:

Since I had added a few entries to tomcat-users.xml, the format had changed and hence I had to change the following entry in this file for me to get rid of this error

<?xml version=’1.0′ encoding=’utf-8′?>

corrected to

<?xml version=’1.0′ encoding=’utf-16′?>

This resolved the error completely!

Jillu in PattuPavadai

November 24, 2009

Dear Harini,

For almost the past three years, I have been yearning to write something here, but never had the time to. And at last, I decided to start the scribbling here today for I fully believe that this would be a lifetime memory throughout our lives.

I had brought 4 of your such outfits to USA, but have never been using it here. So, we thought that its high time you wear this and I would get a photo of you in this outfit. Here it it and I happen to take this a couple of days back when the climate was sunny and we had decided to go to the play area near by our Crown’s Colony apartment.

As soon as I made you to wear this, you wanted to change this dress of yours for you felt it to be completely uncomfortable. I convinced you to wear this outfit till dad came home. So you agreed to wear it and we had a nice time at the play area near by!

Solve ‘OUT OF RANGE! PC DISPLAY SETTINGS CORRECT?’ Problem in Your XP Machine!

August 3, 2009

There might be times when your PC suddenly blanks out giving you a pop up in the center stating

OUT OFF RANGE

H: 31-54 Hz
v: 50-99 Hz

PC DISPLAY SETTINGS CORRECT?

At this point, when you don’t even press any key, it again blanks out! This is really irritating. But, it is pretty easy to get out of this.

SOLUTION: Restart your PC in safe mode. Go to Control Panel. Click on ‘System’. In the pop up that comes up, go to the ‘Hardware’ tab and select ‘Display Adapters’.

You would be able to see an entry there. Right click on it and click on ‘uninstall’. Once you do this, go ahead and restart your machine as usual. The display adapter gets detected automatically and you would be able to see your computer screen again!

Sit back and relax! You have got rid of the problem now! That was pretty simple!isn’t it?

Hello world!

August 1, 2009

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!