# "Project may not be null" error when deploying Platform with SDK

**URL:** <https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973>\
**Category:** Development\
**Tags:** maven, sdk\
**Created:** [September 7, 2015, 9:31am UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973 "2015-09-07T09:31:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 7, 2015, 9:31am UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/1 "2015-09-07T09:31:47Z")

</div>

I get the following error when running mvn openmrs-sdk:setup

> [ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:2.0.2:setup (default-cli) on project openmrs-sdk-tool: Execution default-cli of goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:2.0.2:setup failed: mavenProject may not be null → [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:2.0.2:setup (default-cli) on project openmrs-sdk-tool: Execution default-cli of goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:2.0.2:setup failed: mavenProject may not be null

How do I configure the mavenProject which is null

---

<div class="post-metadata">

**Author:** ![raff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/raff/32/11894_2.png) [@raff](https://talk.openmrs.org/u/raff)\
**Post date:** [September 7, 2015, 12:11pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/2 "2015-09-07T12:11:27Z")

</div>

@dmytro\_trifonov, have you seen an error like this before?

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 1:35pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/3 "2015-09-08T13:35:51Z")

</div>

Hi!

Can you explain the situation in more detail? What parameters for “setup” you used? From which folder you executed this command?

Also, info about your OS and Maven version may be helpful for us. Currently all tasks from SDK works normally (checked on Kubuntu 15.04 with Maven 3.2.1)

Thanks!

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 8, 2015, 2:23pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/4 "2015-09-08T14:23:34Z")

</div>

@dmytro\_trifonov thanks for getting back to me so quickly, below are more details:

My maven configuration from mvn --version

```
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T14:57:37+03:00)
Maven home: /usr/local/Cellar/maven/3.3.3/libexec
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"

```

The command that I run is from the ddirectory /Users/ssmusoke/IdeaProjects/openmrs-sdk:

```
mvn openmrs-sdk:setup -Dfile=/Users/ssmusoke/IdeaProjects/openmrs-sdk/cbs/cbs.properties -X

```

# properties file:

```
create_database_user=false
openmrs.platform.version=2.2
dbUser=openmrs
dbUri=jdbc\:mysql\://localhost\:3306/openmrs_sdk?autoReconnect\=true&sessionVariables\=storage_engine\=InnoDB&useUnicode\=true&characterEncoding\=UTF-8
serverId=cbs
connection.driver_class=com.mysql.jdbc.Driver
dbPassword=xxxx
admin_user_password=Admin123
install_method=auto
user_modules=org.openmrs.module/dataintegrity/1.1.3,org.openmrs.module/addresshierarchy/2.2.4,org.openmrs.module/birt/2.3.2.1,org.openmrs.module/custombranding/0.1,org.openmrs.module/formfilter/1.0.0,org.openmrs.module/htmlformentry/1.7.1,org.openmrs.module/htmlwidgets/1.6.4,org.openmrs.module/logic/0.4.1,org.openmrs.module/reportingcompatibility/1.5.8,org.openmrs.module/serialization.xstream/0.2.7
add_demo_data=false
module_web_admin=true
has_current_openmrs_database=true
create_tables=true
database_name=openmrs_sdk
version=1.11.2
auto_update_database=false
```

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 2:36pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/5 "2015-09-08T14:36:52Z")

</div>

It looks like you properties file has invalid attribute - ‘serverId’, it must be called ‘server.id’. Maybe this file was created by previous (unstable) version of SDK?

Please try to change ‘serverId’ to ‘server.id’, and then execute ‘setup’

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 2:44pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/6 "2015-09-08T14:44:09Z")

</div>

Also fix some other attributes, see [https://wiki.openmrs.org/display/docs/OpenMRS+SDK#OpenMRSSDK-Example](https://wiki.openmrs.org/display/docs/OpenMRS+SDK#OpenMRSSDK-Example)

Try to use this:

```
create_database_user=false
openmrs.platform.version=2.2
connection.username=openmrs
connection.url=jdbc\:mysql\://localhost\:3306/openmrs_sdk?autoReconnect\=true&sessionVariables\=storage_engine\=InnoDB&useUnicode\=true&characterEncoding\=UTF-8
server.id=cbs
connection.driver_class=com.mysql.jdbc.Driver
connection.password=xxxx
admin_user_password=Admin123
install_method=auto
user_modules=org.openmrs.module/dataintegrity/1.1.3,org.openmrs.module/addresshierarchy/2.2.4,org.openmrs.module/birt/2.3.2.1,org.openmrs.module/custombranding/0.1,org.openmrs.module/formfilter/1.0.0,org.openmrs.module/htmlformentry/1.7.1,org.openmrs.module/htmlwidgets/1.6.4,org.openmrs.module/logic/0.4.1,org.openmrs.module/reportingcompatibility/1.5.8,org.openmrs.module/serialization.xstream/0.2.7
add_demo_data=false
module_web_admin=true
has_current_openmrs_database=true
create_tables=true 
database_name=openmrs_sdk
openmrs.version=1.11.2
auto_update_database=false
```

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 8, 2015, 3:07pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/7 "2015-09-08T15:07:00Z")

</div>

@dmytro\_trifonov updated the properties but still the same error, even after double checking the connection credentials. The tables are also not created in the database

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 3:13pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/8 "2015-09-08T15:13:54Z")

</div>

Can you execute

```
mvn openmrs-sdk:setup

```

without parameters and then pass parameters in interactive mode. Is it works?

We didn’t test SDK on a Mac, but I’ll do it in nearest time, if there will be problems.

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 8, 2015, 3:27pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/9 "2015-09-08T15:27:31Z")

</div>

Strange the plain SDK seems to work, I have gone ahead and removed all the parameters from the properties file, which seemed to work with no errors. However the error seems to be tied to the modules configuration, so when I have even one module I get an error.

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 6:10pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/10 "2015-09-08T18:10:16Z")

</div>

Thanks for your reply, I found a bug in SDK, and just fixed it in sources. In nearest time we will release a fix version. I will notify you about that.

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 8, 2015, 6:31pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/11 "2015-09-08T18:31:45Z")

</div>

@dmytro\_trifonov maybe you can send me a patch so that I run a test in my environment to verify the bug fix

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 6:43pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/12 "2015-09-08T18:43:40Z")

</div>

Ok, but I got another problem, so I need more time.

Can you tell me, “user modules” which listed in the properties file - are they published on maven central or [mavenrepo.openmrs.org](http://mavenrepo.openmrs.org)?

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 8, 2015, 6:48pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/13 "2015-09-08T18:48:42Z")

</div>

Here is the module list

user\_modules=org.openmrs.module/dataintegrity/1.1.3,org.openmrs.module/addresshierarchy/2.2.4,org.openmrs.module/birt/2.3.2.1,org.openmrs.module/custombranding/0.1,org.openmrs.module/formfilter/1.0.0,org.openmrs.module/htmlformentry/1.7.1,org.openmrs.module/htmlwidgets/1.6.4,org.openmrs.module/logic/0.4.1,org.openmrs.module/reportingcompatibility/1.5.8,org.openmrs.module/serialization.xstream/0.2.7

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 6:54pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/14 "2015-09-08T18:54:17Z")

</div>

You installed them manually, using mvn openmrs-sdk:install ?

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 8, 2015, 6:59pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/15 "2015-09-08T18:59:35Z")

</div>

@dmytro\_trifonov I added them to the properties file, and what I have seen is that they are not downloaded in the modules directory of the at /Users/ssmusoke/openmrs//modules as I would expect. Not sure if the configuration is right, I assume that it is.

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 8:01pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/16 "2015-09-08T20:01:39Z")

</div>

Modules can be loaded from:

1. Local Maven repository
2. Maven central
3. OpenMRS Maven repository

It seems like some of you modules (for example, dataintegrity) doesn’t published on central or OpenMRS repository (which is [http://mavenrepo.openmrs.org/](http://mavenrepo.openmrs.org/)). But maybe they are installed in you local repo?. Please check it before trying to setup a server.

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 8, 2015, 8:09pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/17 "2015-09-08T20:09:19Z")

</div>

You may try to use plugin from sources, where I fixed bug with “null MavenProject”

```
git clone https://github.com/diospark/openmrs-contrib-sdk-maven-plugin.git
cd openmrs-contrib-sdk-maven-plugin
mvn clean install

```

and then use local version of SDK:

```
mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:2.0-SNAPSHOT:<command> [parameters].
```

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 10, 2015, 12:15pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/18 "2015-09-10T12:15:34Z")

</div>

1. @dmytro\_trifonov just noticed another bug with the SDK, it only downloads the first module in the user\_modules list.

2. Another question, there is a default modules list for the platform that is downloaded as part of setup, however in my case I am using some older versions of the modules, does the list in the SDK constants ever get updated or merged with what is in the properties file?

3. The current error I am getting from the snapshot is Caused by: java.lang.NullPointerException at org.openmrs.maven.plugins.utility.PropertyManager.replaceDbNameInDbUri(PropertyManager.java:160), however I have corrected all the constants to match the names on the page.

Thanks for all your assistance and support with this

---

<div class="post-metadata">

**Author:** ![dmytro.trifonov](https://talk.openmrs.org/letter_avatar/dmytro.trifonov/32/6_449c533f586939b6e5f246632a46421f.png) [@dmytro.trifonov](https://talk.openmrs.org/u/dmytro.trifonov)\
**Post date:** [September 10, 2015, 8:39pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/19 "2015-09-10T20:39:41Z")

</div>

1. You mean, that setup finished successfully, but only one module was loaded?
2. The feature of installing user modules was designed for testing modules, which is user develops. We don’t expect that this modules will be the part of OpenMRS distro. So, when you will try to install modules, which higher versions already installed, it may cause problems. It will be better to download them manually, and put them to `$HOME/openrms/*SERVER_ID*/modules` folder
3. Can you put there command, attributes and full log for this error? Thanks!

---

<div class="post-metadata">

**Author:** ![ssmusoke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ssmusoke/32/8020_2.png) [@ssmusoke](https://talk.openmrs.org/u/ssmusoke)\
**Post date:** [September 15, 2015, 2:52pm UTC](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973/20 "2015-09-15T14:52:21Z")

</div>

@dmytro\_trifonov I suspect that I was using the SDK in a way that it was not meant to be used, so I have changed tactics and am now using a distro approach just like the reference application to build the required modules for distribution. Thanks for your assistance, and patience with the back and forth.

[Next page](https://talk.openmrs.org/t/project-may-not-be-null-error-when-deploying-platform-with-sdk/2973.md?page=2)
