08-02-2012 06:58 AM
Hi,
I configured a directory with property autoincrementIdField set to true :
<directory name="category">
<schema>schemacategory</schema>
<dataSource>java:/nxsqldirectory</dataSource>
<cacheTimeout>3600</cacheTimeout>
<cacheMaxSize>1000</cacheMaxSize>
<table>category</table>
<idField>id</idField>
<autoincrementIdField>true</autoincrementIdField>
<dataFile>directories/category.csv</dataFile>
<createTablePolicy>always</createTablePolicy>
</directory>
CSV file category.csv looks like this :
id,label, obsolete, parent 1,"Category 1","0",0 2,"Category 2","0",0 3,"Category 3","0",0
when I start Nuxeo i get the following stacktrace :
2012-08-02 09:50:38,416 ERROR [org.nuxeo.ecm.directory.DirectoryServiceImpl] unrecognized column type: AUTOINC, values: [0: 1, 1: LM France, 2: 0, 3: 0] org.nuxeo.ecm.directory.DirectoryException: unrecognized column type: AUTOINC, values: [0: 1, 1: Category 1, 2: 0, 3: 0] at org.nuxeo.ecm.directory.sql.SQLHelper.loadData(SQLHelper.java:398) at org.nuxeo.ecm.directory.sql.SQLHelper.setupTable(SQLHelper.java:127) at org.nuxeo.ecm.directory.sql.SQLDirectory.(SQLDirectory.java:156) at org.nuxeo.ecm.directory.sql.SQLDirectoryProxy.getDirectory(SQLDirectoryProxy.java:49) at org.nuxeo.ecm.directory.sql.SQLDirectoryProxy.getName(SQLDirectoryProxy.java:61) at org.nuxeo.ecm.directory.DirectoryServiceImpl.applicationStarted(DirectoryServiceImpl.java:64) at org.nuxeo.runtime.model.impl.RegistrationInfoImpl.notifyApplicationStarted(RegistrationInfoImpl.java:332) at org.nuxeo.runtime.osgi.OSGiRuntimeService.notifyComponentsOnStarted(OSGiRuntimeService.java:469) at org.nuxeo.runtime.osgi.OSGiRuntimeService.fireApplicationStarted(OSGiRuntimeService.java:508) at org.nuxeo.runtime.osgi.OSGiRuntimeService.frameworkEvent(OSGiRuntimeService.java:518) at org.nuxeo.osgi.OSGiAdapter.fireFrameworkEvent(OSGiAdapter.java:239) at org.nuxeo.osgi.application.loader.FrameworkLoader.doStart(FrameworkLoader.java:220) at org.nuxeo.osgi.application.loader.FrameworkLoader.start(FrameworkLoader.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.nuxeo.osgi.application.FrameworkBootstrap.start(FrameworkBootstrap.java:135) at org.nuxeo.runtime.tomcat.NuxeoLauncher.handleEvent(NuxeoLauncher.java:117) at org.nuxeo.runtime.tomcat.NuxeoLauncher.lifecycleEvent(NuxeoLauncher.java:88) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4700) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Should I change something in my CSV file ? I am using PostgreSQL 8.4.
08-02-2012 08:04 AM
Autoincremented values are designed to be generated by the database and our CSV loading code doesn't expect someone to fill them by hand. I understand your need but it's unsupported at the moment. Also you would need some logic to tell the database what id to use for the next insertion after all the CSV has been loaded and we don't have that either.
You may open a JIRA for enhancement. In the meantime you won't be able to use CSV files to load such tables, you'll need to have a DBA do it.
08-02-2012 08:04 AM
Autoincremented values are designed to be generated by the database and our CSV loading code doesn't expect someone to fill them by hand. I understand your need but it's unsupported at the moment. Also you would need some logic to tell the database what id to use for the next insertion after all the CSV has been loaded and we don't have that either.
You may open a JIRA for enhancement. In the meantime you won't be able to use CSV files to load such tables, you'll need to have a DBA do it.
08-02-2012 08:33 AM
OK thanks. FIY i am currently upgrading our apps from 5.4.2 to 5.6 and it seems it was not a problem in 5.4.2.
08-02-2012 08:35 AM
I will disable the auto-increment, that will do the trick for a while.
08-02-2012 08:41 AM
Autoincrement was mostly broken before Nuxeo 5.5. Please read the [NXP-7124](https
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.