On Dec 14, 2007 9:54 AM, mfs <[EMAIL PROTECTED]> wrote:
>
> hmm..but should it do that?...its not an instance within the form, i mean
> we'll be invoking the service layer from within the form.onsubmit (most of
> the times) event, and that would require all the service or other classes
> invoked to be made serializable..

yes it should. this is how anonymous classes work.

> Whats the work around, i wouldnt want the service class (or perhaps any
> other class) be made serializable without a reason..

the work around is to pass in a locator that can be serialized without
serializing the dependency yet knows how to look it up when it is
needed. kinda like a serializable lookup. this is what wicket's
@SpringBean proxies do. the other option is to have that service
available via a static lookup.

-igor


>
>
> Thanks in advance
>
>
>
> igor.vaynberg wrote:
> >
> > your form anonymous class keeps the ref to your login svc instance
> >
> > -igor
> >
> > On 12/13/07, mfs <[EMAIL PROTECTED]> wrote:
> >>
> >> Ok...so here is the LoginPanel class...with the constructor i was
> >> referring
> >> to .. further the implementation for I_LoginService (i.e.
> >> LoginService...on
> >> which the serializable error is pointing to) is being passed over from
> >> the
> >> caller component...
> >>
> >>
> >> public class LoginPanel extends Panel {
> >>
> >>      LoginVO loginVO = null;
> >>
> >>      public LoginPanel(String id, final String targetPage, final
> >> I_LoginService
> >> loginServiceHandler) {
> >>              super(id);
> >>              loginVO = new LoginVO();
> >>              setModel(new CompoundPropertyModel(loginVO));
> >>
> >>              Form loginForm = new Form("loginForm") {
> >>                      protected void onSubmit() {
> >>                                      
> >> loginServiceHandler.authenticate(loginVO.getUserName(),
> >> loginVO.getPassword());
> >>                      }
> >>              };
> >>
> >>              loginForm.add(new RequiredTextField("userName"));
> >>              loginForm.add(new PasswordTextField("password"));
> >>
> >>              Button loginButton = new Button("loginButton") {
> >>                      public void onSubmit() {
> >>                      }
> >>              };
> >>
> >>              loginForm.add(loginButton);
> >>              add(loginForm);
> >>
> >>      }
> >>
> >>
> >>
> >> mfs wrote:
> >> >
> >> > Guys,
> >> >
> >> > Not sure why, but wicket is giving me an error "Field that is not
> >> > serializable" on one of constructor attributes (of a panel) which is an
> >> > implementation to an interface...i wonder why is that ? The attribute
> >> is
> >> > not used as a model or anything its just a serviceHandler which i am
> >> > passing to the page-component.
> >> >
> >> > Error log
> >> > ----
> >> >
> >> >             private final org.xyz.login.api.I_LoginService
> >> > org.xyz.login.web.LoginPane
> >> > l$1.val$loginServiceHandler [class=org.xyz.service.LoginService] <-----
> >> > field that is
> >> > not serializable
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:347)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:393)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:393)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.SerializableChecker.writeObjectOverride(SerializableChecker.jav
> >> > a:683)
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:298)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.IObjectStreamFactory$1.writeObjectOverride(IObjectStreamFactory
> >> > .java:74)
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:298)
> >> >         at
> >> >
> >> org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1103)
> >> >         at
> >> >
> >> org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageSto
> >> > re.java:200)
> >> >         at
> >> >
> >> org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(DiskPageStore.java:700)
> >> >
> >> >         at
> >> >
> >> org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.put(
> >> > SecondLevelCacheSessionStore.java:340)
> >> >         at org.apache.wicket.Session.requestDetached(Session.java:1412)
> >> >         at org.apache.wicket.RequestCycle.detach(RequestCycle.java:957)
> >> >         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1195)
> >> >         at
> >> org.apache.wicket.RequestCycle.request(RequestCycle.java:500)
> >> >         at
> >> >
> >> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:261)
> >> >         at
> >> >
> >> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:126)
> >> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> >> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >> >         at
> >> >
> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
> >> > ava:290)
> >> >         at
> >> >
> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> >> >
> >> >         at
> >> >
> >> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
> >> >         at
> >> >
> >> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> >> >         at
> >> >
> >> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> >> >         at
> >> >
> >> org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
> >> >         at
> >> >
> >> org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:209)
> >> >         at
> >> >
> >> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
> >> >         at
> >> >
> >> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> >> >         at
> >> >
> >> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
> >> >         at
> >> >
> >> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> >> >         at
> >> >
> >> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja
> >> > va:581)
> >> >         at
> >> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> >> >         at java.lang.Thread.run(Thread.java:595)
> >> > Caused by: java.io.NotSerializableException:
> >> > taxcient.registration.service.LoginService
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> >> >         at
> >> > java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> >> >         at
> >> > java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
> >> >         at
> >> >
> >> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> >> >         at
> >> > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
> >> >         at
> >> >
> >> org.apache.wicket.util.io.IObjectStreamFactory$1.writeObjectOverride(IObjectStreamFactory
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Getting-Error-%22Field-not-serializable%22-on-one-of-the-constructor-attrib---tp14327323p14328035.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Getting-Error-%22Field-not-serializable%22-on-one-of-the-constructor-attrib---tp14327323p14339719.html
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to