allareddy suneel

Greenhorn
+ Follow
since Sep 18, 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
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by allareddy suneel

Thanks for the reply James. Yes your assumptions are right, it might be occurring on re deployments of the applications. Generally what we need to do on these scenarios? DO we need to restart the server or can we configure "re delivery limit" to 0 so that it will stop sending these?
Hi,
We have configured JMS Cache coordination in our applications and its working fine. But often we are observing one issue i.e. repeated JMS exceptions which are throwing in server and application becoming very slow. There is no other option we need to restart the server.

We are using Weblogic 10.3.5 and Toplink 9.0.3 version. We have configured <should-remove-connection-on-error>true</should-remove-connection-on-error> also but no use. Please help us how to stop these, any configuration we are missing here.

2 types of repeated Exceptions which we are getting in server are :

Pattern 1:-
2012.10.08 03:26:13.455--ServerSession(6544148)--Connection(23364215)--SELECT ACTUAL_URL, URL_A2012.10.2012.10.08 03:32:48.998--ServerSession(10338663)--Retreived remote message from JMS topic: TopLinkJMSModule!jms/TopLinkCacheSyn2012.10.08 03:32:49.098--ServerSession(28397831)--Exception [TOPLINK-18001] (OracleAS TopLink - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.JMSProcessingException
Exception Description: Error while processing incomming JMS message
Internal Exception: java.lang.ClassCastException: cannot assign instance of oracle.toplink.internal.identitymaps.CacheKey to field oracle.toplink.internal.sessions.ObjectChangeSet.cacheKey of type oracle.toplink.internal.identitymaps.CacheKey in instance of oracle.toplink.internal.sessions.AggregateObjectChangeSetLocal Exception Stack:
Exception [TOPLINK-18001] (OracleAS TopLink - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.JMSProcessingException
Exception Description: Error while processing incomming JMS message
Internal Exception: java.lang.ClassCastException: cannot assign instance of oracle.toplink.internal.identitymaps.CacheKey to field oracle.toplink.internal.sessions.ObjectChangeSet.cacheKey of type oracle.toplink.internal.identitymaps.CacheKey in instance of oracle.toplink.internal.sessions.AggregateObjectChangeSet
at oracle.toplink.exceptions.JMSProcessingException.buildDefault(JMSProcessingException.java:18)
at oracle.toplink.remote.jms.TopLinkMessageListener.onMessage(TopLinkMessageListener.java:60)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3821)
at weblogic.jms.client2012.10.08 03:32:49.148--ServerSession(10338663)--Retreived remote message from JMS topic: TopLinkJMSModule!jms/TopLinkCacheSynchTopic
2012.10.08 03:32:49.155--ServerSession(10338663)--JMSException thrown
2012.10.08 03:32:49.156--ServerSession(10338663)--Retreived remote message from JMS topic: TopLinkJMSModule!jms/TopLinkCacheSynchTopic
2012.10.08 03:32:49.156--ServerSession(10338663)--JMSException thrown
2012.10.08 03:32:49.175--ServerSession(10338663)--Retreived remote message from JMS topic: TopLinkJMSModule!jms/TopLinkCacheSynchTopic
2012.10.08 03:32:49.175--ServerSession(10338663)--JMSException thrown
------------ so on

Pattern 2:-
####<Oct 5, 2012 3:47:57 PM EDT> <Error> <JMSClientExceptions> <sbirdevwl1.reisystems.com> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <system> <> <004mnr1BGeMCWrWFLzINOA0006zu000CxX> <1349466477880> <BEA-055165> <The following exception has occurred:
java.lang.NoClassDefFoundError: oracle/toplink/exceptions/JMSProcessingException
java.lang.NoClassDefFoundError: oracle/toplink/exceptions/JMSProcessingException
at oracle.toplink.remote.jms.TopLinkMessageListener.onMessage(TopLinkMessageListener.java:58)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3821)
at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
>
####<Oct 5, 2012 3:47:57 PM EDT> <Error> <JMSClientExceptions> <sbirdevwl1.reisystems.com> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <system> <> <004mnr1BGeMCWrWFLzINOA0006zu000CxX> <1349466477884> <BEA-055165> <The following exception has occurred:
java.lang.NoClassDefFoundError: oracle/toplink/exceptions/JMSProcessingException
java.lang.NoClassDefFoundError: oracle/toplink/exceptions/JMSProcessingException
at oracle.toplink.remote.jms.TopLinkMessageListener.onMessage(TopLinkMessageListener.java:58)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3821)
at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
>
####<Oct 5, 2012 3:47:57 PM EDT> <Error> <JMSClientExceptions> <sbirdevwl1.reisystems.com> <AdminServer> <[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)'> <system> <> <004mnr1BGeMCWrWFLzINOA0006zu000CxX> <1349466477888> <BEA-055165> <The following exception has occurred:
java.lang.NoClassDefFoundError: oracle/toplink/exceptions/JMSProcessingException
java.lang.NoClassDefFoundError: oracle/toplink/exceptions/JMSProcessingException
at oracle.toplink.remote.jms.TopLinkMessageListener.onMessage(TopLinkMessageListener.java:58)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4659)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:4345)
at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3821)
at weblogic.jms.client.JMSSession.access$000(JMSSession.java:115)
at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:5170)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
>
James,
As i mentioned earlier, we are accessing the object in 2 different applications. We are not using findbyid but we are querying the record using other columns in forms. For admin screen alone, i given entity and pk to delete/update the cache. After i deleted from admin screen, i went to the forms in both applications and checked object coming (though physically record deleted from DB). I am able to see the JMS messages when i deleted the object.
You mean to say though we use Softweakidentiymap, system removes the object immediately from session?
James,
Please find the code for updates as well as deletes.

public static boolean cacheInvalidate(String entityName, String entityId)
throws Exception {

Class baseTableName = Class.forName(entityName);

Session session = getSession();
UnitOfWork uow = session.acquireUnitOfWork();
Object objectTobeRefreshed = null;
Object objectBackup = null;
Vector primaryKeysList = new Vector();
primaryKeysList.add(entityId);
if (session.containsObjectInIdentityMap(primaryKeysList, baseTableName)) {
objectTobeRefreshed = session.getFromIdentityMap(primaryKeysList,
baseTableName);
}else{
objectTobeRefreshed = findByIdByCacheRefresh(baseTableName,
getPrimaryKey(session, entityName), entityId);
}

if(objectTobeRefreshed==null) return false;

Descriptor descriptor = getDescriptor(session, entityName);
objectBackup = descriptor.getObjectBuilder().instantiateClone(
objectTobeRefreshed,
(oracle.toplink.publicinterface.Session) uow);

objectTobeRefreshed = findByIdByCacheRefresh(baseTableName,
getPrimaryKey(session, entityName), entityId);

UnitOfWorkChangeSet changeSet = new UnitOfWorkChangeSet();
ObjectChangeSet objectChangeSet = null;
if(objectTobeRefreshed==null){//for delete
objectChangeSet = descriptor.getObjectBuilder().createObjectChangeSet(objectBackup, changeSet, false, (oracle.toplink.publicinterface.Session) uow);

changeSet.getDeletedObjects().put(objectChangeSet, objectChangeSet);

}else{//for updates
objectChangeSet = descriptor.getObjectBuilder()
.compareForChange(objectTobeRefreshed, objectBackup, changeSet,
(oracle.toplink.publicinterface.Session) uow);
changeSet.addObjectChangeSet(objectChangeSet, objectTobeRefreshed);
}


if(!changeSet.hasChanges()) return false;

Session severSession = getServerSession();
severSession.getCacheSynchronizationManager().propagateChanges(
changeSet);

return true;

}
--------------------------------------------------------------------------------------------------------------------------
Interesting one is i tried deleting the object from front end UI using following code then also object not removed from not only same session but other applications too. As i mentioned earlier we are using softweakidentitymap for our cache.

public static boolean cacheDeleteObject(String entityName, String entityId)
throws Exception {


Session session = getSession();
UnitOfWork uow = session.acquireUnitOfWork();
Class baseTableName = Class.forName(entityName);

Object objectTobeRefreshed = findByIdByCacheRefresh(baseTableName,
getPrimaryKey(session, entityName), entityId);

if(objectTobeRefreshed==null) return false;

uow.deleteObject(objectTobeRefreshed);
try {
uow.commit();
}
catch(TopLinkException te) {
throw new ResourceException("Exception in cacheDelete()");
}
return true;
}
Thanks James for the response.
I have tried and it is not functioning as expected. Basically delete objects will remove the objects from session.removeFromIdentityMap(), we are using SoftCacheWeakIdentityMap as a policy so i am assuming it will not remove the object immediately (though from DB it is deleted the object but not from other applications in which object is in session). Please let me know if my understanding correct.
We are using Toplink 9.0.3,SoftCacheWeakIdentityMap and JMS cache coordination. Is there any way we can delete the objects from cache when objects manually deleting from DB directly. We were able to succeed for DB manual updates but not for delete.
Thanks James!!! i am able to send message and able to succeed.
James,
I am trying to prepare JMS message but not able to complete, any sample code/ link i can refer to?
Thanks for the inputs. Its really helpful.
I am trying list down all entities along with primary key fields from my project. I am able to get entity/model class names properly using below mentioned code snippet. I need to get primary key fields from each model but i am getting Database primary key but not java field names. Any help appreciated.


Hashtable descriptors = session.getProject().getDescriptors();
Enumeration descriptorsIterator = descriptors.elements();
TreeMap<String,String> entityMap = new TreeMap<String,String>();
while (descriptorsIterator.hasMoreElements()) {
Descriptor entityObj = (Descriptor) descriptorsIterator.nextElement();
entityMap.put(entityObj.getAlias(), entityObj.getJavaClass().getName());//get the entity name

}

I am using Toplink 9.0.3.
We are planning to migrate Toplink version 9.0.3 to eclipselink. We have recently migrated our Database to 11i. I saw below useful link and came to know not major hurdles with migration. Is there any major issues/lot of coding changes with respect to DAO logic or is is just updating Model classes and ORM mappings?

Any links/resources will be appreciated.

http://wiki.eclipse.org/EclipseLink/Examples/MigratingFromOracleTopLink
We are having 2 web application using same Database and common Toplink library, but 2 different session objects for both the applications. We are using JMS for cache coordination. JMS propagating messages successfully between the applications and able to see the object changes in both the applications properly. Now, we are trying to refresh cache for manual updates in Database.
We are trying to refresh particular object which is modified in database in one application, it is able to refresh in the application from which refresh happened but not in other application. Is there any way we can force JMS to propagate these changes/updates?

Our intention is refreshing in one application so that JMS should coordinate and update in others when DB manual updates. Please let us know any comments for the same.

Database using: Oracle 11g
Toplink Version:- 9.0.3

Also, we are planning to migrate Toplink to eclipse Link soon but i think above issue will be persists.

Please let us know if any more details required on the same.