Bom dia pessoal estou com esse problema em um relacionamento @ManyToMany failed to lazily initialize a collection of role: br.com.sabium.cadastroprojeto.modelo.Employee.projects, could not initialize proxy
Acabei dando uma pesquisada e algumas pessoa falaram sobre o @JsonBackReference, mas não onde devo coloca-lo, tentei colocar ele em todo lugar mas não consegui alguém pode me ajudar
public class Employee{
...
@ManyToMany
private Set<Project> projects;
}
public class Project {
...
@ManyToMany(mappedBy = "projects")
private Set<Employee> employees;
}
<error type="org.jboss.arquillian.test.spi.ArquillianProxyException" message="org.hibernate.LazyInitializationException : failed to lazily initialize a collection of role: br.com.sabium.cadastroprojeto.modelo.Employee.projects, could not initialize proxy - no Session [Proxied because : Original exception not deserilizable, ClassNotFoundException]">org.jboss.arquillian.test.spi.ArquillianProxyException: org.hibernate.LazyInitializationException : failed to lazily initialize a collection of role: br.com.sabium.cadastroprojeto.modelo.Employee.projects, could not initialize proxy - no Session [Proxied because : Original exception not deserilizable, ClassNotFoundException]at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:567)at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:205)at org.hibernate.collection.internal.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:146)at org.hibernate.collection.internal.PersistentSet.size(PersistentSet.java:143)at java.util.Collections$UnmodifiableCollection.size(Collections.java:1030)at br.com.sabium.cadastroprojeto.repository.test.EmployeeRepositoryTest.deveSalvarUmEmployeeEmDoisProjectDiferestes(EmployeeRepositoryTest.java:106) </error>