# Cannot upload OPT template using EHRBase Java SDK v1.19.0 **Category:** [New to openEHR?](https://discourse.openehr.org/c/new-to-openehr/13) **Created:** 2022-07-25 18:35 UTC **Views:** 1205 **Replies:** 3 **URL:** https://discourse.openehr.org/t/cannot-upload-opt-template-using-ehrbase-java-sdk-v1-19-0/2864 --- ## Post #1 by @pawat Hi, I'm new to OpenEHR & EHRBase. I have studied the OpenEHR specification. I found that many concepts are interesting. I want to make a proof of concept to use Spring Boot with EHRBase as a backend with some business logic. I have already tried angular-SDK-example. I now want to start my own API development using Java, following the example but with different package versions. (I'm not Java Developer. I usually use Typescript.). Here is my stack * Java 11 * Spring Boot v2.7.1 * EHRBase SDK Client v1.19.0 After running a repo, I found that the service cannot upload new OPT with following error, ``` Caused by: org.ehrbase.client.exception.WrongStatusCodeException: Wrong Status code. Expected: [200, 201, 204]. Got: 404. Error message: HTTP Status 404 – Not Found

HTTP Status 404 – Not Found

at org.ehrbase.client.openehrclient.defaultrestclient.DefaultRestClient.checkStatus(DefaultRestClient.java:283) ~[client-1.18.0.jar:na] at org.ehrbase.client.openehrclient.defaultrestclient.DefaultRestClient.internalPost(DefaultRestClient.java:167) ~[client-1.18.0.jar:na] at org.ehrbase.client.openehrclient.defaultrestclient.DefaultRestTemplateEndpoint.upload(DefaultRestTemplateEndpoint.java:132) ~[client-1.18.0.jar:na] at org.ehrbase.client.openehrclient.defaultrestclient.DefaultRestTemplateEndpoint.ensureExistence(DefaultRestTemplateEndpoint.java:113) ~[client-1.18.0.jar:na] at com.example.democpoe.config.ClientConfig.lambda$afterPropertiesSet$0(ClientConfig.java:63) ~[classes/:na] at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na] at com.example.democpoe.config.ClientConfig.afterPropertiesSet(ClientConfig.java:60) ~[classes/:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.21.jar:5.3.21] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.21.jar:5.3.21] ... 21 common frames omitted ``` Here is my POC repo [GitHub POC Repo](https://github.com/cortexcloud/demo-cpoe-openehr). Can anyone suggest what should I do next? Best regards Pawat --- ## Post #2 by @birger.haarbrandt Hi @pawat, welcome to the forum and great that you are evaluating EHRbase and the SDK! If you can post the template, I would like to try uploading it directly using the REST API. For me it is a bit hard to tell, but the error message might be a hint that the SDK does not call the right endpoints URL for the template upload. Cheers, Birger --- ## Post #3 by @pawat Hi @birger.haarbrandt , The template is in this folder https://github.com/cortexcloud/demo-cpoe-openehr/tree/main/src/main/resources/opt. First, I used the template that I built by myself. It was not working, so I used the template from angular-sdk-example and it was also not working. Furthermore, I tried to upload directly to EHRBase API using this path and there was no problem to insert directly. ``` curl --request POST \ --url http://localhost:8080/ehrbase/rest/openehr/v1/definition/template/adl1.4/ \ --header 'Content-Type: application/xml' \ --header 'Prefer: return=minimal' \ --data ' ' ``` Thank you for your help. Pawat --- ## Post #4 by @ISys Hey, Any update on that? I also have this problem. Update: in my case the error is: > fhir-bridge | 2023-06-14 17:56:10.180 INFO 1 --- [ main] o.e.f.c.e.EhrbaseTemplateInitializer : Create template 'Beatmungswerte' fhir-bridge | Caused by: org.ehrbase.client.exception.WrongStatusCodeException: Wrong Status code. Expected: [200, 201, 204]. Got: 404. Error message: HTTP Status 404 ? Not Found

HTTP Status 404 ? Not Found

Best, Rafał --- **Canonical:** https://discourse.openehr.org/t/cannot-upload-opt-template-using-ehrbase-java-sdk-v1-19-0/2864 **Original content:** https://discourse.openehr.org/t/cannot-upload-opt-template-using-ehrbase-java-sdk-v1-19-0/2864