You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Jukka Zitting <ju...@gmail.com> on 2010/04/19 15:23:07 UTC
Re: Jackrabbit on Glassfish: Exception when registering as JNDI
resource jcr/Jackrabbit
Hi,
On Mon, Apr 19, 2010 at 3:16 PM, Wilhelmsen Tor Iver <To...@arrive.no> wrote:
> Caused by: javax.naming.InvalidNameException: jcr/Jackrabbit has more
> components than namespace can handle
The DummyInitialContextFactory included in Jackrabbit can only handle
simple names without "/" in them. You can avoid this problem by
changing the JNDI name to something like "jackrabbit".
BR,
Jukka Zitting
Re: Jackrabbit on Glassfish: Exception when registering as JNDI
resource jcr/Jackrabbit
Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> jndi.name=Jackrabbit
Meh, the file was not saved so I thought that was the case; it works with
jndi.name=jcr/Jackrabbit
now, for some reason.
- Tor Iver
Re: Jackrabbit on Glassfish: Exception when registering as JNDI
resource jcr/Jackrabbit
Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> <bean id="jndi-repository"
> class="org.springframework.jndi.JndiObjectFactoryBean">
> <property name="jndiName" value="jcr/Jackrabbit" />
> <property name="proxyInterface"
> value="javax.jcr.Repository" />
> </bean>
Discovered that Jackrabbit prepends "jcr/" on its own accord, so
jndi.name=Jackrabbit
in bootstrap.properties made the above Spring config work. (The portlet uses 1.5.x libraries while the resource is 2.0, but I guess that works because 2.0 is a superset so the 1.x methods that are proxied will exist.)
- Tor Iver
SV: Jackrabbit on Glassfish: Exception when registering as JNDI
resource jcr/Jackrabbit
Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> The DummyInitialContextFactory included in Jackrabbit can only handle
> simple names without "/" in them. You can avoid this problem by
> changing the JNDI name to something like "jackrabbit".
Thanks, that set me on the track to comment out the setting of the factory so that it instead used the container's - which was what I really wanted in the first place. :)
But I still have a second problem, that a Spring config fails to see the name. Looking in the Glassfish admin, it does not show the registered resource, only the ones defined in the domain.xml file, i.e. JDBC resources mostly...
The config I use in Spring to look it up (from a Liferay portlet running on the Glassfish) is:
<bean id="jndi-repository" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jcr/Jackrabbit" />
<property name="proxyInterface" value="javax.jcr.Repository" />
</bean>
- Tor Iver