WebSphere Portal Server - jndi lookup problem in Portal test environment 5.1.0.3

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > June 2006 > jndi lookup problem in Portal test environment 5.1.0.3





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author jndi lookup problem in Portal test environment 5.1.0.3

2006-06-28, 1:21 am

Hi,

I'm testing an application using RAD6 and portal test environment 5.1 and having problem with the jndi loopup. Any suggestion is appreciated.

The application uses a jndi resource, defined in web.xml:

<resource-env-ref id="ResourceEnvRef_1151440771313">
<description></description>
<resource-env-ref-name>jcr/repository</resource-env-ref-name>
<resource-env-ref-type>javax.jcr.Repository</resource-env-ref-type>
</resource-env-ref>

Since the server config editor of RAD6 doesn't support adding jndi resources, I launched "server1" manually and used WAS admin console to create a resource environment provider within the scope of "WebSphere_Portal", as below:

<resources.env:ResourceEnvironmentProvider xmi:id=" ResourceEnvironmentProvider_115145116395
4" name="CLHIARepository">
<factories xmi:type="resources.env:ResourceEnvEntry" xmi:id="ResourceEnvEntry_1151451252782" name="jcr/MyRepository" jndiName="jcr/MyRepository" referenceable="Referenceable_1151451226922"/>
<propertySet xmi:id="J2EEResourcePropertySet_1151451297282">
<resourceProperties xmi:id="J2EEResourceProperty_1151451297282" name="configFilePath" type="java.lang.String" value="C:\RAD_DEV_TMP\repository.xml" required="false"/>
<resourceProperties xmi:id="J2EEResourceProperty_1151451316735" name="repHomeDir" type="java.lang.String" value="C:\RAD_DEV_TMP\repository" required="false"/>
</propertySet>
<referenceables xmi:id="Referenceable_1151451226922" factoryClassname="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory" classname="javax.jcr.Repository"/>
</resources.env:ResourceEnvironmentProvider>

Whenever my code runs, a NamingException is thrown, the root cause here:

Root exception is javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/WebSphere_Portal, name: jcr/MyRepository: First component in name jcr/MyRepository not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFou
nd: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]]
at com.ibm.ws.naming.util.Helpers. processSerializedObjectForLookupExt(Help
ers.java:952)
at com.ibm.ws.naming.urlbase.UrlContextHelper. processBoundObjectForLookup(UrlContextHe
lper.java:152)
at com.ibm.ws.naming.urlbase.UrlContextImpl. processBoundObjectForLookup(UrlContextIm
pl.java:1777)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1278)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1307)
at com.pointalliance.cm.ContentManager.initRepository(ContentManager.java:112)


To doublecheck, I ran dumpNameSpace after starting the test environment, and my jndi name "jcr/MyRepository" did not show up either.

Does 5.1 PTE support external objects as resource environment provider?

I've tried to add the jndi resource at Node or Cell level (by starting server1), and the dumpNameSpace would be able to find the jndi name. But the problem is that when my portlet runs, it looks into context "localhost/nodes/localhost/servers/WebSphere_Po
rtal" instead of "localhost/nodes/localhost/servers/server1". So the code still fails.

Could anyone help?

Thanks,

2006-06-28, 1:29 pm

The JNDI name in your reference, jcr/repository, does not match the JNDI name in the provider, jcr/MyRepository. Judging by the error message, you should be able to fix the problem by changing the JNDI name in the reference to jcr/MyRepository.

2006-06-28, 1:29 pm

Hi, thanks for reponding.

I forgot to post the binding information. The jndi reference "jcr/repository" refers to a WebSphere specific binding in file web-inf\ibm-web-bnd.xmi:

<resourceEnvRefBindings xmi:id="ResourceEnvRefBinding_1151440771313" jndiName="jcr/MyRepository">
<bindingResourceEnvRef href="WEB-INF/web.xml#ResourceEnvRef_1151440771313"/>
</resourceEnvRefBindings>

So the reference chain is indeed complete.

What I've found out today is that if I use "startserver server1" and "startserver WebSphere_Portal" commands to start the servers independent from RAD6, the jndi bindings are available.

But if I start the test environment from RAD6, the jndi resource I created through WAS admin console is not bound when the PTE starts up.

My speculation is that when RAD launches the PTE, it uses its own set of configuration, which doesn't contain my configuration.

Does you know if I can find out this RAD specific configuration file and whether I can modify it?

Thanks
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com