org.dbunit.dataset.NoSuchColumnException

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

org.dbunit.dataset.NoSuchColumnException

james.elsey
Hi,

dbunit 2.4.2 (also tried 2.4.7 but same outcome)
MySQL 5.1.42

My first post here so please go easy!

I'm having an issue with DBunit, my stack trace that I get upon
application startup is as follows

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dbUnitBootstrapper' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Invocation of init method
failed; nested exception is org.dbunit.dataset.NoSuchColumnException:
CLIENT.ID -  (Non-uppercase input column: ID) in ColumnNameToIndexes
cache map. Note that the map's column names are NOT case sensitive.
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4623)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5323)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:456)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:922)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:906)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2205)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1890)
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:85)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:560)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:547)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:189)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:329)
        at com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:302)
        at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312)
        at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119)
        at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99)
        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:250)
        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:176)
        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
        at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
        at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
        at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
        at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
        at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
        at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
Caused by: org.dbunit.dataset.NoSuchColumnException: CLIENT.ID -
(Non-uppercase input column: ID) in ColumnNameToIndexes cache map.
Note that the map's column names are NOT case sensitive.
        at org.dbunit.ant.DbUnitTask.execute(DbUnitTask.java:385)
        at com.jameselsey.salestracker.testing.DBUnitBootstrapper.execute(DBUnitBootstrapper.java:58)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
        ... 48 more
Caused by: org.dbunit.dataset.NoSuchColumnException: CLIENT.ID -
(Non-uppercase input column: ID) in ColumnNameToIndexes cache map.
Note that the map's column names are NOT case sensitive.
        at org.dbunit.dataset.AbstractTableMetaData.getColumnIndex(AbstractTableMetaData.java:117)
        at org.dbunit.operation.AbstractOperation.getOperationMetaData(AbstractOperation.java:89)
        at org.dbunit.operation.AbstractBatchOperation.execute(AbstractBatchOperation.java:140)
        at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:79)
        at org.dbunit.ant.Operation.execute(Operation.java:192)
        at org.dbunit.ant.DbUnitTask.execute(DbUnitTask.java:380)
        ... 56 more


I'm not sure why I'm having a issue with case sensitive column names,
since everything I use is uppercase.

My testData looks as follows :


    <CLIENT ID="-1"
        ADDRESS1="some House"
        ADDRESS2="Russell Rd"
        COUNTRY="England"
        COUNTY="Suffolk"
        MAINPHONENUMBER="0845 1345678"
        NAME="County Council"
        POSTCODE="AB1 5TX"
        SECTOR="Local Government"
        TOWN="London"
        WEBSITEURL="www.somesite.gov.uk"/>


Please note, that if I remove the ID from my test data, and rely on
auto-incrementation in mysql, it gives the exact same error, but
complains about the next item down, being ADDRESS1

My domain objects in my application use JPA column annotations, which
specify the corresponding column names as they are in test data, and
in my schema


My schema looks as follows

mysql> describe CLIENT;
+------------------+--------------+------+-----+---------+----------------+
| Field            | Type         | Null | Key | Default | Extra          |
+------------------+--------------+------+-----+---------+----------------+
| ID               | int(11)      | NO   | PRI | NULL    | auto_increment |
| jdoDetachedState | tinyblob     | YES  |     | NULL    |                |
| NAME             | varchar(255) | NO   |     | NULL    |                |
| ADDRESS1         | varchar(255) | YES  |     | NULL    |                |
| ADDRESS2         | varchar(255) | YES  |     | NULL    |                |
| COUNTRY          | varchar(255) | YES  |     | NULL    |                |
| COUNTY           | varchar(255) | YES  |     | NULL    |                |
| MAINPHONENUMBER  | varchar(255) | YES  |     | NULL    |                |
| POSTCODE         | varchar(255) | YES  |     | NULL    |                |
| SECTOR           | varchar(255) | YES  |     | NULL    |                |
| TOWN             | varchar(255) | YES  |     | NULL    |                |
| WEBSITEURL       | varchar(255) | YES  |     | NULL    |                |
+------------------+--------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)

mysql>


I've been suffering with this issue for some time, I first posted on
JavaRanch (http://www.coderanch.com/t/479014/Java-General/java/DBUnit-why-insert-test-data),
but after not getting anywhere I've tried StackOverflow
(http://stackoverflow.com/questions/2210429/dbunit-confusion-over-case-sensitivity-on-table-column-names)
as well.

Is it possible I have found a bug? Or have I missed something in my
configuration?

James Elsey

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

org.dbunit.dataset.NoSuchColumnException

james.elsey
Hi,

dbunit 2.4.2 (also tried 2.4.7 but same outcome)
MySQL 5.1.42

My first post here so please go easy!

I'm having an issue with DBunit, my stack trace that I get upon
application startup is as follows

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dbUnitBootstrapper' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Invocation of init method
failed; nested exception is org.dbunit.dataset.NoSuchColumnException:
CLIENT.ID -  (Non-uppercase input column: ID) in ColumnNameToIndexes
cache map. Note that the map's column names are NOT case sensitive.
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
       at java.security.AccessController.doPrivileged(Native Method)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
       at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
       at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
       at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
       at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
       at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
       at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4623)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:5323)
       at com.sun.enterprise.web.WebModule.start(WebModule.java:456)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:922)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:906)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2205)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1890)
       at com.sun.enterprise.web.WebApplication.start(WebApplication.java:85)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:560)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:547)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:189)
       at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:329)
       at com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:302)
       at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312)
       at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119)
       at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99)
       at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:250)
       at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:176)
       at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147)
       at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
       at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
       at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
       at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
       at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
       at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
       at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
       at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
       at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
       at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
       at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
       at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
       at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
Caused by: org.dbunit.dataset.NoSuchColumnException: CLIENT.ID -
(Non-uppercase input column: ID) in ColumnNameToIndexes cache map.
Note that the map's column names are NOT case sensitive.
       at org.dbunit.ant.DbUnitTask.execute(DbUnitTask.java:385)
       at com.jameselsey.salestracker.testing.DBUnitBootstrapper.execute(DBUnitBootstrapper.java:58)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:616)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
       ... 48 more
Caused by: org.dbunit.dataset.NoSuchColumnException: CLIENT.ID -
(Non-uppercase input column: ID) in ColumnNameToIndexes cache map.
Note that the map's column names are NOT case sensitive.
       at org.dbunit.dataset.AbstractTableMetaData.getColumnIndex(AbstractTableMetaData.java:117)
       at org.dbunit.operation.AbstractOperation.getOperationMetaData(AbstractOperation.java:89)
       at org.dbunit.operation.AbstractBatchOperation.execute(AbstractBatchOperation.java:140)
       at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:79)
       at org.dbunit.ant.Operation.execute(Operation.java:192)
       at org.dbunit.ant.DbUnitTask.execute(DbUnitTask.java:380)
       ... 56 more


I'm not sure why I'm having a issue with case sensitive column names,
since everything I use is uppercase.

My testData looks as follows :


   <CLIENT ID="-1"
       ADDRESS1="some House"
       ADDRESS2="Russell Rd"
       COUNTRY="England"
       COUNTY="Suffolk"
       MAINPHONENUMBER="0845 1345678"
       NAME="County Council"
       POSTCODE="AB1 5TX"
       SECTOR="Local Government"
       TOWN="London"
       WEBSITEURL="www.somesite.gov.uk"/>


Please note, that if I remove the ID from my test data, and rely on
auto-incrementation in mysql, it gives the exact same error, but
complains about the next item down, being ADDRESS1

My domain objects in my application use JPA column annotations, which
specify the corresponding column names as they are in test data, and
in my schema


My schema looks as follows

mysql> describe CLIENT;
+------------------+--------------+------+-----+---------+----------------+
| Field            | Type         | Null | Key | Default | Extra          |
+------------------+--------------+------+-----+---------+----------------+
| ID               | int(11)      | NO   | PRI | NULL    | auto_increment |
| jdoDetachedState | tinyblob     | YES  |     | NULL    |                |
| NAME             | varchar(255) | NO   |     | NULL    |                |
| ADDRESS1         | varchar(255) | YES  |     | NULL    |                |
| ADDRESS2         | varchar(255) | YES  |     | NULL    |                |
| COUNTRY          | varchar(255) | YES  |     | NULL    |                |
| COUNTY           | varchar(255) | YES  |     | NULL    |                |
| MAINPHONENUMBER  | varchar(255) | YES  |     | NULL    |                |
| POSTCODE         | varchar(255) | YES  |     | NULL    |                |
| SECTOR           | varchar(255) | YES  |     | NULL    |                |
| TOWN             | varchar(255) | YES  |     | NULL    |                |
| WEBSITEURL       | varchar(255) | YES  |     | NULL    |                |
+------------------+--------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)

mysql>


I've been suffering with this issue for some time, I first posted on
JavaRanch (http://www.coderanch.com/t/479014/Java-General/java/DBUnit-why-insert-test-data),
but after not getting anywhere I've tried StackOverflow
(http://stackoverflow.com/questions/2210429/dbunit-confusion-over-case-sensitivity-on-table-column-names)
as well.

Is it possible I have found a bug? Or have I missed something in my
configuration?

James Elsey

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: org.dbunit.dataset.NoSuchColumnException

Matthias Gommeringer
In reply to this post by james.elsey
Hi there,

if I remember correctly mysql can be installed in different ways, also depending on the OS. With a quick search I found this: http://www.ja-sig.org/issues/browse/UP-979
You might want to manually retrieve JDBC database metadata and then check whether the returned column names are upper/lowercase. You may also want to play around with the dbunit fully qualified schema names feature.
HTH,
matthias


> -----Ursprüngliche Nachricht-----
> Von: "James Elsey" <[hidden email]>
> Gesendet: 06.02.10 11:17:32
> An: [hidden email]
> Betreff: [dbunit-user] org.dbunit.dataset.NoSuchColumnException


> Hi,
>
> dbunit 2.4.2 (also tried 2.4.7 but same outcome)
> MySQL 5.1.42
>
> My first post here so please go easy!
>
> I'm having an issue with DBunit, my stack trace that I get upon
> application startup is as follows
>
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'dbUnitBootstrapper' defined in ServletContext
> resource [/WEB-INF/applicationContext.xml]: Invocation of init method
> failed; nested exception is org.dbunit.dataset.NoSuchColumnException:
> CLIENT.ID -  (Non-uppercase input column: ID) in ColumnNameToIndexes
> cache map. Note that the map's column names are NOT case sensitive.
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
>        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
>        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
>        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
>        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
>        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
>        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
>        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
>        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
>        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4623)
>        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5323)
>        at com.sun.enterprise.web.WebModule.start(WebModule.java:456)
>        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:922)
>        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:906)
>        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
>        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2205)
>        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1890)
>        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:85)
>        at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:560)
>        at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:547)
>        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:189)
>        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:329)
>        at com.sun.enterprise.v3.admin.CommandRunner$2.execute(CommandRunner.java:302)
>        at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:312)
>        at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:119)
>        at com.sun.enterprise.v3.admin.CommandRunner.doCommand(CommandRunner.java:99)
>        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:250)
>        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:176)
>        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:147)
>        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
>        at com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
>        at com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:570)
>        at com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
>        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
>        at com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
>        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
>        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
>        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
>        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
>        at com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
>        at com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
> Caused by: org.dbunit.dataset.NoSuchColumnException: CLIENT.ID -
> (Non-uppercase input column: ID) in ColumnNameToIndexes cache map.
> Note that the map's column names are NOT case sensitive.
>        at org.dbunit.ant.DbUnitTask.execute(DbUnitTask.java:385)
>        at com.jameselsey.salestracker.testing.DBUnitBootstrapper.execute(DBUnitBootstrapper.java:58)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:616)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1414)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1375)
>        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
>        ... 48 more
> Caused by: org.dbunit.dataset.NoSuchColumnException: CLIENT.ID -
> (Non-uppercase input column: ID) in ColumnNameToIndexes cache map.
> Note that the map's column names are NOT case sensitive.
>        at org.dbunit.dataset.AbstractTableMetaData.getColumnIndex(AbstractTableMetaData.java:117)
>        at org.dbunit.operation.AbstractOperation.getOperationMetaData(AbstractOperation.java:89)
>        at org.dbunit.operation.AbstractBatchOperation.execute(AbstractBatchOperation.java:140)
>        at org.dbunit.operation.CompositeOperation.execute(CompositeOperation.java:79)
>        at org.dbunit.ant.Operation.execute(Operation.java:192)
>        at org.dbunit.ant.DbUnitTask.execute(DbUnitTask.java:380)
>        ... 56 more
>
>
> I'm not sure why I'm having a issue with case sensitive column names,
> since everything I use is uppercase.
>
> My testData looks as follows :
>
>
>    <CLIENT ID="-1"
>        ADDRESS1="some House"
>        ADDRESS2="Russell Rd"
>        COUNTRY="England"
>        COUNTY="Suffolk"
>        MAINPHONENUMBER="0845 1345678"
>        NAME="County Council"
>        POSTCODE="AB1 5TX"
>        SECTOR="Local Government"
>        TOWN="London"
>        WEBSITEURL="www.somesite.gov.uk"/>
>
>
> Please note, that if I remove the ID from my test data, and rely on
> auto-incrementation in mysql, it gives the exact same error, but
> complains about the next item down, being ADDRESS1
>
> My domain objects in my application use JPA column annotations, which
> specify the corresponding column names as they are in test data, and
> in my schema
>
>
> My schema looks as follows
>
> mysql> describe CLIENT;
> +------------------+--------------+------+-----+---------+----------------+
> | Field            | Type         | Null | Key | Default | Extra          |
> +------------------+--------------+------+-----+---------+----------------+
> | ID               | int(11)      | NO   | PRI | NULL    | auto_increment |
> | jdoDetachedState | tinyblob     | YES  |     | NULL    |                |
> | NAME             | varchar(255) | NO   |     | NULL    |                |
> | ADDRESS1         | varchar(255) | YES  |     | NULL    |                |
> | ADDRESS2         | varchar(255) | YES  |     | NULL    |                |
> | COUNTRY          | varchar(255) | YES  |     | NULL    |                |
> | COUNTY           | varchar(255) | YES  |     | NULL    |                |
> | MAINPHONENUMBER  | varchar(255) | YES  |     | NULL    |                |
> | POSTCODE         | varchar(255) | YES  |     | NULL    |                |
> | SECTOR           | varchar(255) | YES  |     | NULL    |                |
> | TOWN             | varchar(255) | YES  |     | NULL    |                |
> | WEBSITEURL       | varchar(255) | YES  |     | NULL    |                |
> +------------------+--------------+------+-----+---------+----------------+
> 12 rows in set (0.00 sec)
>
> mysql>
>
>
> I've been suffering with this issue for some time, I first posted on
> JavaRanch (http://www.coderanch.com/t/479014/Java-General/java/DBUnit-why-insert-test-data),
> but after not getting anywhere I've tried StackOverflow
> (http://stackoverflow.com/questions/2210429/dbunit-confusion-over-case-sensitivity-on-table-column-names)
> as well.
>
> Is it possible I have found a bug? Or have I missed something in my
> configuration?
>
> James Elsey
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>


______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: org.dbunit.dataset.NoSuchColumnException

snakelocks
This post has NOT been accepted by the mailing list yet.
In reply to this post by james.elsey
See also: 'Why am I getting a "NoSuchColumnException" but I am sure that the column actually exists?' on http://dbunit.sourceforge.net/faq.html