• Exceptions

    Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

    NoClassDefFoundError is come when some jars or class path is missing from classpath, here commons-logging-1.1.1.jar file is not present in you path. and follow the below steps to resolve this problem:  Download the common-logging-1.1.1.jar at  http://commons.apache.org/downloads/download_logging.cgi and extract it over your hard drive. Add the jar to lib folder and then to classpath from java build path by right clicking on project , click properties and select java build path and select the libraries, now click the add jar button, search the above jar from lib and add it to your project. Build your project again if required, which is mandatory for some cases. Now enjoy the issue free application. Must Read Articles:…

    Comments Off on Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
  • Exceptions,  Interview Questions

    Out of memory exception or memoryOutofBound

    In Java Garbage collector is used internally to free the memory for JVM to work properly, and when memory is not enough for system or java application to work then exception is raised which belongs to java.lang package called OutOfMemoryError exception, If you are java developer I would doubt if you say this you never hit or get in life span. It usually comes when you not configure your content server who is managing your application or may be your application has memory leaks. Now Below I will try to explain why memory leakage is raised in application. Vector store = new Vector(); String GCnotCollected =new String(“TestString”); store.add(GCnotCollected); Until you will…

    Comments Off on Out of memory exception or memoryOutofBound
  • Exceptions,  Learn Struts,  Struts 2

    Troubleshooting – Struts2 – java.lang.NoClassDefFoundError

    Description:The tomcat server started without starting the webapp saying Listner start error. I had JEE app with Spring2.5, Struts2 and Tomcat 5.x combination. Trace:java.lang.NoClassDefFoundError: ognl/ClassResolverat com.opensymphony.xwork2.util.OgnlValueStackFactory.createValueStack(OgnlValueStackFactory.java:14)at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:55)at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)at org.apache.jsp.index_jsp._jspx_meth_s_005fhead_005f0(index_jsp.java:156)at org.apache.jsp.index_jsp._jspService(index_jsp.java:77)at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)at … Cause:The class path given in bean tag may be having incorrect path errors.Or there are some extra bean definition in applicationContext.xml which is not valid.

    Comments Off on Troubleshooting – Struts2 – java.lang.NoClassDefFoundError
  • Exceptions,  java

    java.lang.nullpointerexception cause and resolution

    Nullpointerexception is a very common exceptions, which used to come into life of developer, troubleshoot and support have got this type of error  approx. on daily basis.Did anybody used to troubleshoot this type of error and get the exact root cause for it. No, Just fix it by any means. thats it, no here i am trying to finding out a root cause for NullPointerException. CAUSE: Null in java, Not have any method into it and when we try something like: String s = null;if(s.equals(“search anything in null”)) above line will throw a nullpointerexception as null.equals() can not be run. so to avoid this type of scenerio we should always…

    Comments Off on java.lang.nullpointerexception cause and resolution
  • Exceptions,  Interview Questions,  Learn Struts,  Struts 1,  Struts 2

    org.apache.jasper.JasperException: Unable to read TLD “META-INF/tlds/struts-tiles.tld” from JAR file org.apache.jasper.JasperException: Failed to load or instantiate

    All of sudden scenarios come over where struts-tiles.xml or struts component missing from struts.jar and it is present into jar, it usually come under circumstances when migration of server took place. Issue description: org.apache.jasper.JasperException: Unable to read  TLD “META-INF/tlds/struts-tiles.tld” from JAR file <struts.jar> org.apache.jasper.JasperException: Failed to load or instantiate or files usually present struts.xml are not caught by application server at runtime. I would recommend you to please go through the following steps to resolve the issue: Step1: In case Application server is not able to render/called classes or xml and throw errors, it means two same classes or component come accross within two jars, same can be here as Tomcat and struts.jar…

    Comments Off on org.apache.jasper.JasperException: Unable to read TLD “META-INF/tlds/struts-tiles.tld” from JAR file org.apache.jasper.JasperException: Failed to load or instantiate