org.dbunit.dataset.NoSuchColumnException: PERSON.UNIQUE_ID - (Non-uppercase input column: UNIQUE_ID) in ColumnNameToIndexes cache map. Note that the map's column names are NOT case sensitive.

Hi, all. I meet a new problem when I test my module.

This is the detailed information of module properties:

<properties>
		<openmrsPlatformVersion>1.11.6</openmrsPlatformVersion>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<javaCompilerVersion>1.7</javaCompilerVersion>
	</properties>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.6.1</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

And I met this error report. I think this error might be caused by the version conflict, because I used the “openmrs-sdk” to create a reference application(all settings of it are default) and changed the version of JDK when I wanted to test it.

So, does anyone know how to fix it? And what should I do to fix it?

could you try running jdk 8,have you touched any thin in the liquibase file of your module?

Hi Herbert, actually, if I used the JDK 8, my test class will report an error, “can not load ApplicationContext”, that is why I changed to JDK 7. Besides, I never touched the liquibase file.

hmm am comfortable with running jdk 8 and above,you could add this and we start off with the debugging,i created a module using the sdk not so many days back and things work

1 Like

Can you tell me how did you test your web Controller?

you need to change a few line in the default controller

Like delete the @Autoware objects?

add jdk 8 and dropm me your controller class here ,the Application context error comes from around the controller dropm me what you have in the controller here

This is the code of my Controller

remove ${rootrootArtifactId} and add the exact ArtifactId of your module,build and deploy again your .omod to openmrs

Ok I will try it.

How can I find out the exact ArtifactId of this module? Sorry, I don’t know about it, because I’m not the developer of this module, I just responsible for test.

check in the main pom file of the module

1 Like

I changed it to the exact artificatId I think.

But I meet this problem again.

on get method try adding @RequestMapping(method = RequestMethod.GET) and remove the existing request map and add @RequestMapping(value = "/project1/module/project1/project1.form") after the controller annotation,then try building

I think this module can be used when I install it and deploy on the OpenMRS-platform. I only can not run test class for this controller. So, I just want to make sure you understand my problem.

what happens when you make the above edits

Actually, I just want to run my test class:

But when I run it, I got an error: ‘Failed to load ApplicationContext’. @ibacher told me that I have two choices to fix this problem, one is to change the JDK version from 1.8 to 1.7, that is what I did yesterday, and I met a new problem that mentioned at the beginning of this talk; another is to change the <openmrsPlatformVersion>1.11.6</openmrsPlatformVersion> to 2.0.0. But the class of AdminList can not be found out because its parent class disappear after I did that.

So, I met the new problem when my test class extends the BaseModuleContextSensitiveTest

In a word, If I use the JDK 1.8, <openmrsPlatformVersion>1.11.6</openmrsPlatformVersion> and let my test class extends BaseModuleContextSensitiveTest, I will meet the error: ‘Failed to load ApplicationContext’. If I change the JDK from 1.8 to 1.7, it will lead my test class can not read my test database and meet a new error

on a quick look through of your test,i see you autowire a controller,did you declare this as a bean,second are you pointing to the exact location of your data set?

i see the test has some problems, call the class you want to test with a service not a controller,