ERROR Cannot bind datasource 'jdbc/nxactivities' in JNDI NamingException: Context is read only

I am running Nuxeo 5.5 Tomcat Distribution on PostgreSQL 9.1 with Social Collaboration enabled. On startup, I receive the following error.

ERROR [org.nuxeo.runtime.datasource.DataSourceComponent] Cannot bind datasource 'jdbc/nxactivities' in JNDI javax.naming.NamingException: Context is read only
  at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903)
  at org.apache.naming.NamingContext.bind(NamingContext.java:831)
  at org.apache.naming.NamingContext.bind(NamingContext.java:171)
  at org.apache.naming.NamingContext.bind(NamingContext.java:187)
  at org.nuxeo.runtime.datasource.DataSourceComponent.addDataSource(DataSourceComponent.java:119)
  at org.nuxeo.runtime.datasource.DataSourceComponent.registerContribution(DataSourceComponent.java:81)
  at org.nuxeo.runtime.model.DefaultComponent.registerExtension(DefaultComponent.java:39)
...

Later in the log during startup, I naturally receive the following error:

ERROR [org.hibernate.connection.DatasourceConnectionProvider] Could not find datasource: java:comp/env/jdbc/nxactivities javax.naming.NameNotFoundException: Name nxactivities is not bound in this Context
...

Any thoughts? Should I create a JIRA for this issue?

0 votes

2 answers

76 views

ANSWER

Can you explain how we can reproduce this? Which distribution did you downloaded? On which system are your running? What did you configured? Can we have a dump of your bin/nuxeo.conf?
04/03/2012


ANSWERS:

Hi again,

I think I managed to bypass the problem.

I commented the datasource in “nuxeo/WEB-INF/activity-datasource-config.xml” and declared it in my tomcat nuxeo.xml like this :

Now I don’t see any errors on startup or when I upload a file for instance.

I wanted to test the collaboration tab, but I got this error :

18:12:46,953 ERROR [OpenSocialAdapter] Unable to get gadget spec for publicsocialworkspaces
org.apache.shindig.gadgets.GadgetException: Unable to retrieve spec for https://MyIp:8083/nuxeo/site/gadgets/publicsocialworkspaces/publicsocialworkspaces.xml. HTTP error 500

But I guess it’s another issue ?

0 votes



I suppose a side effect of first problem. We need to understand what is wrong in your installation. Look at my comment on your previous answer.
04/11/2012

dam
No I know it's another issue cause I got this too in the nuxeo bundled version when i'm on https. So it's a trust issue with certificate or so but not a db problem.
I consider that my hack above is one of the answer to the original question.
04/12/2012

I didn't notice you were using https. If you don't use a reverse proxy, you should configure your tomcat as explained in the tomcat documentation : http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
04/12/2012


Hi,
I have the same problem.

At startup :
ERROR [DataSourceComponent] Cannot bind datasource ‘jdbc/nxactivities’ in JNDI
javax.naming.NamingException: Le Contexte est en lecture seule
at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903)
at org.apache.naming.NamingContext.bind(NamingContext.java:831)

When I upload a file :

ERROR [DatasourceConnectionProvider] Could not find datasource: java:comp/env/jdbc/nxactivities
javax.naming.NameNotFoundException: Le Nom nxactivities n’est pas lié à ce Contexte
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)

Here is my server config :
OS: Linux (Ubuntu 11.10)
JDK: java-6-sun-1.6.0.31
Database: PostgreSQL 9.1

I bundled “nuxeo-cap-5.5-tomcat” in a static WAR and put it in my own Tomcat V6.0.35
I’m on https on port 8083, and use ldaps authentification.

FYI, the bundled version don’t display the error when I launch it with nuxectl console.
(nuxeoctl start don’t work because I get this error but I guess it’s another issue…)

Here is my nuxeo.conf

nuxeo.log.dir=/var/nuxeo-home/log
nuxeo.pid.dir=/var/nuxeo-home/log
nuxeo.data.dir=/var/nuxeo-home/data
nuxeo.tmp.dir=/var/nuxeo-home/tmp
nuxeo.web.dir=/var/nuxeo-home/web
nuxeo.runtime.home=/var/nuxeo-home
nuxeo.force.generation=false
nuxeo.wizard.done=true
nuxeo.templates=postgresql,dam,collaboration,https
nuxeo.bind.address={myIP}
nuxeo.server.emptySessionPath=false
nuxeo.server.ajp.port=8009
nuxeo.server.https.port=8083
nuxeo.server.https.keystoreFile=/etc/tomcat/public.pfx
nuxeo.server.https.keystorePass={myPass}
nuxeo.server.tomcat-admin.port=8006
nuxeo.url=https://localhost:8083/nuxeo
nuxeo.loopback.url=https://{MYIP}:8083/nuxeo
opensocial.gadgets.port=8083
server.status.key={aKey}
nuxeo.updatecenter.disabled=true
nuxeo.db.name=nuxeodb
nuxeo.db.user=nuxeodb
nuxeo.db.password={myPass}
mail.smtp.host=smtp.{myhost}
mail.smtp.auth=true
mail.smtp.username=postmaster%{myhost}
mail.smtp.password={myPass}

I also changed nuxeo default config, data, tmp, web, log dir and also runtime home as explained here

Like ron said, any toughts on that?
Thanks in advance.

0 votes



There is something wrong in what you've described. If you're using the static war version of nuxeo, you should not have a {{nuxeoctl}} in your tomcat. As nuxeo is packaged as a full war, you should start your server using the catalina way of doing (ie: catalina.sh).

I've tried myself with the nuxeo 5.5 HF06 distribution, and all worked fine.

04/10/2012

dam
I just said that before packaging it in a static war, I launched it in the bundled version with nuxeoctl (to test it) and it worked.
But when I make a static war and launch it in my own tomcat server I have this problem.
04/10/2012

May I give you my static war for test ?
04/10/2012

dam
If you want but it means that I'll need to configure it manually.
At least to match my dirs, db, url and port.
But yes If I can get it to work, I might see what's the difference with mine.
04/10/2012

How can we manage the transfert ? Do you have a place where I can upload the file ? Or do we want me to share the archive ?
04/11/2012

dam
That won't be necessary after all cause I managed to bypass this problem.
But thanks for your proposition.
04/12/2012