Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Professional Java for Web Applications
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Java for Web Applications
This is the forum to discuss the Wrox book Professional Java for Web Applications by Nicholas S. Williams; ISBN: 978-1-118-65646-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Java for Web Applications section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 3rd, 2018, 10:25 AM
Registered User
Points: 33, Level: 1
Points: 33, Level: 1 Points: 33, Level: 1 Points: 33, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2015
Location: Russia
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Default Ch 8,9 Customer-Support-v6/7 JspException NoClassDefFoundError FormatDateTag

I run Apache Tomcat 9, Project Structure
pom.xml
Code:
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.wrox</groupId>
	<artifactId>CustomerSupportV7</artifactId>
	<version>1.0.0.SNAPSHOT</version>
	<packaging>war</packaging>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.1.0</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>1.2</version>
		</dependency>

		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>javax.el-api</artifactId>
			<version>3.0.0</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.8</version>
			<scope>compile</scope>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat-catalina -->
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-catalina</artifactId>
			<version>9.0.11</version>
			<scope>compile</scope>
		</dependency>

		<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.2</version>
			<scope>provided</scope>
		</dependency>

		<!-- *** -->
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>jsp-api</artifactId>
			<version>6.0.53</version>
		</dependency>

	</dependencies>

	<build>
		<sourceDirectory>src</sourceDirectory>
		<plugins>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<warSourceDirectory>web</warSourceDirectory>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>
Error when create new ticket:
Code:
HTTP Status 500 – Internal Server Error
Type Exception Report

Message javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: java.lang.NoClassDefFoundError: Could not initialize class com.wrox.tag.FormatDateTag

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: java.lang.NoClassDefFoundError: Could not initialize class com.wrox.tag.FormatDateTag
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:620)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:481)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	com.wrox.TicketServlet.viewTicket(TicketServlet.java:99)
	com.wrox.TicketServlet.doGet(TicketServlet.java:47)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	com.wrox.AuthenticationFilter.doFilter(AuthenticationFilter.java:24)
Root Cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: java.lang.NoClassDefFoundError: Could not initialize class com.wrox.tag.FormatDateTag
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:664)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp._jspService(viewTicket_jsp.java:160)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:458)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	com.wrox.TicketServlet.viewTicket(TicketServlet.java:99)
	com.wrox.TicketServlet.doGet(TicketServlet.java:47)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	com.wrox.AuthenticationFilter.doFilter(AuthenticationFilter.java:24)
Root Cause

javax.servlet.jsp.JspException: java.lang.NoClassDefFoundError: Could not initialize class com.wrox.tag.FormatDateTag
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp$Helper.invoke(viewTicket_jsp.java:593)
	org.apache.jsp.tag.web.template.basic_tag$Helper.invoke2(basic_tag.java:394)
	org.apache.jsp.tag.web.template.basic_tag$Helper.invoke(basic_tag.java:418)
	org.apache.jsp.tag.web.template.main_tag.doTag(main_tag.java:206)
	org.apache.jsp.tag.web.template.basic_tag._jspx_meth_template_005fmain_005f0(basic_tag.java:201)
	org.apache.jsp.tag.web.template.basic_tag.doTag(basic_tag.java:163)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp._jspx_meth_template_005fbasic_005f0(viewTicket_jsp.java:182)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp._jspService(viewTicket_jsp.java:147)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:458)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	com.wrox.TicketServlet.viewTicket(TicketServlet.java:99)
	com.wrox.TicketServlet.doGet(TicketServlet.java:47)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	com.wrox.AuthenticationFilter.doFilter(AuthenticationFilter.java:24)
Root Cause

java.lang.NoClassDefFoundError: Could not initialize class com.wrox.tag.FormatDateTag
	sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	java.lang.reflect.Constructor.newInstance(Unknown Source)
	org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:115)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp._jspx_meth_wrox_005fformatDate_005f0(viewTicket_jsp.java:218)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp.access$1(viewTicket_jsp.java:213)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp$Helper.invoke0(viewTicket_jsp.java:559)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp$Helper.invoke(viewTicket_jsp.java:585)
	org.apache.jsp.tag.web.template.basic_tag$Helper.invoke2(basic_tag.java:394)
	org.apache.jsp.tag.web.template.basic_tag$Helper.invoke(basic_tag.java:418)
	org.apache.jsp.tag.web.template.main_tag.doTag(main_tag.java:206)
	org.apache.jsp.tag.web.template.basic_tag._jspx_meth_template_005fmain_005f0(basic_tag.java:201)
	org.apache.jsp.tag.web.template.basic_tag.doTag(basic_tag.java:163)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp._jspx_meth_template_005fbasic_005f0(viewTicket_jsp.java:182)
	org.apache.jsp.WEB_002dINF.jsp.view.viewTicket_jsp._jspService(viewTicket_jsp.java:147)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:458)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	com.wrox.TicketServlet.viewTicket(TicketServlet.java:99)
	com.wrox.TicketServlet.doGet(TicketServlet.java:47)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	com.wrox.AuthenticationFilter.doFilter(AuthenticationFilter.java:24)
Note The full stack trace of the root cause is available in the server logs.

Apache Tomcat/9.0.11
Error log in Eclipse
Code:
java.lang.NoSuchMethodException: org.apache.taglibs.standard.tag.common.fmt.SetLocaleSupport.getFormattingLocale(javax.servlet.jsp.PageContext, javax.servlet.jsp.tagext.Tag, boolean, boolean)
	at java.lang.Class.getDeclaredMethod(Unknown Source)
	at com.wrox.tag.FormatDateTag.<clinit>(FormatDateTag.java:36)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
FormatDateTag.java, line 36:
Code:
GET_LOCALE_METHOD = SetLocaleSupport.class.getDeclaredMethod(
                    "getFormattingLocale", PageContext.class, Tag.class,boolean.class,boolean.class);

Last edited by arvalon; September 3rd, 2018 at 11:33 AM..


Similar Threads
Thread Thread Starter Forum Replies Last Post
Websockets in customer support boardhobo BOOK: Professional Java for Web Applications 0 February 20th, 2018 05:22 AM
Chapter 8 Customer Support Search Function error het BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 4 February 12th, 2012 12:01 PM
Customer Support - Can't delete anything mfoof BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 21 June 24th, 2009 04:00 PM
Customer Support overdos2 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 November 30th, 2006 04:54 PM
Customer Support - Adding Second Level Category mfoof BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 July 4th, 2006 12:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.