cancel
Showing results for 
Search instead for 
Did you mean: 

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

ron_1
Star Contributor
Star Contributor

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?

12 REPLIES 12

slacoin_Lacoin
Star Contributor
Star Contributor

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?

dam_
Champ in-the-making
Champ in-the-making

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.

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

dam_
Champ in-the-making
Champ in-the-making

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.

May I give you my static war for test ?

dam_
Champ in-the-making
Champ in-the-making

If you want but it means that I'll need to configure it manually.

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 ?

dam_
Champ in-the-making
Champ in-the-making

That won't be necessary after all cause I managed to bypass this problem.

dam_
Champ in-the-making
Champ in-the-making

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 :

   < ResourceLink global="jdbc/nuxeo" name="jdbc/nxactivities" type="javax.sql.DataSource"/>

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 ?