Category Archives: Eclipse

The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [31] in the generated java file: [H:\eclipseWorkspace\J2EEspace\GlossaryPortal\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\Spring3HibernateApp\org\apache\jsp\WEB_002dINF\views\]
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory


The below line from the generated java file causing the issue from _jspInit() method

_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();

Previous to this exception, I was facing the below exception

java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

To resolve this, I have downloaded the following JAR files from the web and placed it in /WEB_INF/lib folder

1) jsp-api-2.0.jar
2) jstl-1.2.jar

But you know, the jsp-api-2.0.jar is now lead to the exception “The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory”.


We should refer the target runtime in our project, not copy some libraries of an arbitrary servletcontainer make/version into our project. It would make our project incompatible with servletcontainers of a different make and/or version.

As simple, if you are using Tomcat 7 as server, then refer the jsp-api.jar from your Tomcat home directory’s lib folder. Don’t arbitrarily download some container version’s jsp=api file.

The project jar files should compatible with your servlet containers, which is the Tomcat Server that you are using as the Target Runtime.


You need to reference a server runtime in your project.

In Eclipse:

1) Choose “Project | Properties | Java Build Path | Libraries Tab”
2) Click “Add Library | Server Runtime | Apache Tomcat 7”
3) Click OK.
4) Clean your project, and build it again (“Project | Clean”, then “Project | Build All”)

That should do it!

Happy Learning 🙂


Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver

I am trying to connection my java web application to the Oracle9i database.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/config/sdnext-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]


Make sure you have the ojdbc14.jar in your run time classpath.

Download the same from

Happy Learning 🙂

java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log;

Caused by: java.lang.NoClassDefFoundError: Lorg/apache/commons/logging/Log;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at org.apache.catalina.util.Introspection.getDeclaredFields(
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(
at org.apache.catalina.startup.ContextConfig.configureStart(
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
at org.apache.catalina.core.StandardContext.startInternal(
at org.apache.catalina.util.LifecycleBase.start(
... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.Log
at org.apache.catalina.loader.WebappClassLoader.loadClass(
at org.apache.catalina.loader.WebappClassLoader.loadClass(
... 20 more


Adding the commons-logging.jar to the class path will solve the problem.

Download the same from

Happy Learning 🙂

SEVERE: Servlet /Spring3HibernateApp threw load() exception java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

I was working on the Spring MVC example. When I deployed my Spring web application into the Apache Tomcat 7 server, I end up with the following exception

Oct 12, 2014 8:24:01 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /Spring3HibernateApp threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(
at org.apache.catalina.loader.WebappClassLoader.loadClass(
at org.apache.catalina.core.DefaultInstanceManager.loadClass(
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(
at org.apache.catalina.core.DefaultInstanceManager.newInstance(
at org.apache.catalina.core.StandardWrapper.loadServlet(
at org.apache.catalina.core.StandardWrapper.load(
at org.apache.catalina.core.StandardContext.loadOnStartup(
at org.apache.catalina.core.StandardContext.startInternal(
at org.apache.catalina.util.LifecycleBase.start(
at org.apache.catalina.core.ContainerBase$
at org.apache.catalina.core.ContainerBase$
at Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)


ClassNotFoundException should always makes you to think “JAR is missing”. That is, the eclipse could not able to locate the class file ‘DispatcherServlet” here. The ClassNotFoundException clearly indicates that you are missing org.springframework.web.servlet classes.

So make sure the Spring MVC JAR files is available in the classpath. The Spring JARs and all their dependencies should be in your /WEB-INF/lib.

Add all JAR files in the Project build path, which is, Right-click on Project -> Properties -> Java Build Path -> Libraries. Add all external JARS as like either user library or web app libraries. Click on “Add External JARs” to add all the JAR files.

Even after this, if the exception occurs, try the below instructions

1) Project Properties -> Deployment Assembly
2) Add -> Java Build Path Entries
3) You should now see the list of libraries on your build path that you can specify for inclusion into your finished WAR.
4) Select the ones you want and hit Finish.

Happy Learning 🙂

eclipse.exe is not a valid Win32 application

Recently, I have downloaded the eclipse IDE for Java EE Developers package from

I have downloaded the Eclipse’s Windows 64-bit package version as I have windows XP operating system with x86 processor.  In Eclipse website, they provide 32 bit and 64 bit version of eclipse packages.  I am not sure which one to download.  I blindly downloaded 64 bit eclipse package and unzipped in my machine.

When I try to run the eclipse.exe, I got an error message “eclipse.exe is not a valid Win32 application”.

It means that the eclipse instance’s bit version does not match with the installed JVM’s bit version. To resolve this issue, we need to identify whether the installed JVM runs on 32 bit or 64 bit windows version.

Refer the following link to identify what is the bit version installed JVM supports,

We get error message if the Java instance does not support the desired version.

Based on that, we can download the right eclipse bit version package.  I have identified that my JVM runs on 32 bit version. So I have downloaded the Eclipse’s windows 32-bit version package.  Finally, the issue has been resolved.  🙂

what is the difference between Eclipse Europa and Ganymede?

It is all about versions

Here’s a quick reference on Eclipse releases and names.

3.0 28 June 2004
3.1 28 June 2005
3.2 Callisto 30 June 2006
3.3 Europa 29 June 2007
3.4 Ganymede 25 June 2008
3.5 Galileo 24 June 2009
3.6 Helios 23 June 2010
3.7 Indigo 28 June 2011

If you see “letters” in conjunction with a version number, this is what they mean:

On click of submit button, Servlet has been called twice. Why?

This can happen if you are calling the javascript function which does document.formName.submit() but the form itself also has an action attribute. Therefore, the form actually gets submitted twice. If you are submitting the page from the javascript, remove the action attribute from the form tag.

if javascript function does document.formName.submit(),

Ensure that the <input type = “submit”> should not be used in <form></form>

In the following, it is reverse

I used <input type = “submit”> in <form></form> but removed the document.formName.submit() from javascript function.


function callValidation()
if( validateDetails() )
document.frmLoadEmpDetails.action = “/DailyActivityLogger/TimeSheetRecorder”;

<form name=”frmTimeSheet”>



how to define classpath for eclipse

Right click on a Project. Go Properties->Java Build Path. The Projects tab is for selecting other Projects the current Projects depends on - i.e. needs the class files. The Libraries tab is for adding external jars or creating and adding Eclipse libraries (which are a collection of jars).

When you're done setting it up you can look at the .classpath file in the Project root directory to see what you've done. But don't edit this file directly.

eclipse.exe has encountered a problem and needs to close.

Are you receiving the following window while launching eclipse.exe,


you need to supply the path to the java executable in the vm parameter, not the path to the directory containing the executable.  For example, Try something like “C:\Java\jre1.6.0_02\bin\javaw.exe” for -vm parameter in eclipse.ini file.

If you are planning on doing Java development in Eclipse, it is recommended that you point at a jdk and not a jre so that you can have source attached to the runtime library classes/methods.

In the end, If nothing works, reinstall Java (jdk) and launch eclipse.exe.  100% it will work.

Other ways:

1. Try installing it into a clean directory (rather than on top of an existing Eclipse install).

2. here’s an eclipse.ini may works:


3. you can try launching the jar that opens Eclipse App.
In my case it was the file
“java -jar plugins/org.eclipse.equinox.launcher_1.0.0.v20070208a.jar”

4. Here is the eclipse.ini works for me

For more information,