syed aliarshad

Greenhorn
+ Follow
since Jun 20, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by syed aliarshad

Sorry for the late reply.

We are using JMS 1.1 implementation. We need to provide the Failover settings like failover:(tcp://primary:61616,tcp://secondary:61616)?randomize=false.

Our toplink-sessions.xml file looks like this.

<transport xsi:type="jms-topic-transport">
<topic-host-url>tcp://URL:61616</topic-host-url>;
<topic-connection-factory-name>java:comp/env/jms/CacheTopicConnectionFactory</topic-connection-factory-name>
<topic-name>java:comp/env/jms/toplinktopic</topic-name>
<jndi-naming-service>
<initial-context-factory-name>org.apache.activemq.jndi.ActiveMQInitialContextFactory</initial-context-factory-name>
</jndi-naming-service>
</transport>


And we need to implement Shared Nothing master/Slave strategy for HA. Could you please help on this.

Thanks
We have a clustered environment with 2 tomcat nodes. We are in the testing phase. When we test the fail over scenario then the load balancer sends request to other alive server but on the that alive server, system throws null pointer exception for ValueHolderInterface property.

I guess, as you describe that after serialization, ORM entity gets detached. So may be I need to load object with all dependent object on the alive server.???

thanks

Cluster is managing its session perfectly but throws null pointer exception on below given line: Note: All other properties in the class are working fine except for this toplink related property.

---------------------------------------

private ValueHolderInterface admin= new ValueHolder();
public Admin getAdmin() {
return (Admin)admin.getValue();
}
--------------------------------------

You may be right. Once its outside of the transaction, it is a simple POJO. We have cache server, using JMS cache implementation with JMS Coordinated Cache.
So after failing over, how can we re-attach the object?

Thanks for the reply.
What are the best practices of putting objects in session?
What should be the nature of those objects?
Can ORM entities be used in session or is it a bad practice?

We are using Toplink entities in session. They are working fine in non clustered environment. But when we take them to clustered environment and test the fail over scenario then we are having problems.

Thanks in advance
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.





11 years ago
Resolved this issue.

Root cause:
=======
In session, there is an object where developer has created instance variable of logger class.
11 years ago
hello all,

I have 2 tomcat nodes and I have done the cluster setting in server.xml file. The startup routine for both the tomcat nodes are working fine.

I am facing an issue when I try to login to the system. Below is the exception.

SEVERE: Unable to serialize delta request for sessionid [A05E828676EB9C807D848F4F45E49087.172.8.8.2]
java.io.NotSerializableException: org.apache.log4j.Logger
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at org.apache.catalina.ha.session.DeltaRequest$AttributeInfo.writeExternal(DeltaRequest.java:389)
at org.apache.catalina.ha.session.DeltaRequest.writeExternal(DeltaRequest.java:287)
at org.apache.catalina.ha.session.DeltaRequest.serialize(DeltaRequest.java:302)
at org.apache.catalina.ha.session.DeltaManager.serializeDeltaRequest(DeltaManager.java:742)
at org.apache.catalina.ha.session.DeltaManager.requestCompleted(DeltaManager.java:1253)


We are using logger like private static Logger log = Logger.getLogger

please help.

Thanks


11 years ago
We have 2 tomcat nodes but they are sharing the same source code so my Toplink-sessions.xml file would be one and we are adding one more cache node that will have jms broker setup.

Structure:
======
Tomcat Nodes: 2
JMS Cache Nodes 1. Need to add one more to make a cluster.

thanks in advance
I am using tomcat.

I have 2 tomcat nodes and 1 JMS cache node. I want to add one more JMS Cache node for JMS Clustering.

If we add one more url with comma separated in the below given line then will it work?

<topic-host-url>tcp://someurl.com:61616</topic-host-url>;

Thanks
Hello,

I guess I have the same situation here..

I am using Toplink as ORM. I have implemented caching too using cache coordination.

Below are the lines that I have added in Toplink-session.xml file for caching.

------------------------------------------------------------------------------------------------------------------------

<remote-command>
<commands>
<cache-sync>true</cache-sync>
</commands>
<transport xsi:type="jms-topic-transport">
<topic-host-url>tcp://someurl.com:61616</topic-host-url>;
<topic-connection-factory-name>java:comp/env/jms/CacheTopicConnectionFactory</topic-connection-factory-name>
<topic-name>java:comp/env/jms/topicname</topic-name>
<jndi-naming-service>
<initial-context-factory-name>org.apache.activemq.jndi.ActiveMQInitialContextFactory</initial-context-factory-name>
</jndi-naming-service>
</transport>
</remote-command>
------------------------------------------------------------------------------------------------------------------------


The above settings are working fine for one node cache. I want to make the JMS Cluster having more than one cache node. How can I achieve this?


Thanks
Hello,

I guess I have the same situation here..

I am using Toplink as ORM. I have implemented caching too using cache coordination.

Below are the lines that I have added in Toplink-session.xml file for caching.

------------------------------------------------------------------------------------------------------------------------

<remote-command>
<commands>
<cache-sync>true</cache-sync>
</commands>
<transport xsi:type="jms-topic-transport">
<topic-host-url>tcp://jms.someurl.com:61616</topic-host-url>;
<topic-connection-factory-name>java:comp/env/jms/CacheTopicConnectionFactory</topic-connection-factory-name>
<topic-name>java:comp/env/jms/topicname</topic-name>
<jndi-naming-service>
<initial-context-factory-name>org.apache.activemq.jndi.ActiveMQInitialContextFactory</initial-context-factory-name>
</jndi-naming-service>
</transport>
</remote-command>
------------------------------------------------------------------------------------------------------------------------


The above settings are working fine for one cache node. I want to make the JMS Cluster having more than one cache node. How can I achieve this?


Thanks