Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread VGJ
I'm not injecting it directly.  I'm using a proxy class to get a reference
to the stateless bean's interface like so:

public class CartProxy
{
  private static ShoppingCartLocal lookupCartInterface()
  {
ShoppingCartLocal cart = null;

try
{
  InitialContext ctx = new InitialContext();
  cart =
(ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
}
catch (NamingException exp)
{
  LogProxy.saveEntry(exp);
}

return cart;
  }
}

The reference in web.xml makes this possible:

  ejb-local-ref
ejb-ref-nameShoppingCartBean/ejb-ref-name
ejb-ref-typeSession/ejb-ref-type
localcom.myapp.session.ShoppingCartLocal/local
ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
  /ejb-local-ref

Is this not supposed to work?  It's been in production for over 3 yrs...so I
hope it does!  :)

The entire app is built this way and this one page is the only one throwing
this exception.  It works, it doesn't stop the show or affect anything
negatively, so far as I can tell.  I would just like to get rid of it and
figure out what it is.

Thanks again,

-v

On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 wicket stuff contains a wicket-jee module which supports injecting ejb
 beans into wicket components the same way that wicket-spring injects
 wicket beans.

 -igor

 On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
 pieter.degrae...@systemworks.be wrote:
  Your cart has a reference to the sessionBean ShopingCart. This is not
  allowed, however. The IOC incjectionsupport makes this possible by
 wrapping
  this EJB reference with a serializable proxy.
 
  I only have expecience with wicket-spring end it works great. (In your
 case,
  define your ejb reference in spring and inject it via wicket-spring
 support
  in your page.
  problem solved!
 
  Pieter
 
  On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com wrote:
 
  I'm completely at wits end here and I hope someone can point out what's
  wrong.
 
  I've got an e-commerce application that is simply moving between two
 pages
  using setRedirectPage() when going from a product detail page to the
  shopping cart page.  There isn't anything remarkable about either of
 these
  two pages, they're basically like any other in the app.  However, when
 the
  cart page loads, I get the exception at the bottom of this message.
 
  I've tried implementing Serializable on the Cart() page class but it
 makes
  no difference.  It points out
  com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate as the
  culprit.  I use a stateful session bean (ShoppingCart) which is passed
  around the app as part of the session (custom WebSession-derived class)
 
  This is the only page this occurs on.  There are several other steps in
 the
  cart's checkout process that look exactly like this one and the
 exception
  doesn't happen on any of the others
 
  Any ideas?
 
  Exception:
 
  25717 [httpSSLWorkerThread-8080-1] ERROR
  org.apache.wicket.util.lang.Objects
  - Error serializing object class com.myapp.ui.Cart [object=[Page class =
  com.myapp.ui.Cart, id = 3, version = 0]]
 
 
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
  Unable to serialize class:
  com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
  Field hierarchy is:
   3 [class=com.myapp.ui.Cart, path=3]
 private java.lang.Object org.apache.wicket.MarkupContainer.children
  [class=[Ljava.lang.Object;]
   private
  org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper
 
 
 org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.markupHelper[6]
  [class=org.apache.wicket.markup.html.form.Form, path=3:cartForm]
 private java.lang.Object
 org.apache.wicket.MarkupContainer.children
  [class=[Ljava.lang.Object;]
   private java.lang.Object
  org.apache.wicket.MarkupContainer.children[0]
 [class=com.myapp.ui.Cart$1,
  path=3:cartForm:orderLinesView]
 final com.myapp.session.ShoppingCartLocal
  com.myapp.ui.Cart$1.val$cart [class=$Proxy92]
   protected java.lang.reflect.InvocationHandler
  java.lang.reflect.Proxy.h
  [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate]
  - field that is not serializable
 at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
 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.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:392)
 at
 
 
 org.apache.wicket.util.io.SerializableChecker.checkFields(SerializableChecker.java:615)
  

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread Igor Vaynberg
your CartProxy does not implement serialiazable so it cannot be serialized...

-igor

On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
 I'm not injecting it directly.  I'm using a proxy class to get a reference
 to the stateless bean's interface like so:

 public class CartProxy
 {
  private static ShoppingCartLocal lookupCartInterface()
  {
    ShoppingCartLocal cart = null;

    try
    {
      InitialContext ctx = new InitialContext();
      cart =
 (ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
    }
    catch (NamingException exp)
    {
      LogProxy.saveEntry(exp);
    }

    return cart;
  }
 }

 The reference in web.xml makes this possible:

  ejb-local-ref
    ejb-ref-nameShoppingCartBean/ejb-ref-name
    ejb-ref-typeSession/ejb-ref-type
    localcom.myapp.session.ShoppingCartLocal/local
    ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
  /ejb-local-ref

 Is this not supposed to work?  It's been in production for over 3 yrs...so I
 hope it does!  :)

 The entire app is built this way and this one page is the only one throwing
 this exception.  It works, it doesn't stop the show or affect anything
 negatively, so far as I can tell.  I would just like to get rid of it and
 figure out what it is.

 Thanks again,

 -v

 On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg 
 igor.vaynb...@gmail.comwrote:

 wicket stuff contains a wicket-jee module which supports injecting ejb
 beans into wicket components the same way that wicket-spring injects
 wicket beans.

 -igor

 On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
 pieter.degrae...@systemworks.be wrote:
  Your cart has a reference to the sessionBean ShopingCart. This is not
  allowed, however. The IOC incjectionsupport makes this possible by
 wrapping
  this EJB reference with a serializable proxy.
 
  I only have expecience with wicket-spring end it works great. (In your
 case,
  define your ejb reference in spring and inject it via wicket-spring
 support
  in your page.
  problem solved!
 
  Pieter
 
  On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com wrote:
 
  I'm completely at wits end here and I hope someone can point out what's
  wrong.
 
  I've got an e-commerce application that is simply moving between two
 pages
  using setRedirectPage() when going from a product detail page to the
  shopping cart page.  There isn't anything remarkable about either of
 these
  two pages, they're basically like any other in the app.  However, when
 the
  cart page loads, I get the exception at the bottom of this message.
 
  I've tried implementing Serializable on the Cart() page class but it
 makes
  no difference.  It points out
  com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate as the
  culprit.  I use a stateful session bean (ShoppingCart) which is passed
  around the app as part of the session (custom WebSession-derived class)
 
  This is the only page this occurs on.  There are several other steps in
 the
  cart's checkout process that look exactly like this one and the
 exception
  doesn't happen on any of the others
 
  Any ideas?
 
  Exception:
 
  25717 [httpSSLWorkerThread-8080-1] ERROR
  org.apache.wicket.util.lang.Objects
  - Error serializing object class com.myapp.ui.Cart [object=[Page class =
  com.myapp.ui.Cart, id = 3, version = 0]]
 
 
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
  Unable to serialize class:
  com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
  Field hierarchy is:
   3 [class=com.myapp.ui.Cart, path=3]
     private java.lang.Object org.apache.wicket.MarkupContainer.children
  [class=[Ljava.lang.Object;]
       private
  org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper
 
 
 org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.markupHelper[6]
  [class=org.apache.wicket.markup.html.form.Form, path=3:cartForm]
         private java.lang.Object
 org.apache.wicket.MarkupContainer.children
  [class=[Ljava.lang.Object;]
           private java.lang.Object
  org.apache.wicket.MarkupContainer.children[0]
 [class=com.myapp.ui.Cart$1,
  path=3:cartForm:orderLinesView]
             final com.myapp.session.ShoppingCartLocal
  com.myapp.ui.Cart$1.val$cart [class=$Proxy92]
               protected java.lang.reflect.InvocationHandler
  java.lang.reflect.Proxy.h
  [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate]
  - field that is not serializable
         at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
         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.checkFields(SerializableChecker.java:615)
         at
 
 
 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:538)
         at
 
 
 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread VGJ
One would think...however I tried it and it makes no difference.  None of my
proxy classes implement Serializable and this exception occurs nowhere else,
also.

Just to be certain, I just went through and implemented it on *all* of my
proxy classes in this app.  No change.


On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 your CartProxy does not implement serialiazable so it cannot be
 serialized...

 -igor

 On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
  I'm not injecting it directly.  I'm using a proxy class to get a
 reference
  to the stateless bean's interface like so:
 
  public class CartProxy
  {
   private static ShoppingCartLocal lookupCartInterface()
   {
 ShoppingCartLocal cart = null;
 
 try
 {
   InitialContext ctx = new InitialContext();
   cart =
  (ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
 }
 catch (NamingException exp)
 {
   LogProxy.saveEntry(exp);
 }
 
 return cart;
   }
  }
 
  The reference in web.xml makes this possible:
 
   ejb-local-ref
 ejb-ref-nameShoppingCartBean/ejb-ref-name
 ejb-ref-typeSession/ejb-ref-type
 localcom.myapp.session.ShoppingCartLocal/local
 ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
   /ejb-local-ref
 
  Is this not supposed to work?  It's been in production for over 3
 yrs...so I
  hope it does!  :)
 
  The entire app is built this way and this one page is the only one
 throwing
  this exception.  It works, it doesn't stop the show or affect anything
  negatively, so far as I can tell.  I would just like to get rid of it and
  figure out what it is.
 
  Thanks again,
 
  -v
 
  On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  wicket stuff contains a wicket-jee module which supports injecting ejb
  beans into wicket components the same way that wicket-spring injects
  wicket beans.
 
  -igor
 
  On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
  pieter.degrae...@systemworks.be wrote:
   Your cart has a reference to the sessionBean ShopingCart. This is not
   allowed, however. The IOC incjectionsupport makes this possible by
  wrapping
   this EJB reference with a serializable proxy.
  
   I only have expecience with wicket-spring end it works great. (In your
  case,
   define your ejb reference in spring and inject it via wicket-spring
  support
   in your page.
   problem solved!
  
   Pieter
  
   On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com wrote:
  
   I'm completely at wits end here and I hope someone can point out
 what's
   wrong.
  
   I've got an e-commerce application that is simply moving between two
  pages
   using setRedirectPage() when going from a product detail page to the
   shopping cart page.  There isn't anything remarkable about either of
  these
   two pages, they're basically like any other in the app.  However,
 when
  the
   cart page loads, I get the exception at the bottom of this message.
  
   I've tried implementing Serializable on the Cart() page class but it
  makes
   no difference.  It points out
   com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate as
 the
   culprit.  I use a stateful session bean (ShoppingCart) which is
 passed
   around the app as part of the session (custom WebSession-derived
 class)
  
   This is the only page this occurs on.  There are several other steps
 in
  the
   cart's checkout process that look exactly like this one and the
  exception
   doesn't happen on any of the others
  
   Any ideas?
  
   Exception:
  
   25717 [httpSSLWorkerThread-8080-1] ERROR
   org.apache.wicket.util.lang.Objects
   - Error serializing object class com.myapp.ui.Cart [object=[Page
 class =
   com.myapp.ui.Cart, id = 3, version = 0]]
  
  
 
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
   Unable to serialize class:
   com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
   Field hierarchy is:
3 [class=com.myapp.ui.Cart, path=3]
  private java.lang.Object
 org.apache.wicket.MarkupContainer.children
   [class=[Ljava.lang.Object;]
private
   org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper
  
  
 
 org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.markupHelper[6]
   [class=org.apache.wicket.markup.html.form.Form, path=3:cartForm]
  private java.lang.Object
  org.apache.wicket.MarkupContainer.children
   [class=[Ljava.lang.Object;]
private java.lang.Object
   org.apache.wicket.MarkupContainer.children[0]
  [class=com.myapp.ui.Cart$1,
   path=3:cartForm:orderLinesView]
  final com.myapp.session.ShoppingCartLocal
   com.myapp.ui.Cart$1.val$cart [class=$Proxy92]
protected java.lang.reflect.InvocationHandler
   java.lang.reflect.Proxy.h
  
 [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate]
   - field that is not serializable
  at
  
  
 
 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread Igor Vaynberg
according to the stacktrace, this component:

path=3:cartForm:orderLinesView]

has this reference: final com.myapp.session.ShoppingCartLocal

so looks like you are holding on to your bean directly instead of using a proxy.

-igor

On Thu, Nov 19, 2009 at 8:48 AM, VGJ zambi...@gmail.com wrote:
 One would think...however I tried it and it makes no difference.  None of my
 proxy classes implement Serializable and this exception occurs nowhere else,
 also.

 Just to be certain, I just went through and implemented it on *all* of my
 proxy classes in this app.  No change.


 On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 your CartProxy does not implement serialiazable so it cannot be
 serialized...

 -igor

 On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
  I'm not injecting it directly.  I'm using a proxy class to get a
 reference
  to the stateless bean's interface like so:
 
  public class CartProxy
  {
   private static ShoppingCartLocal lookupCartInterface()
   {
     ShoppingCartLocal cart = null;
 
     try
     {
       InitialContext ctx = new InitialContext();
       cart =
  (ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
     }
     catch (NamingException exp)
     {
       LogProxy.saveEntry(exp);
     }
 
     return cart;
   }
  }
 
  The reference in web.xml makes this possible:
 
   ejb-local-ref
     ejb-ref-nameShoppingCartBean/ejb-ref-name
     ejb-ref-typeSession/ejb-ref-type
     localcom.myapp.session.ShoppingCartLocal/local
     ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
   /ejb-local-ref
 
  Is this not supposed to work?  It's been in production for over 3
 yrs...so I
  hope it does!  :)
 
  The entire app is built this way and this one page is the only one
 throwing
  this exception.  It works, it doesn't stop the show or affect anything
  negatively, so far as I can tell.  I would just like to get rid of it and
  figure out what it is.
 
  Thanks again,
 
  -v
 
  On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  wicket stuff contains a wicket-jee module which supports injecting ejb
  beans into wicket components the same way that wicket-spring injects
  wicket beans.
 
  -igor
 
  On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
  pieter.degrae...@systemworks.be wrote:
   Your cart has a reference to the sessionBean ShopingCart. This is not
   allowed, however. The IOC incjectionsupport makes this possible by
  wrapping
   this EJB reference with a serializable proxy.
  
   I only have expecience with wicket-spring end it works great. (In your
  case,
   define your ejb reference in spring and inject it via wicket-spring
  support
   in your page.
   problem solved!
  
   Pieter
  
   On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com wrote:
  
   I'm completely at wits end here and I hope someone can point out
 what's
   wrong.
  
   I've got an e-commerce application that is simply moving between two
  pages
   using setRedirectPage() when going from a product detail page to the
   shopping cart page.  There isn't anything remarkable about either of
  these
   two pages, they're basically like any other in the app.  However,
 when
  the
   cart page loads, I get the exception at the bottom of this message.
  
   I've tried implementing Serializable on the Cart() page class but it
  makes
   no difference.  It points out
   com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate as
 the
   culprit.  I use a stateful session bean (ShoppingCart) which is
 passed
   around the app as part of the session (custom WebSession-derived
 class)
  
   This is the only page this occurs on.  There are several other steps
 in
  the
   cart's checkout process that look exactly like this one and the
  exception
   doesn't happen on any of the others
  
   Any ideas?
  
   Exception:
  
   25717 [httpSSLWorkerThread-8080-1] ERROR
   org.apache.wicket.util.lang.Objects
   - Error serializing object class com.myapp.ui.Cart [object=[Page
 class =
   com.myapp.ui.Cart, id = 3, version = 0]]
  
  
 
 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
   Unable to serialize class:
   com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
   Field hierarchy is:
    3 [class=com.myapp.ui.Cart, path=3]
      private java.lang.Object
 org.apache.wicket.MarkupContainer.children
   [class=[Ljava.lang.Object;]
        private
   org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper
  
  
 
 org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.markupHelper[6]
   [class=org.apache.wicket.markup.html.form.Form, path=3:cartForm]
          private java.lang.Object
  org.apache.wicket.MarkupContainer.children
   [class=[Ljava.lang.Object;]
            private java.lang.Object
   org.apache.wicket.MarkupContainer.children[0]
  [class=com.myapp.ui.Cart$1,
   path=3:cartForm:orderLinesView]
              final 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread VGJ
I reference the bean's interface in order to use it, yes.  What's the
alternative?  Would I instead access everything through a proxy class and
store the proxy itself into the WebSession, to retain a reference?  As it
is, each page in the checkout process changes the Stateful bean's properties
and stores it back into the WebSession.  Here is what the Cart page looks
like, in summary:

public class Cart extends BasePage
{
  public Cart()
  {
//get session - derives from Wicket's WebSession
UserSession session = (UserSession)getSession();

//get cart from session
final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();

//create form
Form form = new Form(cartForm);

//add list of non-bundle Configuration objects to form
form.add(new ListView(orderLinesView, cart.getOrderLines())
{
  protected void populateItem(ListItem item)
  {
//stuff happens here...
  }
}

//...and so on...and so forth...
  }
}

On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 according to the stacktrace, this component:

 path=3:cartForm:orderLinesView]

 has this reference: final com.myapp.session.ShoppingCartLocal

 so looks like you are holding on to your bean directly instead of using a
 proxy.

 -igor

 On Thu, Nov 19, 2009 at 8:48 AM, VGJ zambi...@gmail.com wrote:
  One would think...however I tried it and it makes no difference.  None of
 my
  proxy classes implement Serializable and this exception occurs nowhere
 else,
  also.
 
  Just to be certain, I just went through and implemented it on *all* of my
  proxy classes in this app.  No change.
 
 
  On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  your CartProxy does not implement serialiazable so it cannot be
  serialized...
 
  -igor
 
  On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
   I'm not injecting it directly.  I'm using a proxy class to get a
  reference
   to the stateless bean's interface like so:
  
   public class CartProxy
   {
private static ShoppingCartLocal lookupCartInterface()
{
  ShoppingCartLocal cart = null;
  
  try
  {
InitialContext ctx = new InitialContext();
cart =
   (ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
  }
  catch (NamingException exp)
  {
LogProxy.saveEntry(exp);
  }
  
  return cart;
}
   }
  
   The reference in web.xml makes this possible:
  
ejb-local-ref
  ejb-ref-nameShoppingCartBean/ejb-ref-name
  ejb-ref-typeSession/ejb-ref-type
  localcom.myapp.session.ShoppingCartLocal/local
  ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
/ejb-local-ref
  
   Is this not supposed to work?  It's been in production for over 3
  yrs...so I
   hope it does!  :)
  
   The entire app is built this way and this one page is the only one
  throwing
   this exception.  It works, it doesn't stop the show or affect anything
   negatively, so far as I can tell.  I would just like to get rid of it
 and
   figure out what it is.
  
   Thanks again,
  
   -v
  
   On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg 
 igor.vaynb...@gmail.com
  wrote:
  
   wicket stuff contains a wicket-jee module which supports injecting
 ejb
   beans into wicket components the same way that wicket-spring injects
   wicket beans.
  
   -igor
  
   On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
   pieter.degrae...@systemworks.be wrote:
Your cart has a reference to the sessionBean ShopingCart. This is
 not
allowed, however. The IOC incjectionsupport makes this possible by
   wrapping
this EJB reference with a serializable proxy.
   
I only have expecience with wicket-spring end it works great. (In
 your
   case,
define your ejb reference in spring and inject it via wicket-spring
   support
in your page.
problem solved!
   
Pieter
   
On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com wrote:
   
I'm completely at wits end here and I hope someone can point out
  what's
wrong.
   
I've got an e-commerce application that is simply moving between
 two
   pages
using setRedirectPage() when going from a product detail page to
 the
shopping cart page.  There isn't anything remarkable about either
 of
   these
two pages, they're basically like any other in the app.  However,
  when
   the
cart page loads, I get the exception at the bottom of this
 message.
   
I've tried implementing Serializable on the Cart() page class but
 it
   makes
no difference.  It points out
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
 as
  the
culprit.  I use a stateful session bean (ShoppingCart) which is
  passed
around the app as part of the session (custom WebSession-derived
  class)
   
This is the only page this occurs on.  There are several other
 steps
  in
   the
cart's checkout process that look exactly like this one and 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread Igor Vaynberg
i am going to guess that inside //stuff happens here... you access
the final cart field. when you do this inside an anonymous class it
keeps a reference, so that is what is causing your serialization
problem. instead of having the final field, do the lookup
((UserSession)getSession()).getCart(); directly inside the //stuff
happens here...

-igor

On Thu, Nov 19, 2009 at 9:57 AM, VGJ zambi...@gmail.com wrote:
 I reference the bean's interface in order to use it, yes.  What's the
 alternative?  Would I instead access everything through a proxy class and
 store the proxy itself into the WebSession, to retain a reference?  As it
 is, each page in the checkout process changes the Stateful bean's properties
 and stores it back into the WebSession.  Here is what the Cart page looks
 like, in summary:

 public class Cart extends BasePage
 {
  public Cart()
  {
    //get session - derives from Wicket's WebSession
    UserSession session = (UserSession)getSession();

    //get cart from session
    final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();

    //create form
    Form form = new Form(cartForm);

    //add list of non-bundle Configuration objects to form
    form.add(new ListView(orderLinesView, cart.getOrderLines())
    {
      protected void populateItem(ListItem item)
      {
        //stuff happens here...
      }
    }

    //...and so on...and so forth...
  }
 }

 On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg 
 igor.vaynb...@gmail.comwrote:

 according to the stacktrace, this component:

 path=3:cartForm:orderLinesView]

 has this reference: final com.myapp.session.ShoppingCartLocal

 so looks like you are holding on to your bean directly instead of using a
 proxy.

 -igor

 On Thu, Nov 19, 2009 at 8:48 AM, VGJ zambi...@gmail.com wrote:
  One would think...however I tried it and it makes no difference.  None of
 my
  proxy classes implement Serializable and this exception occurs nowhere
 else,
  also.
 
  Just to be certain, I just went through and implemented it on *all* of my
  proxy classes in this app.  No change.
 
 
  On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  your CartProxy does not implement serialiazable so it cannot be
  serialized...
 
  -igor
 
  On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
   I'm not injecting it directly.  I'm using a proxy class to get a
  reference
   to the stateless bean's interface like so:
  
   public class CartProxy
   {
    private static ShoppingCartLocal lookupCartInterface()
    {
      ShoppingCartLocal cart = null;
  
      try
      {
        InitialContext ctx = new InitialContext();
        cart =
   (ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
      }
      catch (NamingException exp)
      {
        LogProxy.saveEntry(exp);
      }
  
      return cart;
    }
   }
  
   The reference in web.xml makes this possible:
  
    ejb-local-ref
      ejb-ref-nameShoppingCartBean/ejb-ref-name
      ejb-ref-typeSession/ejb-ref-type
      localcom.myapp.session.ShoppingCartLocal/local
      ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
    /ejb-local-ref
  
   Is this not supposed to work?  It's been in production for over 3
  yrs...so I
   hope it does!  :)
  
   The entire app is built this way and this one page is the only one
  throwing
   this exception.  It works, it doesn't stop the show or affect anything
   negatively, so far as I can tell.  I would just like to get rid of it
 and
   figure out what it is.
  
   Thanks again,
  
   -v
  
   On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg 
 igor.vaynb...@gmail.com
  wrote:
  
   wicket stuff contains a wicket-jee module which supports injecting
 ejb
   beans into wicket components the same way that wicket-spring injects
   wicket beans.
  
   -igor
  
   On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
   pieter.degrae...@systemworks.be wrote:
Your cart has a reference to the sessionBean ShopingCart. This is
 not
allowed, however. The IOC incjectionsupport makes this possible by
   wrapping
this EJB reference with a serializable proxy.
   
I only have expecience with wicket-spring end it works great. (In
 your
   case,
define your ejb reference in spring and inject it via wicket-spring
   support
in your page.
problem solved!
   
Pieter
   
On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com wrote:
   
I'm completely at wits end here and I hope someone can point out
  what's
wrong.
   
I've got an e-commerce application that is simply moving between
 two
   pages
using setRedirectPage() when going from a product detail page to
 the
shopping cart page.  There isn't anything remarkable about either
 of
   these
two pages, they're basically like any other in the app.  However,
  when
   the
cart page loads, I get the exception at the bottom of this
 message.
   
I've tried implementing Serializable on the Cart() page class but
 it
   

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread Jeremy Thomerson
The problems always seem to occur in that cloud in the middle of the diagram
that says stuff happens here or this is where the magic happens.

--
Jeremy Thomerson
http://www.wickettraining.com



On Thu, Nov 19, 2009 at 12:04 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 i am going to guess that inside //stuff happens here... you access
 the final cart field. when you do this inside an anonymous class it
 keeps a reference, so that is what is causing your serialization
 problem. instead of having the final field, do the lookup
 ((UserSession)getSession()).getCart(); directly inside the //stuff
 happens here...

 -igor

 On Thu, Nov 19, 2009 at 9:57 AM, VGJ zambi...@gmail.com wrote:
  I reference the bean's interface in order to use it, yes.  What's the
  alternative?  Would I instead access everything through a proxy class and
  store the proxy itself into the WebSession, to retain a reference?  As it
  is, each page in the checkout process changes the Stateful bean's
 properties
  and stores it back into the WebSession.  Here is what the Cart page looks
  like, in summary:
 
  public class Cart extends BasePage
  {
   public Cart()
   {
 //get session - derives from Wicket's WebSession
 UserSession session = (UserSession)getSession();
 
 //get cart from session
 final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();
 
 //create form
 Form form = new Form(cartForm);
 
 //add list of non-bundle Configuration objects to form
 form.add(new ListView(orderLinesView, cart.getOrderLines())
 {
   protected void populateItem(ListItem item)
   {
 //stuff happens here...
   }
 }
 
 //...and so on...and so forth...
   }
  }
 
  On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  according to the stacktrace, this component:
 
  path=3:cartForm:orderLinesView]
 
  has this reference: final com.myapp.session.ShoppingCartLocal
 
  so looks like you are holding on to your bean directly instead of using
 a
  proxy.
 
  -igor
 
  On Thu, Nov 19, 2009 at 8:48 AM, VGJ zambi...@gmail.com wrote:
   One would think...however I tried it and it makes no difference.  None
 of
  my
   proxy classes implement Serializable and this exception occurs nowhere
  else,
   also.
  
   Just to be certain, I just went through and implemented it on *all* of
 my
   proxy classes in this app.  No change.
  
  
   On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg 
 igor.vaynb...@gmail.com
  wrote:
  
   your CartProxy does not implement serialiazable so it cannot be
   serialized...
  
   -igor
  
   On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
I'm not injecting it directly.  I'm using a proxy class to get a
   reference
to the stateless bean's interface like so:
   
public class CartProxy
{
 private static ShoppingCartLocal lookupCartInterface()
 {
   ShoppingCartLocal cart = null;
   
   try
   {
 InitialContext ctx = new InitialContext();
 cart =
(ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
   }
   catch (NamingException exp)
   {
 LogProxy.saveEntry(exp);
   }
   
   return cart;
 }
}
   
The reference in web.xml makes this possible:
   
 ejb-local-ref
   ejb-ref-nameShoppingCartBean/ejb-ref-name
   ejb-ref-typeSession/ejb-ref-type
   localcom.myapp.session.ShoppingCartLocal/local
   ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
 /ejb-local-ref
   
Is this not supposed to work?  It's been in production for over 3
   yrs...so I
hope it does!  :)
   
The entire app is built this way and this one page is the only one
   throwing
this exception.  It works, it doesn't stop the show or affect
 anything
negatively, so far as I can tell.  I would just like to get rid of
 it
  and
figure out what it is.
   
Thanks again,
   
-v
   
On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg 
  igor.vaynb...@gmail.com
   wrote:
   
wicket stuff contains a wicket-jee module which supports injecting
  ejb
beans into wicket components the same way that wicket-spring
 injects
wicket beans.
   
-igor
   
On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
pieter.degrae...@systemworks.be wrote:
 Your cart has a reference to the sessionBean ShopingCart. This
 is
  not
 allowed, however. The IOC incjectionsupport makes this possible
 by
wrapping
 this EJB reference with a serializable proxy.

 I only have expecience with wicket-spring end it works great.
 (In
  your
case,
 define your ejb reference in spring and inject it via
 wicket-spring
support
 in your page.
 problem solved!

 Pieter

 On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com
 wrote:

 I'm completely at wits end here and I hope someone can point
 out
   what's
 wrong.

 I've got an e-commerce 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread VGJ
Yep, you're right - I have a link inside of the populateItem method that
calls it one time, like so:

Link removeLink = new Link(removeLink)
{
  public void onClick()
  {
try
{
  //proxy method to remove line item
  CartProxy.removeOrderLine(cart, line); //here she is!

  //set cart back to session
  ((UserSession)getSession()).setCart(newCart);

  //redirect to self
  setResponsePage(new Cart());
}
catch (Exception exp)
{
  LogProxy.saveEntry(exp);
}
  }
};

I'll test out your suggestion, I hope it's that simple!  Thanks Igor.


On Thu, Nov 19, 2009 at 11:04 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 i am going to guess that inside //stuff happens here... you access
 the final cart field. when you do this inside an anonymous class it
 keeps a reference, so that is what is causing your serialization
 problem. instead of having the final field, do the lookup
 ((UserSession)getSession()).getCart(); directly inside the //stuff
 happens here...

 -igor

 On Thu, Nov 19, 2009 at 9:57 AM, VGJ zambi...@gmail.com wrote:
  I reference the bean's interface in order to use it, yes.  What's the
  alternative?  Would I instead access everything through a proxy class and
  store the proxy itself into the WebSession, to retain a reference?  As it
  is, each page in the checkout process changes the Stateful bean's
 properties
  and stores it back into the WebSession.  Here is what the Cart page looks
  like, in summary:
 
  public class Cart extends BasePage
  {
   public Cart()
   {
 //get session - derives from Wicket's WebSession
 UserSession session = (UserSession)getSession();
 
 //get cart from session
 final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();
 
 //create form
 Form form = new Form(cartForm);
 
 //add list of non-bundle Configuration objects to form
 form.add(new ListView(orderLinesView, cart.getOrderLines())
 {
   protected void populateItem(ListItem item)
   {
 //stuff happens here...
   }
 }
 
 //...and so on...and so forth...
   }
  }
 
  On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  according to the stacktrace, this component:
 
  path=3:cartForm:orderLinesView]
 
  has this reference: final com.myapp.session.ShoppingCartLocal
 
  so looks like you are holding on to your bean directly instead of using
 a
  proxy.
 
  -igor
 
  On Thu, Nov 19, 2009 at 8:48 AM, VGJ zambi...@gmail.com wrote:
   One would think...however I tried it and it makes no difference.  None
 of
  my
   proxy classes implement Serializable and this exception occurs nowhere
  else,
   also.
  
   Just to be certain, I just went through and implemented it on *all* of
 my
   proxy classes in this app.  No change.
  
  
   On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg 
 igor.vaynb...@gmail.com
  wrote:
  
   your CartProxy does not implement serialiazable so it cannot be
   serialized...
  
   -igor
  
   On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
I'm not injecting it directly.  I'm using a proxy class to get a
   reference
to the stateless bean's interface like so:
   
public class CartProxy
{
 private static ShoppingCartLocal lookupCartInterface()
 {
   ShoppingCartLocal cart = null;
   
   try
   {
 InitialContext ctx = new InitialContext();
 cart =
(ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
   }
   catch (NamingException exp)
   {
 LogProxy.saveEntry(exp);
   }
   
   return cart;
 }
}
   
The reference in web.xml makes this possible:
   
 ejb-local-ref
   ejb-ref-nameShoppingCartBean/ejb-ref-name
   ejb-ref-typeSession/ejb-ref-type
   localcom.myapp.session.ShoppingCartLocal/local
   ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
 /ejb-local-ref
   
Is this not supposed to work?  It's been in production for over 3
   yrs...so I
hope it does!  :)
   
The entire app is built this way and this one page is the only one
   throwing
this exception.  It works, it doesn't stop the show or affect
 anything
negatively, so far as I can tell.  I would just like to get rid of
 it
  and
figure out what it is.
   
Thanks again,
   
-v
   
On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg 
  igor.vaynb...@gmail.com
   wrote:
   
wicket stuff contains a wicket-jee module which supports injecting
  ejb
beans into wicket components the same way that wicket-spring
 injects
wicket beans.
   
-igor
   
On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
pieter.degrae...@systemworks.be wrote:
 Your cart has a reference to the sessionBean ShopingCart. This
 is
  not
 allowed, however. The IOC 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread Igor Vaynberg
phase 1: collect underpants
phase 2: ?
phase 3: profit

:)

-igor

On Thu, Nov 19, 2009 at 10:06 AM, Jeremy Thomerson
jer...@wickettraining.com wrote:
 The problems always seem to occur in that cloud in the middle of the diagram
 that says stuff happens here or this is where the magic happens.

 --
 Jeremy Thomerson
 http://www.wickettraining.com



 On Thu, Nov 19, 2009 at 12:04 PM, Igor Vaynberg 
 igor.vaynb...@gmail.comwrote:

 i am going to guess that inside //stuff happens here... you access
 the final cart field. when you do this inside an anonymous class it
 keeps a reference, so that is what is causing your serialization
 problem. instead of having the final field, do the lookup
 ((UserSession)getSession()).getCart(); directly inside the //stuff
 happens here...

 -igor

 On Thu, Nov 19, 2009 at 9:57 AM, VGJ zambi...@gmail.com wrote:
  I reference the bean's interface in order to use it, yes.  What's the
  alternative?  Would I instead access everything through a proxy class and
  store the proxy itself into the WebSession, to retain a reference?  As it
  is, each page in the checkout process changes the Stateful bean's
 properties
  and stores it back into the WebSession.  Here is what the Cart page looks
  like, in summary:
 
  public class Cart extends BasePage
  {
   public Cart()
   {
     //get session - derives from Wicket's WebSession
     UserSession session = (UserSession)getSession();
 
     //get cart from session
     final ShoppingCartLocal cart = ((UserSession)getSession()).getCart();
 
     //create form
     Form form = new Form(cartForm);
 
     //add list of non-bundle Configuration objects to form
     form.add(new ListView(orderLinesView, cart.getOrderLines())
     {
       protected void populateItem(ListItem item)
       {
         //stuff happens here...
       }
     }
 
     //...and so on...and so forth...
   }
  }
 
  On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  according to the stacktrace, this component:
 
  path=3:cartForm:orderLinesView]
 
  has this reference: final com.myapp.session.ShoppingCartLocal
 
  so looks like you are holding on to your bean directly instead of using
 a
  proxy.
 
  -igor
 
  On Thu, Nov 19, 2009 at 8:48 AM, VGJ zambi...@gmail.com wrote:
   One would think...however I tried it and it makes no difference.  None
 of
  my
   proxy classes implement Serializable and this exception occurs nowhere
  else,
   also.
  
   Just to be certain, I just went through and implemented it on *all* of
 my
   proxy classes in this app.  No change.
  
  
   On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg 
 igor.vaynb...@gmail.com
  wrote:
  
   your CartProxy does not implement serialiazable so it cannot be
   serialized...
  
   -igor
  
   On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
I'm not injecting it directly.  I'm using a proxy class to get a
   reference
to the stateless bean's interface like so:
   
public class CartProxy
{
 private static ShoppingCartLocal lookupCartInterface()
 {
   ShoppingCartLocal cart = null;
   
   try
   {
     InitialContext ctx = new InitialContext();
     cart =
(ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
   }
   catch (NamingException exp)
   {
     LogProxy.saveEntry(exp);
   }
   
   return cart;
 }
}
   
The reference in web.xml makes this possible:
   
 ejb-local-ref
   ejb-ref-nameShoppingCartBean/ejb-ref-name
   ejb-ref-typeSession/ejb-ref-type
   localcom.myapp.session.ShoppingCartLocal/local
   ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
 /ejb-local-ref
   
Is this not supposed to work?  It's been in production for over 3
   yrs...so I
hope it does!  :)
   
The entire app is built this way and this one page is the only one
   throwing
this exception.  It works, it doesn't stop the show or affect
 anything
negatively, so far as I can tell.  I would just like to get rid of
 it
  and
figure out what it is.
   
Thanks again,
   
-v
   
On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg 
  igor.vaynb...@gmail.com
   wrote:
   
wicket stuff contains a wicket-jee module which supports injecting
  ejb
beans into wicket components the same way that wicket-spring
 injects
wicket beans.
   
-igor
   
On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
pieter.degrae...@systemworks.be wrote:
 Your cart has a reference to the sessionBean ShopingCart. This
 is
  not
 allowed, however. The IOC incjectionsupport makes this possible
 by
wrapping
 this EJB reference with a serializable proxy.

 I only have expecience with wicket-spring end it works great.
 (In
  your
case,
 define your ejb reference in spring and inject it via
 wicket-spring
support
 in your page.
 problem solved!

 Pieter

 On Wed, Nov 18, 2009 at 10:50 PM, VGJ 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-19 Thread VGJ
Ha!  I deserve that.  I was hesitant to put the stuff happens here instead
of just dumping another 100 lines of code in there.  Dammit. ;)

Anyhow, worked great.  Thanks for clearing it up for me!

On Thu, Nov 19, 2009 at 11:26 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 phase 1: collect underpants
 phase 2: ?
 phase 3: profit

 :)

 -igor

 On Thu, Nov 19, 2009 at 10:06 AM, Jeremy Thomerson
 jer...@wickettraining.com wrote:
  The problems always seem to occur in that cloud in the middle of the
 diagram
  that says stuff happens here or this is where the magic happens.
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
 
  On Thu, Nov 19, 2009 at 12:04 PM, Igor Vaynberg igor.vaynb...@gmail.com
 wrote:
 
  i am going to guess that inside //stuff happens here... you access
  the final cart field. when you do this inside an anonymous class it
  keeps a reference, so that is what is causing your serialization
  problem. instead of having the final field, do the lookup
  ((UserSession)getSession()).getCart(); directly inside the //stuff
  happens here...
 
  -igor
 
  On Thu, Nov 19, 2009 at 9:57 AM, VGJ zambi...@gmail.com wrote:
   I reference the bean's interface in order to use it, yes.  What's the
   alternative?  Would I instead access everything through a proxy class
 and
   store the proxy itself into the WebSession, to retain a reference?  As
 it
   is, each page in the checkout process changes the Stateful bean's
  properties
   and stores it back into the WebSession.  Here is what the Cart page
 looks
   like, in summary:
  
   public class Cart extends BasePage
   {
public Cart()
{
  //get session - derives from Wicket's WebSession
  UserSession session = (UserSession)getSession();
  
  //get cart from session
  final ShoppingCartLocal cart =
 ((UserSession)getSession()).getCart();
  
  //create form
  Form form = new Form(cartForm);
  
  //add list of non-bundle Configuration objects to form
  form.add(new ListView(orderLinesView, cart.getOrderLines())
  {
protected void populateItem(ListItem item)
{
  //stuff happens here...
}
  }
  
  //...and so on...and so forth...
}
   }
  
   On Thu, Nov 19, 2009 at 10:07 AM, Igor Vaynberg 
 igor.vaynb...@gmail.com
  wrote:
  
   according to the stacktrace, this component:
  
   path=3:cartForm:orderLinesView]
  
   has this reference: final com.myapp.session.ShoppingCartLocal
  
   so looks like you are holding on to your bean directly instead of
 using
  a
   proxy.
  
   -igor
  
   On Thu, Nov 19, 2009 at 8:48 AM, VGJ zambi...@gmail.com wrote:
One would think...however I tried it and it makes no difference.
  None
  of
   my
proxy classes implement Serializable and this exception occurs
 nowhere
   else,
also.
   
Just to be certain, I just went through and implemented it on *all*
 of
  my
proxy classes in this app.  No change.
   
   
On Thu, Nov 19, 2009 at 9:30 AM, Igor Vaynberg 
  igor.vaynb...@gmail.com
   wrote:
   
your CartProxy does not implement serialiazable so it cannot be
serialized...
   
-igor
   
On Thu, Nov 19, 2009 at 7:30 AM, VGJ zambi...@gmail.com wrote:
 I'm not injecting it directly.  I'm using a proxy class to get
 a
reference
 to the stateless bean's interface like so:

 public class CartProxy
 {
  private static ShoppingCartLocal lookupCartInterface()
  {
ShoppingCartLocal cart = null;

try
{
  InitialContext ctx = new InitialContext();
  cart =
 (ShoppingCartLocal)ctx.lookup(java:comp/env/ShoppingCartBean);
}
catch (NamingException exp)
{
  LogProxy.saveEntry(exp);
}

return cart;
  }
 }

 The reference in web.xml makes this possible:

  ejb-local-ref
ejb-ref-nameShoppingCartBean/ejb-ref-name
ejb-ref-typeSession/ejb-ref-type
localcom.myapp.session.ShoppingCartLocal/local
ejb-linkMyProjectEJB.jar#ShoppingCartBean/ejb-link
  /ejb-local-ref

 Is this not supposed to work?  It's been in production for over
 3
yrs...so I
 hope it does!  :)

 The entire app is built this way and this one page is the only
 one
throwing
 this exception.  It works, it doesn't stop the show or affect
  anything
 negatively, so far as I can tell.  I would just like to get rid
 of
  it
   and
 figure out what it is.

 Thanks again,

 -v

 On Wed, Nov 18, 2009 at 11:49 PM, Igor Vaynberg 
   igor.vaynb...@gmail.com
wrote:

 wicket stuff contains a wicket-jee module which supports
 injecting
   ejb
 beans into wicket components the same way that wicket-spring
  injects
 wicket beans.

 -igor

 On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
 pieter.degrae...@systemworks.be wrote:
  Your cart has a reference to the 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-18 Thread Pieter Degraeuwe
Your cart has a reference to the sessionBean ShopingCart. This is not
allowed, however. The IOC incjectionsupport makes this possible by wrapping
this EJB reference with a serializable proxy.

I only have expecience with wicket-spring end it works great. (In your case,
define your ejb reference in spring and inject it via wicket-spring support
in your page.
problem solved!

Pieter

On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com wrote:

 I'm completely at wits end here and I hope someone can point out what's
 wrong.

 I've got an e-commerce application that is simply moving between two pages
 using setRedirectPage() when going from a product detail page to the
 shopping cart page.  There isn't anything remarkable about either of these
 two pages, they're basically like any other in the app.  However, when the
 cart page loads, I get the exception at the bottom of this message.

 I've tried implementing Serializable on the Cart() page class but it makes
 no difference.  It points out
 com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate as the
 culprit.  I use a stateful session bean (ShoppingCart) which is passed
 around the app as part of the session (custom WebSession-derived class)

 This is the only page this occurs on.  There are several other steps in the
 cart's checkout process that look exactly like this one and the exception
 doesn't happen on any of the others

 Any ideas?

 Exception:

 25717 [httpSSLWorkerThread-8080-1] ERROR
 org.apache.wicket.util.lang.Objects
 - Error serializing object class com.myapp.ui.Cart [object=[Page class =
 com.myapp.ui.Cart, id = 3, version = 0]]

 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
 Unable to serialize class:
 com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
 Field hierarchy is:
  3 [class=com.myapp.ui.Cart, path=3]
private java.lang.Object org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
  private
 org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper

 org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.markupHelper[6]
 [class=org.apache.wicket.markup.html.form.Form, path=3:cartForm]
private java.lang.Object org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
  private java.lang.Object
 org.apache.wicket.MarkupContainer.children[0] [class=com.myapp.ui.Cart$1,
 path=3:cartForm:orderLinesView]
final com.myapp.session.ShoppingCartLocal
 com.myapp.ui.Cart$1.val$cart [class=$Proxy92]
  protected java.lang.reflect.InvocationHandler
 java.lang.reflect.Proxy.h
 [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate]
 - field that is not serializable
at

 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
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.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:392)
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:392)
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.java:684)
at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at

 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
at
 org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1120)
at

 org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
at

 org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(DiskPageStore.java:840)
at

 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.put(SecondLevelCacheSessionStore.java:332)
at org.apache.wicket.Session.requestDetached(Session.java:1404)
at org.apache.wicket.RequestCycle.detach(RequestCycle.java:1176)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1454)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
 

Re: Wicket 1.4 + GF v2.1 causing WicketNotSerializableException

2009-11-18 Thread Igor Vaynberg
wicket stuff contains a wicket-jee module which supports injecting ejb
beans into wicket components the same way that wicket-spring injects
wicket beans.

-igor

On Wed, Nov 18, 2009 at 10:37 PM, Pieter Degraeuwe
pieter.degrae...@systemworks.be wrote:
 Your cart has a reference to the sessionBean ShopingCart. This is not
 allowed, however. The IOC incjectionsupport makes this possible by wrapping
 this EJB reference with a serializable proxy.

 I only have expecience with wicket-spring end it works great. (In your case,
 define your ejb reference in spring and inject it via wicket-spring support
 in your page.
 problem solved!

 Pieter

 On Wed, Nov 18, 2009 at 10:50 PM, VGJ zambi...@gmail.com wrote:

 I'm completely at wits end here and I hope someone can point out what's
 wrong.

 I've got an e-commerce application that is simply moving between two pages
 using setRedirectPage() when going from a product detail page to the
 shopping cart page.  There isn't anything remarkable about either of these
 two pages, they're basically like any other in the app.  However, when the
 cart page loads, I get the exception at the bottom of this message.

 I've tried implementing Serializable on the Cart() page class but it makes
 no difference.  It points out
 com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate as the
 culprit.  I use a stateful session bean (ShoppingCart) which is passed
 around the app as part of the session (custom WebSession-derived class)

 This is the only page this occurs on.  There are several other steps in the
 cart's checkout process that look exactly like this one and the exception
 doesn't happen on any of the others

 Any ideas?

 Exception:

 25717 [httpSSLWorkerThread-8080-1] ERROR
 org.apache.wicket.util.lang.Objects
 - Error serializing object class com.myapp.ui.Cart [object=[Page class =
 com.myapp.ui.Cart, id = 3, version = 0]]

 org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException:
 Unable to serialize class:
 com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
 Field hierarchy is:
  3 [class=com.myapp.ui.Cart, path=3]
    private java.lang.Object org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
      private
 org.apache.wicket.markup.html.ContainerWithAssociatedMarkupHelper

 org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.markupHelper[6]
 [class=org.apache.wicket.markup.html.form.Form, path=3:cartForm]
        private java.lang.Object org.apache.wicket.MarkupContainer.children
 [class=[Ljava.lang.Object;]
          private java.lang.Object
 org.apache.wicket.MarkupContainer.children[0] [class=com.myapp.ui.Cart$1,
 path=3:cartForm:orderLinesView]
            final com.myapp.session.ShoppingCartLocal
 com.myapp.ui.Cart$1.val$cart [class=$Proxy92]
              protected java.lang.reflect.InvocationHandler
 java.lang.reflect.Proxy.h
 [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate]
 - field that is not serializable
        at

 org.apache.wicket.util.io.SerializableChecker.check(SerializableChecker.java:346)
        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.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:392)
        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:392)
        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.java:684)
        at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
        at

 org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory$2.writeObjectOverride(IObjectStreamFactory.java:129)
        at
 java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
        at
 org.apache.wicket.util.lang.Objects.objectToByteArray(Objects.java:1120)
        at

 org.apache.wicket.protocol.http.pagestore.AbstractPageStore.serializePage(AbstractPageStore.java:203)
        at

 org.apache.wicket.protocol.http.pagestore.DiskPageStore.storePage(DiskPageStore.java:840)
        at

 org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.put(SecondLevelCacheSessionStore.java:332)
        at