on 05-02-2006 5:51 AM
Hi,
I tried the following scenario to use JDO :
Servlet -> Session Bean -> JDO. (i.e., A servlet calls JDO using Session bean).
I have used the following JNDI lookup to call the JDO's default PMF.
(PersistenceManagerFactory) ctx.lookup("java:comp/env/jdo/defaultPMF");
It works fine.
Now I am trying to use the JDO in my Web Dynpro Project:
The following is my current scenario
WebDynpro ->Command Bean -> Session Bean -> JDO.
I am using the same JNDI lookup.[i.e., (PersistenceManagerFactory) ctx.lookup("java:comp/env/jdo/defaultPMF");]
But,I can't resolve the JNDI lookup when using webdynpro as presentation layer.
Can anybody pls help me?
Thanks in advance,
Krishna Kumar
Hi all,
have anyone idea how it can work? I have the same problem.
Thx
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stefan,
Did you try
(PersistenceManagerFactory) ctx.lookup("jdo/defaultPMF");
i.e. relative path?
At least, it works this way with JDBC connections...
Valery Silaev
EPAM Systems
Hi all,
i have debugged the application and two questions (or notes) to that problem.
I created a new InitialContext-Object and made the lookup with this code.
ctx = new InitialContext();
pmf = (PersistenceManagerFactory) ctx.lookup( "java:com/env/jdo/defaultPMF" );
The result of the debug of the InitialContext is that:
A DefaultInitialContext with the Key-Value-Pair of this attributtes.
defaultInitCtx= DefaultInitialContext (id=10257)
defaultInitContext= OffsetClientContext (id=10258)
additionalLoader= null
applicationName= "sap.com/tcwddispwda:"
cacheEnabled= true
classLoader= ApplicationLoader (id=10261)
commonLoader= null
fullNameInSpace= CompositeName (id=10262)
lastobj= true
localEnvironment= Hashtable (id=10263)
loginContext= LoginHelper (id=10264)
prefix= "webContainer/applications/sap.com/tcwddispwda/webdynpro/dispatcher"
referenceFactory= null
remoteContext= ServerContextImpl (id=10266)
remoteReferenceHash= null
root= "webContainer/applications/sap.com/tcwddispwda/webdynpro/dispatcher"
runOnServer= true
runOnServer= true
usePrefix= true
defaultInitCtx= null
gotDefault= false
myProps= Hashtable (id=10259)
Now i had a look to the J2EE Engine with the Visual-Admin and found the following info's.
Deployment:
The JDO-Project (as a EAR-Project) is deployed to the servlet_jsp-container.
The WebDynpro-Project is deployed to the webdynpro-container (This is so far clear and ok)
JNDI-Registry:
The following structure (Context) i see:
1. webContainer
2. applications
3. vendor name (sap.com)
4. project name
5. context node
6. java:com
7. env
8. jdo
9. defaultPMF
if had a look to the Context webContainer/applications/sap.com/tcwddispwda/webdynpro/dispatcher i can see, that there is no naming reference under java:com/env.
How can i cange the DefaultInitialContext to the application-context (Project-Context) or what is the correct lookup-string?
I have tested several combinations to the InitialContext to setup the environment and the lookup, but i always fault.
Thanks for help.
Regards
Jürgen
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.