Skip to main content

Posts

Struts Exceptions during development

javax.servlet.ServletException: Wrapper cannot find servlet class org.apache.struts.action.ActionServlet or a class it depends on org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Unknown Source) root cause java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) org.apache.coyote....

Using Struts 1.x without tld files

These are the "tag library descriptor" files that describe the custom tags in the various Struts tag libraries. The tld file for any Struts taglibs that you use should be copied into the WEB-INF directory of your web application. (Applications under Servlet 2.3 containers can omit this step if the standard uri is referenced.) That can be achieved as follows. For Servlet 2.3/2.4 containers only: The Servlet 2.3 and 2.4 specifications simplify the deployment and configuration of tag libraries. The instructions above will work on older containers as well as 2.3 and 2.4 containers (Struts only requires a servlet 2.2 container); however, if you're using a 2.3/2.4 container such as Tomcat 4.x/5.x, you can take advantage of a simplified deployment. All that's required to install the Struts tag libraries is to copy struts.jar into your /WEB-INF/lib directory and reference the tags in your code like this: Note that you must use the full uri defined in the various tlds so t...

ClassNotFoundException Dispatcher Servlet in SpringMVC

Some times we may get ClassNotFoundException- Dispatcher Servlet in Spring MVC , even though we keep the spring.jar and spring-webmvc.jar using configuring the build path. The root cause of this error is your IDE expects the jars to be located physically in the lib folder. So Copy all the required jars in the lib folder, that should solve the problem.

Log4j:WARN Please initialize the log4j system properly.

Removing Log4j error You will get the following error, if you haven't kept the log4j.properties etc. file in your classpath log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. To avoid this error, please make sure that first you keep commons-logging.jar,log4j.jar in your classpath and most importantly keep log4j.properties in the classpath and keep the contenets of that as below. # Default Logging Configuration log4j.rootLogger= DEBUG, stdout #to increase logging level #log4j.logger.org.dcm4cheri=DEBUG #to decrease logging level #log4j.logger.org.dcm4cheri=ERROR log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout #log4j.appender.stdout.layout.ConversionPattern=%d{ ABSOLUTE} %-5p %x - %m\n This should resolve the log4j error.

Hibernate Tutorial

This tutorial gives an overview of Hibernate along with a Sample application. I am writing this sample without using any build tool like Ant/Maven so that any one can learn Hibernate from scratch/ Coming Soon!