Re: Migrating from Wicket 1.4 to 6 - Serialization

2018-01-30 Thread Martin Grigorov
In that case a Wicket Model keeps a hard reference to the Hibernate entity
that keeps a reference to the Spring class.
You might need to use LoadableDetachableModel.

Look around these classes:

[class=it.loginet.petrol.presentation.sinottico.CachedDataProviderModel]
private final java.lang.Object
it.loginet.commons.wicket.repeater.DefaultSortableDataProvider$1.val$object
[class=it.loginet.petrol.domain.viaggio.ViaggioRete]


On Mon, Jan 29, 2018 at 11:19 PM, Leonardo D'Alimonte <
leonardo.dalimo...@loginet.it> wrote:

> Hello Martin,
> absolutely Hibernate is not injecting classes anywhere in Wicket classes.
> Interceptor is used to inject a Spring-configured class, ViaggioService,
> into a specific domain class, Viaggio.java.
>
> This code builds a DataTable of Viaggio entities inside the page that
> throws
> the NotSerializableException:
> .
> public GestioneOperativaViaggioListPage(PageParameters
> parameters) {
> super(parameters);
>
> giorno = impiantoRepository.existOpenedGiornata() ?
> impiantoRepository.readOpenedGiornata().getDay().asDate()
> : null;
> dataProvider = new RepositoryDataProvider(repo);
> dataProvider.reset();
> dataProvider.setCriteria(new ViaggioFilterCriteria());
>
> DataTableBuilder tableBuilder = new
> DataTableBuilder(Viaggio.class,
> dataProvider, "primoAutista",
> "identificativoViaggio", "tipoViaggio",
> "motrice", "rimorchio",
> "secondoAutista", "tipoCaricazione",
> "societa");
> ..
>
> ViaggioService has configured many other services inside, if you go
> recursively through fields of these classes you will find "stampeFactory"
> instance.
> Spring configuration of this bean follows:
>  class="org.springframework.beans.factory.config.
> ServiceLocatorFactoryBean">
>  value="it.loginet.petrol.application.quadratura.StampeFactory"/>
> 
>
> ServiceLocatorFactoryBean uses inside ServiceLocatorInvocationHandler,
> which
> is not serializable.
>
>
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-
> f1842947.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Migrating from Wicket 1.4 to 6 - Serialization

2018-01-29 Thread Leonardo D'Alimonte
Hello Martin,
absolutely Hibernate is not injecting classes anywhere in Wicket classes.
Interceptor is used to inject a Spring-configured class, ViaggioService,
into a specific domain class, Viaggio.java.

This code builds a DataTable of Viaggio entities inside the page that throws
the NotSerializableException:
.
public GestioneOperativaViaggioListPage(PageParameters parameters) {
super(parameters);

giorno = impiantoRepository.existOpenedGiornata() ?
impiantoRepository.readOpenedGiornata().getDay().asDate()
: null;
dataProvider = new RepositoryDataProvider(repo);
dataProvider.reset();
dataProvider.setCriteria(new ViaggioFilterCriteria());

DataTableBuilder tableBuilder = new 
DataTableBuilder(Viaggio.class,
dataProvider, "primoAutista",
"identificativoViaggio", "tipoViaggio", 
"motrice", "rimorchio",
"secondoAutista", "tipoCaricazione",
"societa");
..

ViaggioService has configured many other services inside, if you go
recursively through fields of these classes you will find "stampeFactory"
instance.
Spring configuration of this bean follows:


 

ServiceLocatorFactoryBean uses inside ServiceLocatorInvocationHandler, which
is not serializable.




--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Migrating from Wicket 1.4 to 6 - Serialization

2018-01-29 Thread Martin Grigorov
Hi Leonardo,

How Hibernate Interceptor injects classes in Wicket classes ?!

Wicket serializes the Page instance and everything in it, i.e. components,
their models, etc.
For some reason you pass non-serializable instance of one of your
Viaggio*** classes to a Wicket component/model.

Show us the related code so we can take a look and tell you what is not
correct!

On Sun, Jan 28, 2018 at 12:30 PM, Leonardo D'Alimonte <
leonardo.dalimo...@loginet.it> wrote:

> Hi Martin,
> actually ViaggioService comes from a domain class, ViaggioRete, where is
> injected through a custom Hibernate Interceptor.
>
> At the moment, it seems I have to let all my code implement the
> Serializable
> interface, but it doesn't sound as the correct option. Futhermore, I got
> stuck on Spring classes, like XmlWebApplicationContext or
> ServiceLocatorFactoryBean.ServiceLocatorInvocationHandler(), that are not
> serializable.
>
> Maybe I need to go through big changes on my business logic to avoid these
> kind of problems?
>
> Sorry if I'm bothering you but I really would like to come to an end on
> this
> migration :)
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-
> f1842947.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Migrating from Wicket 1.4 to 6 - Serialization

2018-01-28 Thread Leonardo D'Alimonte
Hi Martin,
actually ViaggioService comes from a domain class, ViaggioRete, where is
injected through a custom Hibernate Interceptor.

At the moment, it seems I have to let all my code implement the Serializable
interface, but it doesn't sound as the correct option. Futhermore, I got
stuck on Spring classes, like XmlWebApplicationContext or
ServiceLocatorFactoryBean.ServiceLocatorInvocationHandler(), that are not
serializable.

Maybe I need to go through big changes on my business logic to avoid these
kind of problems?

Sorry if I'm bothering you but I really would like to come to an end on this
migration :)

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Migrating from Wicket 1.4 to 6 - Serialization

2018-01-23 Thread Martin Grigorov
The problem is in these classes:

[class=it.loginet.petrol.presentation.sinottico.CachedDataProviderModel]
private final java.lang.Object
it.loginet.commons.wicket.repeater.DefaultSortableDataProvider$1.val$object
[class=it.loginet.petrol.domain.viaggio.ViaggioRete]
  protected
it.loginet.petrol.application.prenotazione.ViaggioService
it.loginet.petrol.domain.viaggio.AbstractViaggio.viaggioService
[class=it.loginet.petrol.application.prenotazione.ViaggioService]

It seems ViaggioService is not injected by Wicket here, i.e. not with
@SpringBean annotation.

On Mon, Jan 22, 2018 at 11:50 PM, Leonardo D'Alimonte <
leonardo.dalimo...@loginet.it> wrote:

> Actually field "stampeFactory" implements Spring interface
> 'org.springframework.beans.factory.config.ServiceLocatorFactoryBean',
> which
> allows us to retrieve beans as prototypes but it's not Serializable (spring
> version is 3.2.2.RELEASE).
>
> I don't think I can use @SpringBean in this situation, as my
> BettolinaService is not directly inside a Page but it's just a field of
> another Service injected in a Page.
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-
> f1842947.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Migrating from Wicket 1.4 to 6 - Serialization

2018-01-22 Thread Leonardo D'Alimonte
Actually field "stampeFactory" implements Spring interface
'org.springframework.beans.factory.config.ServiceLocatorFactoryBean', which
allows us to retrieve beans as prototypes but it's not Serializable (spring
version is 3.2.2.RELEASE).

I don't think I can use @SpringBean in this situation, as my
BettolinaService is not directly inside a Page but it's just a field of
another Service injected in a Page.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Migrating from Wicket 1.4 to 6 - Serialization

2018-01-22 Thread Martijn Dashorst
Your field:

it.loginet.petrol.application.quadratura.StampeFactory
it.loginet.petrol.application.bettolina.BettolinaService.stampeFactory

contains a not-serializable object. From what I can see it is a
factory from Spring, that you probably should use @SpringBean for or
@Inject (depending on wicket version).

This will inject a serializable proxy to the factory into the page
instead of the actual factory.

Martijn


On Mon, Jan 22, 2018 at 8:33 AM, Maxim Solodovnik  wrote:
> It seems the problem is caused by the fact
> java.lang.reflect.InvocationHandler interface does not extends Serializable
> 
>
> On Sun, Jan 21, 2018 at 8:48 PM, Leonardo D'Alimonte <
> leonardo.dalimo...@loginet.it> wrote:
>
>> Hi everyone,
>> I'm working on the migration of our WebApplication from Wicket 1.4 to
>> Wicket
>> 6, I don't understand why with the new version I'm getting this exception;
>>  BEGIN 
>> 21/01/2018 14:24:37,925 ERROR -JavaSerializer - Error serializing object
>> class
>> it.loginet.petrol.presentation.viaggio.GestioneOperativaViaggioListPage
>> [object=[Page class =
>> it.loginet.petrol.presentation.viaggio.GestioneOperativaViaggioListPage,
>> id
>> = 4, render count = 1]] - <:>
>> org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$
>> ObjectCheckException:
>> The object type is not Serializable!
>> A problem occurred while checking object with type:
>> org.springframework.beans.factory.config.ServiceLocatorFactoryBean$
>> ServiceLocatorInvocationHandler
>> Field hierarchy is:
>>   4
>> [class=it.loginet.petrol.presentation.viaggio.
>> GestioneOperativaViaggioListPage,
>> path=4]
>> private java.lang.Object org.apache.wicket.MarkupContainer.children
>> [class=[Ljava.lang.Object;]
>>   private java.lang.Object org.apache.wicket.
>> MarkupContainer.children[6]
>> [class=org.apache.wicket.markup.html.panel.Fragment, path=4:toolbar]
>> private java.lang.Object org.apache.wicket.
>> MarkupContainer.children
>> [class=[Ljava.lang.Object;]
>>   private java.util.List
>> org.apache.wicket.request.mapper.parameter.PageParameters.
>> namedParameters[1]
>> [class=org.apache.wicket.markup.html.form.Form, path=4:toolbar:form]
>> private java.lang.Object
>> org.apache.wicket.MarkupContainer.children
>> [class=it.loginet.petrol.presentation.programmazione.LiveDateSearchField,
>> path=4:toolbar:form:filtroGiorno]
>>   java.lang.Object org.apache.wicket.Component.data
>> [class=[Ljava.lang.Object;]
>> java.lang.Object org.apache.wicket.Component.data[0][1][2]
>> [class=org.apache.wicket.ajax.form.AjaxFormSubmitBehavior]
>>   private final org.apache.wicket.Component[]
>> it.loginet.petrol.presentation.programmazione.LiveDateSearchField$1.val$
>> targetComponents
>> [class=[Lorg.apache.wicket.Component;]
>> private final org.apache.wicket.Component[]
>> it.loginet.petrol.presentation.programmazione.LiveDateSearchField$1.val$
>> targetComponents[0]
>> [class=it.loginet.commons.wicket.repeater.CustomDataTable,
>> path=4:content:entitiesTable]
>>   private java.lang.Object
>> org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
>> java.lang.Object org.apache.wicket.Component.
>> data[1]
>> [class=org.apache.wicket.markup.html.WebMarkupContainer,
>> path=4:content:entitiesTable:body]
>>   private java.lang.Object
>> org.apache.wicket.MarkupContainer.children
>> [class=org.apache.wicket.extensions.markup.html.
>> repeater.data.table.DataTable$DefaultDataGridView,
>> path=4:content:entitiesTable:body:rows]
>> private java.lang.Object
>> org.apache.wicket.MarkupContainer.children
>> [class=org.apache.wicket.markup.repeater.OddEvenItem,
>> path=4:content:entitiesTable:body:rows:1]
>>   java.lang.Object
>> org.apache.wicket.Component.data
>> [class=it.loginet.petrol.presentation.sinottico.CachedDataProviderModel]
>> private final java.lang.Object
>> it.loginet.commons.wicket.repeater.DefaultSortableDataProvider$1.
>> val$object
>> [class=it.loginet.petrol.domain.viaggio.ViaggioRete]
>>   protected
>> it.loginet.petrol.application.prenotazione.ViaggioService
>> it.loginet.petrol.domain.viaggio.AbstractViaggio.viaggioService
>> [class=it.loginet.petrol.application.prenotazione.ViaggioService]
>> private
>> it.loginet.petrol.application.corsia.CorsiaService
>> it.loginet.petrol.application.prenotazione.ViaggioService.corsiaService
>> [class=it.loginet.petrol.application.corsia.CorsiaService]
>>   private
>> it.loginet.petrol.application.impianto.ImpiantoService
>> it.loginet.petrol.application.corsia.CorsiaService.impiantoService
>> [class=it.loginet.petrol.application.impianto.ImpiantoService]
>>

Re: Migrating from Wicket 1.4 to 6 - Serialization

2018-01-21 Thread Maxim Solodovnik
It seems the problem is caused by the fact
java.lang.reflect.InvocationHandler interface does not extends Serializable


On Sun, Jan 21, 2018 at 8:48 PM, Leonardo D'Alimonte <
leonardo.dalimo...@loginet.it> wrote:

> Hi everyone,
> I'm working on the migration of our WebApplication from Wicket 1.4 to
> Wicket
> 6, I don't understand why with the new version I'm getting this exception;
>  BEGIN 
> 21/01/2018 14:24:37,925 ERROR -JavaSerializer - Error serializing object
> class
> it.loginet.petrol.presentation.viaggio.GestioneOperativaViaggioListPage
> [object=[Page class =
> it.loginet.petrol.presentation.viaggio.GestioneOperativaViaggioListPage,
> id
> = 4, render count = 1]] - <:>
> org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$
> ObjectCheckException:
> The object type is not Serializable!
> A problem occurred while checking object with type:
> org.springframework.beans.factory.config.ServiceLocatorFactoryBean$
> ServiceLocatorInvocationHandler
> Field hierarchy is:
>   4
> [class=it.loginet.petrol.presentation.viaggio.
> GestioneOperativaViaggioListPage,
> path=4]
> private java.lang.Object org.apache.wicket.MarkupContainer.children
> [class=[Ljava.lang.Object;]
>   private java.lang.Object org.apache.wicket.
> MarkupContainer.children[6]
> [class=org.apache.wicket.markup.html.panel.Fragment, path=4:toolbar]
> private java.lang.Object org.apache.wicket.
> MarkupContainer.children
> [class=[Ljava.lang.Object;]
>   private java.util.List
> org.apache.wicket.request.mapper.parameter.PageParameters.
> namedParameters[1]
> [class=org.apache.wicket.markup.html.form.Form, path=4:toolbar:form]
> private java.lang.Object
> org.apache.wicket.MarkupContainer.children
> [class=it.loginet.petrol.presentation.programmazione.LiveDateSearchField,
> path=4:toolbar:form:filtroGiorno]
>   java.lang.Object org.apache.wicket.Component.data
> [class=[Ljava.lang.Object;]
> java.lang.Object org.apache.wicket.Component.data[0][1][2]
> [class=org.apache.wicket.ajax.form.AjaxFormSubmitBehavior]
>   private final org.apache.wicket.Component[]
> it.loginet.petrol.presentation.programmazione.LiveDateSearchField$1.val$
> targetComponents
> [class=[Lorg.apache.wicket.Component;]
> private final org.apache.wicket.Component[]
> it.loginet.petrol.presentation.programmazione.LiveDateSearchField$1.val$
> targetComponents[0]
> [class=it.loginet.commons.wicket.repeater.CustomDataTable,
> path=4:content:entitiesTable]
>   private java.lang.Object
> org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;]
> java.lang.Object org.apache.wicket.Component.
> data[1]
> [class=org.apache.wicket.markup.html.WebMarkupContainer,
> path=4:content:entitiesTable:body]
>   private java.lang.Object
> org.apache.wicket.MarkupContainer.children
> [class=org.apache.wicket.extensions.markup.html.
> repeater.data.table.DataTable$DefaultDataGridView,
> path=4:content:entitiesTable:body:rows]
> private java.lang.Object
> org.apache.wicket.MarkupContainer.children
> [class=org.apache.wicket.markup.repeater.OddEvenItem,
> path=4:content:entitiesTable:body:rows:1]
>   java.lang.Object
> org.apache.wicket.Component.data
> [class=it.loginet.petrol.presentation.sinottico.CachedDataProviderModel]
> private final java.lang.Object
> it.loginet.commons.wicket.repeater.DefaultSortableDataProvider$1.
> val$object
> [class=it.loginet.petrol.domain.viaggio.ViaggioRete]
>   protected
> it.loginet.petrol.application.prenotazione.ViaggioService
> it.loginet.petrol.domain.viaggio.AbstractViaggio.viaggioService
> [class=it.loginet.petrol.application.prenotazione.ViaggioService]
> private
> it.loginet.petrol.application.corsia.CorsiaService
> it.loginet.petrol.application.prenotazione.ViaggioService.corsiaService
> [class=it.loginet.petrol.application.corsia.CorsiaService]
>   private
> it.loginet.petrol.application.impianto.ImpiantoService
> it.loginet.petrol.application.corsia.CorsiaService.impiantoService
> [class=it.loginet.petrol.application.impianto.ImpiantoService]
> private
> it.loginet.petrol.presentation.giornata.GiornataContabileService
> it.loginet.petrol.application.impianto.ImpiantoService.
> giornataContabileService
> [class=it.loginet.petrol.presentation.giornata.GiornataContabileService]
>   private
> it.loginet.petrol.application.bettolina.BettolinaService
> it.loginet.petrol.presentation.giornata.GiornataContabileService.
> bettolinaService
> [class=it.loginet.petrol.application.bettolina.BettolinaService]
> private
> it.loginet.petrol.appl