Hi I am using hibernate JPA with spring and mongodb and i am running my application on Glassfish-4.0.
My service class is :
@Component
public class T
I was facing the same error inspite of adding @Transactional annotation at class level and importing org.springframework.transaction.annotation.Transactional.
Then I realized that since I was using hibernate query, I had imported javax.persistence.Query instead of import org.hibernate.query.Query.
Therefore adding import org.hibernate.query.Query solved the issue for me.
I hope this idea helps someone.