Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 71FD0200B8B for ; Tue, 4 Oct 2016 11:27:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 706D6160AC9; Tue, 4 Oct 2016 09:27:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B6480160AC5 for ; Tue, 4 Oct 2016 11:27:39 +0200 (CEST) Received: (qmail 94756 invoked by uid 500); 4 Oct 2016 09:27:38 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 94746 invoked by uid 99); 4 Oct 2016 09:27:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Oct 2016 09:27:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3C4E8180517 for ; Tue, 4 Oct 2016 09:27:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id IsCnzN5BdFzL for ; Tue, 4 Oct 2016 09:27:36 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 5C7F85FB5B for ; Tue, 4 Oct 2016 09:27:36 +0000 (UTC) Received: from asf-bz1-us-mid.priv.apache.org (nat1-us-mid.apache.org [23.253.172.122]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTPS id 1C570E01DC for ; Tue, 4 Oct 2016 09:27:34 +0000 (UTC) Received: by asf-bz1-us-mid.priv.apache.org (ASF Mail Server at asf-bz1-us-mid.priv.apache.org, from userid 33) id 0AAC060DE6; Tue, 4 Oct 2016 09:27:33 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: [Bug 60199] New: Improve error message if a session attribute could not load due to deserialization problems Date: Tue, 04 Oct 2016 09:27:33 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 8 X-Bugzilla-Component: Catalina X-Bugzilla-Version: 8.0.37 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: igor.mukhin@gmx.de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: ---- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bz.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 archived-at: Tue, 04 Oct 2016 09:27:40 -0000 https://bz.apache.org/bugzilla/show_bug.cgi?id=60199 Bug ID: 60199 Summary: Improve error message if a session attribute could not load due to deserialization problems Product: Tomcat 8 Version: 8.0.37 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: igor.mukhin@gmx.de Again and again I find myself in searching for classes that do not implement Serializable interface but are set into session. When you have such a class you just see in the log at tomcat start that there was a problem while deserializing the session object. I would be very helpful if the log would say which attribute have caused the problem. Sample implementation StandardSession.java in doReadObject(ObjectInputStream stream): Instead of: for (int i = 0; i < n; i++) { String name = (String) stream.readObject(); Object value = stream.readObject(); if ((value instanceof String) && (value.equals(NOT_SERIALIZED))) continue; if (manager.getContext().getLogger().isDebugEnabled()) manager.getContext().getLogger().debug(" loading attribute '" + name + "' with value '" + value + "'"); attributes.put(name, value); } do: for (int i = 0; i < n; i++) { String name = (String) stream.readObject(); Object value = null; try { value = stream.readObject(); } catch (Exception e) { manager.getContext().getLogger().error(String.format("Attribute %s could not be deserialized due to %s", name, e.getMessage())); } if ((value instanceof String) && (value.equals(NOT_SERIALIZED))) continue; if (manager.getContext().getLogger().isDebugEnabled()) manager.getContext().getLogger().debug(" loading attribute '" + name + "' with value '" + value + "'"); attributes.put(name, value); } -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org