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 Search this Thread Display Modes
  #1 (permalink)  
Old December 30th, 2014, 04:49 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Problem with Ch 14+ chat in Tomcat 8/IntelliJ

Starting with Chapter 14's version of the Customer Support application (v11), I'm running into an error whenever I use the "Disconnect" button to close a chat session. I'm using Tomcat 8.0.15 (though I also saw it with 8.0.9) and IntelliJ 14, with the project source code unchanged from the download.

Based on the stacktrace and some basic debugging, it looks like maybe the this.wsSession.isOpen() call on line 251 is incorrectly returning true, even though the session has already been closed by the JavaScript call? Or am I missing something?

Here's the stacktrace:

Code:
30-Dec-2014 15:08:11.406 SEVERE [http-apr-8080-exec-5] org.apache.tomcat.websocket.pojo.PojoEndpointBase.onClose Failed to call onClose method of POJO end point for POJO of type [com.wrox.site.chat.ChatEndpoint]
 java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.tomcat.websocket.pojo.PojoEndpointBase.onClose(PojoEndpointBase.java:107)
	at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:508)
	at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:491)
	at org.apache.tomcat.websocket.WsFrameBase.processDataControl(WsFrameBase.java:342)
	at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:284)
	at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:130)
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:203)
	at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:194)
	at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:653)
	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2407)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2396)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Message will not be sent because the WebSocket session has been closed
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:378)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:335)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:264)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase$WsOutputStream.doWrite(WsRemoteEndpointImplBase.java:916)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase$WsOutputStream.close(WsRemoteEndpointImplBase.java:911)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendObjectByCompletion(WsRemoteEndpointImplBase.java:570)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendObjectByFuture(WsRemoteEndpointImplBase.java:532)
	at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendObject(WsRemoteEndpointImplBase.java:513)
	at org.apache.tomcat.websocket.WsRemoteEndpointBasic.sendObject(WsRemoteEndpointBasic.java:74)
	at com.wrox.site.chat.ChatEndpoint.close(ChatEndpoint.java:255)
	at com.wrox.site.chat.ChatEndpoint.onClose(ChatEndpoint.java:163)
	... 22 more
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Ch 14 Page 485 Try-It-Out problem ken evans BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 January 17th, 2010 07:23 AM
Toolbar problem in Horton VC++ 2008 Ch. 14 tedkurtz Visual C++ 1 November 9th, 2009 04:46 PM
Tomcat 6 and IntelliJ 6.0.5 plutes Apache Tomcat 0 April 8th, 2007 11:14 PM
Ch 14 AdNew.asp example - Acess permission problem pycockd BOOK: Beginning ASP 3.0 4 February 7th, 2006 06:36 PM
CH. 14 cart.php code problem shawnrberg BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 21st, 2004 05:44 PM



All times are GMT -4. The time now is 12:07 AM.


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