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: > <bean id="stampeFactory" > class="org.springframework.beans.factory.config. > ServiceLocatorFactoryBean"> > <property name="serviceLocatorInterface" > value="it.loginet.petrol.application.quadratura.StampeFactory"/> > </bean> > > 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 > >