aspose file tools*
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
Author

Session replication-QueryBasedValueHolder-null pointer exception

syed aliarshad
Greenhorn

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

Setup:
====
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(QueryBasedValueHolder.java:62) at oracle.toplink.internal.indirection.QueryBasedValueHolder.instantiate(QueryBasedValueHolder.java:55) at oracle.toplink.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:61) at com.model.test.User.getRole(User.java:51) 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: http://aspose.com/file-tools
 
subject: Session replication-QueryBasedValueHolder-null pointer exception