Return-Path: X-Original-To: apmail-wicket-users-archive@minotaur.apache.org Delivered-To: apmail-wicket-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D2D8BC5BB for ; Tue, 4 Jun 2013 04:31:16 +0000 (UTC) Received: (qmail 62779 invoked by uid 500); 4 Jun 2013 04:31:15 -0000 Delivered-To: apmail-wicket-users-archive@wicket.apache.org Received: (qmail 62630 invoked by uid 500); 4 Jun 2013 04:31:15 -0000 Mailing-List: contact users-help@wicket.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@wicket.apache.org Delivered-To: mailing list users@wicket.apache.org Received: (qmail 62622 invoked by uid 99); 4 Jun 2013 04:31:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jun 2013 04:31:13 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [213.199.154.20] (HELO emea01-am1-obe.outbound.protection.outlook.com) (213.199.154.20) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jun 2013 04:31:06 +0000 Received: from [192.168.171.145] (83.145.228.24) by AMSPR07MB115.eurprd07.prod.outlook.com (10.242.81.144) with Microsoft SMTP Server (TLS) id 15.0.702.21; Tue, 4 Jun 2013 04:30:43 +0000 Message-ID: <51AD6D6A.5050803@nitorcreations.com> Date: Tue, 4 Jun 2013 07:30:34 +0300 From: Edvard Fonsell Organization: Nitor Creations User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Subject: Re: Injecting proxy services in page. References: <1370264434994-4659209.post@n4.nabble.com> <000001ce6065$56b72690$042573b0$@ws> In-Reply-To: <000001ce6065$56b72690$042573b0$@ws> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [83.145.228.24] X-ClientProxiedBy: AMSPR01CA007.eurprd01.prod.exchangelabs.com (10.255.167.152) To AMSPR07MB115.eurprd07.prod.outlook.com (10.242.81.144) X-Forefront-Antispam-Report: SFV:SKI;SFS:;DIR:OUT;SFP:;SCL:0;SRVR:AMSPR07MB115;H:[192.168.171.145];LANG:en; X-OriginatorOrg: nitorcreations.com X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm not sure if this is the issue here but I've seen similar problems when I used AnnotationConfigApplicationContext as a Spring context, but got it working by using AnnotationConfig*Web*ApplicationContext. br, Edvard On 03.06.2013 17:19, Paul Bors wrote: > I find it easier to configure Spring via the XML rather than code. > > Hence I have my applicationContext.xml inside my war's WEB-INF/classes/ with > all the bean definitions and then configure Wicket via the context specific > configuration from inside my web.xml: > > > > > contextConfigLocation > classpath:applicationContext.xml > > > > persistence > > org.springframework.orm.jpa.support.OpenEntityManagerInViewFil > ter > > entityManagerFactoryBeanName > entityManagerFactory > > > singleSession > true > > > > ... > > > > org.springframework.web.context.ContextLoaderListener ner-class> > > > Whenever I need to inject a service I use Wicket's @SpringBean. > > ~ Thank you, > Paul Bors > > -----Original Message----- > From: Entropy [mailto:blmulholland@gmail.com] > Sent: Monday, June 03, 2013 9:01 AM > To: users@wicket.apache.org > Subject: Injecting proxy services in page. > > We are doing the "annotation based approach" described in this link > (https://cwiki.apache.org/WICKET/spring.html). At least, we think we are. > > We get: > [6/3/13 8:26:00:907 EDT] 00000023 SystemOut O ERROR [WebContainer : 0] > (RequestCycle.java:1521) - Could not deserialize object using > `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory` > object factory > java.lang.RuntimeException: Could not deserialize object using > `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory` > object factory > at > org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:435) > at > org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage( > AbstractPageStore.java:234) > at > org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStor > e.java:735) > at > org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCach > ePageMap.get(SecondLevelCacheSessionStore.java:310) > at org.apache.wicket.Session.getPage(Session.java:779) > at > org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage( > AbstractRequestCycleProcessor.java:458) > at > org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestC > ycleProcessor.java:144) > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) > at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) > at > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) > at > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) > at > com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstance > Wrapper.java:188) > [trimmed for brevity] > Caused by: > *java.io.InvalidClassException: gov.usdoj.afms.umc.services.LogTransService; > could not resolve class [gov.usdoj.afms.umc.services.LogTransService] when > deserializing proxy* at > org.apache.wicket.proxy.LazyInitProxyFactory$ProxyReplacement.readResolve(La > zyInitProxyFactory.java:236) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > [trimmed for brevity] > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365) > at > org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:413) > ... 39 more > > I thought this might be because that particular service is in the parent > page object and annotated there as well, but I moved it to the child class > and saw no change in behavior. It is a hibernate service and is annotated > in the page like so: > > @SpringBean(name="LogTransService") > private LogTransService userTransService; > > The exception happens when I go to the page, do a few things (which involve > submitting and redisplaying the page), and then hit the browser back button. > > This, as I understand it, causes wicket to deserialize the page from memory. > > But shouldn't it see the @SpringBean and re-inject a new service? > > Out app object does this: > addComponentInstantiationListener(new > SpringComponentInjector(this, ctx, true)); > > Ideas? > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Injecting-proxy-services-in-page- > tp4659209.html > Sent from the Users forum mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org > For additional commands, e-mail: users-help@wicket.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org > For additional commands, e-mail: users-help@wicket.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org For additional commands, e-mail: users-help@wicket.apache.org