• Post Reply Bookmark Topic Watch Topic
  • New Topic

Object returned by session bean vanishes at Presentation Layer !

 
Param
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I have the following issue in my code. I am returning a HashMap from my session bean method and I have ensured that the HashMap is populated with values ( Log messages show that the HashMap has values in ejb layer).
The "Presentation Layer" and the "EJB Layer" are in separate machines. When i make a remote ejb call from the presentation layer, the values returned are null (the ejbs are looked up properly and the remote method is getting called and - i can see log messages in ejb server). I am not getting a RemoteException or Serialization related exception.
Have anyone faced similar situation before ?
Please throw some light in this issue as I am not able to locate the problem.
Thanks in Advance
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange. Which application server / web container you're using? From what you described, the only cause I could think of would be a typo but I'm sure you've triple-checked the code already...
I remember once having the following typo cause something similar:
 
Param
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using WebSphere Application Server V 4.0.3 as my EJB Server and WebSphere Portal Server V 4.2.1 as my other Server for Presentation Layer code.
Here is my code snippet.

//MY PRESENTATION LAYER EJB DELEGATE METHOD:
public DomainMasterCollectionBean populateDomainValueCache() throws Exception {
DomainMasterCollectionBean dmMasterCollection =null;

try {


dmMasterCollection = getCacheLoaderService().populateDomainValueCache();
//dmMasterCollection prints null here. No Remote Exception or any other exception thrown.
} catch (RemoteException e) {
throw new Exception(e);
}

return dmMasterCollection;
}
/MY PRESENTATION LAYER EJB DELEGATE METHOD:
public DomainMasterCollectionBean populateDomainValueCache() throws Exception {
// This domain maanger class has a static field (DomainMasterCollectionBean) which has preloaded values.

// DomainManager.getAllDomainValues().size() prints non-zero size.

return DomainManager.getAllDomainValues();
}
 
Param
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PLEASE SEE THIS CODE SNIPPET:
//MY PRESENTATION LAYER EJB DELEGATE METHOD:
public DomainMasterCollectionBean populateDomainValueCache() throws Exception {
DomainMasterCollectionBean dmMasterCollection =null;
try {

dmMasterCollection = getCacheLoaderService().populateDomainValueCache();
//dmMasterCollection prints null here. No Remote Exception or any other exception thrown.
} catch (RemoteException e) {
throw new Exception(e);
}
return dmMasterCollection;
}
//MY EJB METHOD:
public DomainMasterCollectionBean populateDomainValueCache() throws Exception {
// This domain maanger class has a static field (DomainMasterCollectionBean) which has preloaded values.
// DomainManager.getAllDomainValues().size() prints non-zero size.
return DomainManager.getAllDomainValues();
}
 
Param
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the problem rectified. I rewrote the method and re-deployed and the problem vanished.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!