Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Professional Java for Web Applications
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #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: 66%
Activity: 66% Activity: 66% Activity: 66%
 
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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Websockets in customer support boardhobo BOOK: Professional Java for Web Applications 0 February 20th, 2018 04: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 11:01 AM
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 03: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



All times are GMT -4. The time now is 01:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.