w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Java Standalone (Console) Application - org.hibernate.LazyInitializationException: could not initialize proxy - no Session

After analyzing your stack trace, I see the TransactionInterceptor is called, so the only possible explication is if you try to initiale an eneityt that was loaded in a diffreent Session than the current one:

So, this method you call: at com.mycompany.domain.dao.impl.LastPositionDaoImpl.findLastPosition(LastPositionDaoImpl.java:34)

Is the Vehicle entity loaded in a different Thread/Transaction/Session and then sent in a message that you intercept with:

at com.mycompany.cpr.client.Inbox.processMessage(Inbox.java:604)

If this is the case, you need to initialize all wanted associations in the Producer transaction (the one that fetches the Vehicle and the sends it).

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.