We are using ATG Dynamo 5.1 for our J2ee efforts. We are facing a problem when we attempt to access a dynamo component from a Session bean. Here is the piece of code in the session bean:


javax.naming.InitialContext ctx = new
InitialContext();
 
Profile currentProfile = (Profile)
ctx.lookup("dynamo:/atg/userprofiling/Profile");

This piece of code throws the following error:

**** Error Wed Jul 25 12:48:17 CDT 2001 996083297894 / atg.nuc
eus.NucleusResources->nucleusNameResolverScopesDontMatch : Invalid attempt to r
solve component /atg/userprofiling/Profile in scope global. It is defined in s
ope session
java.lang.NullPointerException
        at com.enc.portal.beans.profile.AveragerEJB.getProfile(AveragerEJB.java
80)
        at com.enc.portal.beans.profile._Averager_Impl.getProfile_WCC(_Averager
Impl.java:45)
        at java.lang.reflect.Method.invoke(Native Method)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
        at sun.rmi.transport.Transport$1.run(Transport.java:152)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:
65)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTranspor
.java:706)
        at java.lang.Thread.run(Thread.java:484)


However, we are able to access /atg/userprofiling/ProfileTools this way from the session bean.

ProfileTools pt = (ProfileTools) ctx.lookup
("dynamo:/atg/userprofiling/ProfileTools");

I understand and realize that ProfileTools is a Global scoped component and Profile is a session scoped component. It is so critical that I need to access the Profile component from my Session bean to retrieve information like ProfileId etc. Is there a way I can do this?

Please note that I am able to access both ProfileTools and Profile from a regular Java class which is a part of J2EE application. Only when I try accessing Profile from my EJB, it is giving me this error.

Has anyone come across this problem before? I really look forward to your help!

Thanks much!
Sheetal