Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 88190 invoked from network); 22 Aug 2007 08:39:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Aug 2007 08:39:48 -0000 Received: (qmail 41618 invoked by uid 500); 22 Aug 2007 08:39:36 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 41594 invoked by uid 500); 22 Aug 2007 08:39:36 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 41583 invoked by uid 99); 22 Aug 2007 08:39:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2007 01:39:36 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hezjing@gmail.com designates 64.233.162.230 as permitted sender) Received: from [64.233.162.230] (HELO nz-out-0506.google.com) (64.233.162.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2007 08:39:36 +0000 Received: by nz-out-0506.google.com with SMTP id z31so50145nzd for ; Wed, 22 Aug 2007 01:39:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=gAe3FXqlo8HVxTs5A0l/caqsInljQb1gofrCcyYKsghsXLPFzspalFZfpoH/Db06AYbM1MaSWRxUtgIQRsTcgeRsONNDdwd8cRSJjozbS+ZY0YVTou5nC3yGJmrRyIzcW85HggC017MmrQDGP3WEoFHRD1Z0jPZq9r8njHE4ZeA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=FwUR/lDd9ZrZpzieJohiTJbASgk60AilX84kUdzXVwwQwP+vjdYEBrPDdwXJABazkUXS87dZsRuL+cbr8A0no7s2SIdv0XHZFLa3yH3xaUqvKKiSzzy/DU+Kv2G0D8YPZEj9L34ZlgOUyA0Z2qN3QuMJ+Cs6BXMTMbQH8dDr7P4= Received: by 10.142.245.10 with SMTP id s10mr16790wfh.1187771954387; Wed, 22 Aug 2007 01:39:14 -0700 (PDT) Received: by 10.143.160.12 with HTTP; Wed, 22 Aug 2007 01:39:14 -0700 (PDT) Message-ID: Date: Wed, 22 Aug 2007 16:39:14 +0800 From: hezjing To: struts-users Subject: Configuring OpenSessionInViewInterceptor as S2's interceptor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hi I'm encountering this exception (when trying to iterate a list of orders for a specific customer in JSP), failed to lazily initialize a collection of role: com.dummy.Customer.orders, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:249) at org.apache.struts2.util.MakeIterator.convert(MakeIterator.java:81) ...... I'm using Struts 2, Hibernate and Spring (for creating actions, DAOs and etc). I read that Spring's OpenSessionInViewInterceptor will resolve this problem but can you describe how to configure OpenSessionInViewInterceptor in Struts2? And, is there a better alternative than using OpenSessionInViewInterceptor? -- Hez --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org