users@glassfish.java.net

java:comp/env problems

From: Adam Jenkins <adamjenkinstmpredirect_at_yahoo.com.au>
Date: Sat, 1 Mar 2008 08:15:36 +1100 (EST)

Hi All,

I'm trying to use the admin console to configure an environment variable and having a really tough time of it.

I'm trying to get solr (lucene.apache.org/solr) to deploy on glassfish. It needs a string environment variable configured on java:comp/env/solr/home to tell it where the index should be created.

I'm using com.manorrock.glassfish.jndi.JndiStringFactory which is a jndi factory for configuring string references that apparently works will with glassfish.

The problem I'm having is that no matter how I configure it (solr/home, env/solr/home, comp/env/solr/home, /env/solr/home), whether configured as a custom resource or an external resource, it never appears under "java:comp/env". I can view it in the jndi browser of the admin console, but when I deploy a web app that lists all the java:comp/env entries it doesn't appear. All my ejb references are under java:comp/env but I can't figure out how to configure a custom resource to be there.

I tried putting the full jndi ref "java:comp/env/solr/home" in the custom resource jndi field, but it gives an error saying that ":" is an illegal character.

Does anyone have any idea how to configure resources under java:comp/env using the glassfish admin console. Can anyone point me to some doco? (the manual is a little sparse on this one and I've googled it to death).

I read you can expose it with a resource-ref in web.xml, but I don't have access to web.xml (as solr comes packaged as a war, and I'd prefer for upgrade ease not to have to unzip the war each time and edit the web.xml).

Any thoughts on the subject would be greatly appreciated.

Cheers
Adam
       
---------------------------------
Get the name you always wanted with the new y7mail email address.