File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes Session replication-QueryBasedValueHolder-null pointer exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Session replication-QueryBasedValueHolder-null pointer exception" Watch "Session replication-QueryBasedValueHolder-null pointer exception" New topic

Session replication-QueryBasedValueHolder-null pointer exception

syed aliarshad

Joined: Jun 20, 2012
Posts: 11
Hello all,

1) Clustered environment with 2 tomcat nodes.
2) Toplink as ORM.
3) JMS Cache coordination enabled.

Clustering has been setup perfectly and working fine. The problem is with the fail over situation. We have a User model class which has several properties along with properties using Toplink's ValueHolderInterface like
private ValueHolderInterface role = new ValueHolder(); We are setting this User model class in session. Session gets replicated but there might be an issue with Toplink's ValueHolderInterface.

Now when we test the fail over scenario we get below given exception.

java.lang.NullPointerException at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate( at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate( at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue( at com.model.test.User.getRole( at


Note that we are using Toplink specific implementation in our User class and putting it in session. Usually we should DTO's or VO's to transfer data back and forth and don't use ORM specific functionality in those objects which we usually transfer over the network.

Any help would be appreciated.

Thanks in advance.

I agree. Here's the link:
subject: Session replication-QueryBasedValueHolder-null pointer exception
It's not a secret anymore!