Adding a user directory with MSSQL datasource

I'm trying to create a new user directory. The data comes from a bespoke SQL Server 2008 database, exposed as a view named “vUser”. I've declared a datasource in a separate file, stored as Nuxeo/nxserver/config/sqlds-config.xml:

  <component name="org.nuxeo.runtime.datasource.project">
  <extension target="org.nuxeo.runtime.datasource.DataSourceDescriptor" point="datasources">
  <datasource maxActive="20" maxIdle="5" maxWait="10000" name="jdbc/project" driverClassName="net.sourceforge.jtds.jdbcx.JtdsDataSource">
  <property name="serverName">X.X.X.X  </property>
  <property name="portNumber">1433  </property>
  <property name="databaseName">database  </property>
  <property name="user">user  </property>
  <property name="password">password  </property>
  </datasource>
  </extension>
  </component>

I've declared the user directory in another file, Nuxeo/nxserver/config/userprojects-config.xml:

  <component name="org.nuxeo.ecm.directory.project">
  <implementation class="org.nuxeo.ecm.directory.sql.SQLDirectoryDescriptor"/>
  <require>org.nuxeo.ecm.directory.sql.SQLDirectoryFactory  </require>
  <require>org.nuxeo.runtime.datasource.project  </require>
  <extension target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory" point="directories">
  <directory name="MyUserDirectory">
  <schema>user</schema>
  <idField>username</idField>
  <passwordField>password</passwordField>
  <passwordHashAlgorithm>SMD5</passwordHashAlgorithm>
  <autoincrementIdField>false</autoincrementIdField>
  <dataSource>jdbc/project</dataSource>
  <table>vUser</table>
  <createTablePolicy>never</createTablePolicy>
  <references>
  <inverseReference field="groups" directory="groupDirectory" dualReferenceField="members" />
  </references>
  </directory>
  </extension>
  </component>

When I start Nuxeo I get the following error:

org.nuxeo.ecm.directory.DirectoryException: org.nuxeo.ecm.core.api.WrappedException: Exception:
org.nuxeo.ecm.directory.DirectoryException. message: dataSource lookup failed
at org.nuxeo.ecm.directory.sql.SQLDirectoryProxy.getDirectory(SQLDirectoryProxy.java:51)
...

I'm obviously not declaring the datasource properly. What am I doing wrong?

0 votes

0 answers

2206 views

ANSWER

Can you give us cause by exception. This only the High level exception. Can diagnostic it.
04/10/2012

This is another exception I get prior to the one above:

2012-04-12 11:31:37,675 ERROR
[org.nuxeo.ecm.directory.sql.SQLDirectory] dataSource lookup failed
javax.naming.NameNotFoundException: Name project is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
...
04/12/2012

What is the version of Nuxeo?
04/25/2012

We're using 5.5.
04/30/2012

Are there any error or warning logs in server.log about org.nuxeo.runtime.datasource.project or sqlds-config.xml?
05/02/2012