# Missing classes in EtherCIS VirtualEhr

**URL:** <https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598>\
**Category:** Implementers (archive)\
**Created:** [27 August 2018 11:21 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598 "2018-08-27T11:21:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [27 August 2018 11:21 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/1 "2018-08-27T11:21:10Z")

</div>

Hello,  
I try to compile the EtherCIS project. I managed to compile the openehr-java-libs as well as the ehrservice projects. But I have a problem with the VirtualEhr:  
In the project ecis-vehr-service there is a class FileDispatchMapper that uses the two classes com.ethercis.ehrserver.servicemap.Action and com.ethercis.ehrserver.servicemap.MapperDociument. However, there is no namespace com.ethercis.ehrserver and so those two classes also do not exist.  
What am I missing ? Did i forget to import a missing project that includes those classes ?  
Greetings  
Georg

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [27 August 2018 11:35 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/2 "2018-08-27T11:35:56Z")

</div>

Hi George,

If you test EtherCIS, docker image is available and convenient. Please  
clone from my repository.  
[https://github.com/alessfg/docker-ethercis](https://github.com/alessfg/docker-ethercis)  
This is a working image, so I guess you can find what you are missing  
compared with your environment.

Regards,  
Shinji Kobayashi

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [28 August 2018 11:05 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/3 "2018-08-28T11:05:14Z")

</div>

Hi Shinji,  
Oh, thank you for that hint. The docker image looks very promising. I started the image and tried to play a bit with the API but I have some questions:  
- Most REST-commands require a session to be started first. When trying to start a session I have to provide a username and password. Is there already a default user that can be used ? How can additional users be added ?  
- Which user/password credentials can be used to access and administrate the Postgres-Database in the container ? Is there an admin that can be used ?  
- Would it be possible to use an existing Postgres-Server instead of the one included in the image ? What files would have to be modified to use an existing server ?  
Greetings  
Georg

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [28 August 2018 11:22 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/4 "2018-08-28T11:22:21Z")

</div>

Hi George,

To get session\_id, I use the credential, ID: root, Password: secret.  
The information about authentication is here.  
[https://github.com/skoba/docker-ethercis/blob/master/application/ethercis-1.2.0/conf/security/authenticate.ini](https://github.com/skoba/docker-ethercis/blob/master/application/ethercis-1.2.0/conf/security/authenticate.ini)

I have not tried to use existing postgres server out of docker, but it  
might be possible by modification to Dockerfile and docker-compose.yml

Shinji Kobayashi

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [28 August 2018 11:33 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/5 "2018-08-28T11:33:25Z")

</div>

If you need to access potgresql server on docker image, port 2345 is opened.  
For example, this command is available.

> psql --host localhost --port 2345 --user postgres

Shinji

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [28 August 2018 11:48 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/6 "2018-08-28T11:48:24Z")

</div>

This pom.xml shows the credential to connect postgresql is user:  
postgres and password: psotgres as default.  
[https://github.com/ethercis/ehrservice/blob/remote-github/jooq-pq/pom.xml](https://github.com/ethercis/ehrservice/blob/remote-github/jooq-pq/pom.xml)

Shinji

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [29 August 2018 14:45 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/7 "2018-08-29T14:45:09Z")

</div>

Hello Shinji,  
I still have a problem creating a session with the user "root" with password "secret".  
I post a http request to the server via

curl -X POST -i [http://localhost:8888/rest/v1/session](http://localhost:8888/rest/v1/session)

This causes a Shiro-Authentification-page to open in which I enter the credentials and accept with "OK".  
The application inside the docker container then outputs this exception:

2018-08-29 14:34:25.286 WARNING 17-qtp1054932644-17 com.ethercis.logonservice.session.SessionManager connect: Access is denied: ServiceManagerException errorCode=[user.connect] location=[com.ethercis.authenticate.shiro.ShiroAuthenticate] message=[#1.0.0 Unknown account:ethercis]  
INFO - com.ethercis.vehr.AccessLog.log(59) | unknown:post:rest/v1/session  
INFO - com.ethercis.vehr.VEhrGateServlet.syncExecute(640) | Error trapped:#1.0.0 Unknown account:ethercis

Do you have an idea what could be the problem ?  
Greetings  
Georg

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [29 August 2018 15:21 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/8 "2018-08-29T15:21:04Z")

</div>

Hi Georg,

Just try this.

> curl -X POST -i '[http://localhost:8888/rest/v1/session/?username=root&password=secret](http://localhost:8888/rest/v1/session/?username=root&password=secret)’

then, you will get the followings. You should use http header  
paramater key: Ehr-Session, and value:  
sessionId:172.18.0.3-root-1535555490835--46776562-9 to the next query.

HTTP/1.1 200 OK  
Content-Type: application/json;charset=UTF-8  
x-reconnect: false  
x-session-name: /node/ehrserver/client/root/-1  
x-sessions-in-use: 1  
Ehr-Session: sessionId:172.18.0.3-root-1535555490835--46776562-9  
\_\_rcvTimestampStr: 2018-08-29 15:11:30.859Z  
x-session-timeout: 1800000  
x-max-session: 20  
Content-Language: en-US  
Content-Length: 207  
Server: Jetty(9.2.z-SNAPSHOT)

{  
&nbsp;&nbsp;"meta" : {  
&nbsp;&nbsp;&nbsp;&nbsp;"href" : "rest/v1/session?sessionId=sessionId:172.18.0.3-root-1535555490835--46776562-9"  
&nbsp;&nbsp;},  
&nbsp;&nbsp;"action" : "CREATE",  
&nbsp;&nbsp;"sessionId" : "sessionId:172.18.0.3-root-1535555490835--46776562-9"  
}

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [29 August 2018 19:27 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/9 "2018-08-29T19:27:59Z")

</div>

Hi Shinji,  
Cool, that worked, thank you.  
I now got my sessionID and tried to create an EHR with

curl -X POST -H 'Ehr-Session: sessionId:172.18.0.3-root-1535570266743--2067865307-17' -i [http://localhost:8888/rest/v1/ehr](http://localhost:8888/rest/v1/ehr)

That resulted in this response:

\<html\>  
\<head\>  
\<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/\>  
\<title\>Error 500 \</title\>  
\</head\>  
\<body\>  
\<h2\>HTTP ERROR: 500\</h2\>  
\<p\>Problem accessing /rest/v1/ehr. Reason:  
\<pre\> #1.0.0 Invocation exception to method:create:org.jooq.exception.DataAccessException: SQL [select 1 as "one" where exists (select 1 as "one" from "ehr"."party\_identified" where ("ehr"."party\_identified"."party\_ref\_namespace" = ? and "ehr"."party\_identified"."party\_ref\_scheme" = ? and "ehr"."party\_identified"."party\_ref\_value" = ?))]; This connection has been closed.\</pre\>\</p\>  
\<hr /\>\<i\>\<small\>Powered by Jetty://\</small\>\</i\>  
\</body\>  
\</html\>

This is the output of the application inside the Docker:

app\_1 | INFO - com.ethercis.vehr.AccessLog.info(64) | userId=USER[SHIRO]\_root,method=post,path=rest/v1/ehr,qryparams={x-client-ip=172.18.0.1;}  
app\_1 | WARN - com.ethercis.vehr.RequestDispatcher.dispatch(672) | Invocation exception to method:create  
app\_1 | org.jooq.exception.DataAccessException: SQL [select 1 as "one" where exists (select 1 as "one" from "ehr"."party\_identified" where ("ehr"."party\_identified"."party\_ref\_namespace" = ? and "ehr"."party\_identified"."party\_ref\_scheme" = ? and "ehr"."party\_identified"."party\_ref\_value" = ?))]; This connection has been closed.  
app\_1 | at org.jooq.impl.Tools.translate(Tools.java:1690)  
app\_1 | at org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:660)  
app\_1 | at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:354)  
app\_1 | at org.jooq.impl.AbstractResultQuery.fetchLazy(AbstractResultQuery.java:341)  
app\_1 | at org.jooq.impl.AbstractResultQuery.fetchLazy(AbstractResultQuery.java:328)  
app\_1 | at org.jooq.impl.AbstractResultQuery.fetchOne(AbstractResultQuery.java:493)  
app\_1 | at org.jooq.impl.SelectImpl.fetchOne(SelectImpl.java:2735)  
app\_1 | at org.jooq.impl.DefaultDSLContext.fetchExists(DefaultDSLContext.java:2663)  
app\_1 | at org.jooq.impl.DefaultDSLContext.fetchExists(DefaultDSLContext.java:2673)  
app\_1 | at com.ethercis.dao.access.jooq.PartyIdentifiedAccess.findReferencedParty(PartyIdentifiedAccess.java:301)  
app\_1 | at com.ethercis.dao.access.jooq.PartyIdentifiedAccess.getOrCreateParty(PartyIdentifiedAccess.java:385)  
app\_1 | at com.ethercis.dao.access.interfaces.I\_PartyIdentifiedAccess.getOrCreatePartyByExternalRef(I\_PartyIdentifiedAccess.java:182)  
app\_1 | at com.ethercis.persistence.AuditSetter.getCommitter(AuditSetter.java:66)  
app\_1 | at com.ethercis.persistence.AuditSetter.handleProperties(AuditSetter.java:60)  
app\_1 | at com.ethercis.ehrservice.EhrService.create(EhrService.java:226)  
app\_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
app\_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
app\_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
app\_1 | at java.lang.reflect.Method.invoke(Method.java:498)  
app\_1 | at com.ethercis.vehr.RequestDispatcher.dispatch(RequestDispatcher.java:654)  
app\_1 | at com.ethercis.vehr.RequestDispatcher.dispatch(RequestDispatcher.java:691)  
app\_1 | at com.ethercis.vehr.AccessGateService.queryHandler(AccessGateService.java:295)  
app\_1 | at com.ethercis.vehr.VEhrGateServlet.syncExecute(VEhrGateServlet.java:633)  
app\_1 | at com.ethercis.vehr.VEhrGateServlet.processRequest(VEhrGateServlet.java:611)  
app\_1 | at com.ethercis.vehr.VEhrGateServlet.doPost(VEhrGateServlet.java:451)  
app\_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)  
app\_1 | at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)  
app\_1 | at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)  
app\_1 | at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)  
app\_1 | at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:259)  
app\_1 | at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:222)  
app\_1 | at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)  
app\_1 | at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)  
app\_1 | at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)  
app\_1 | at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)  
app\_1 | at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)  
app\_1 | at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)  
app\_1 | at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)  
app\_1 | at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)  
app\_1 | at org.eclipse.jetty.server.Server.handle(Server.java:497)  
app\_1 | at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)  
app\_1 | at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)  
app\_1 | at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)  
app\_1 | at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)  
app\_1 | at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)  
app\_1 | at java.lang.Thread.run(Thread.java:745)  
app\_1 | Caused by: org.postgresql.util.PSQLException: This connection has been closed.  
app\_1 | at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:861)  
app\_1 | at org.postgresql.jdbc3.AbstractJdbc3Connection.prepareStatement(AbstractJdbc3Connection.java:281)  
app\_1 | at org.postgresql.jdbc2.AbstractJdbc2Connection.prepareStatement(AbstractJdbc2Connection.java:334)  
app\_1 | at org.jooq.impl.ProviderEnabledConnection.prepareStatement(ProviderEnabledConnection.java:112)  
app\_1 | at org.jooq.impl.SettingsEnabledConnection.prepareStatement(SettingsEnabledConnection.java:76)  
app\_1 | at org.jooq.impl.AbstractResultQuery.prepare(AbstractResultQuery.java:227)  
app\_1 | at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:314)  
app\_1 | ... 43 more  
app\_1 | INFO - com.ethercis.vehr.VEhrGateServlet.syncExecute(640)

> Error trapped:#1.0.0 Invocation exception to

method:create:org.jooq.exception.DataAccessException: SQL [select 1 as "one" where exists (select 1 as "one" from "ehr"."party\_identified" where ("ehr"."party\_identified"."party\_ref\_namespace" = ? and "ehr"."party\_identified"."party\_ref\_scheme" = ? and "ehr"."party\_identified"."party\_ref\_value" = ?))]; This connection has been closed.

Did I use the POST command to create a new EHR correctly ? I have interpreted the API that there are no further parameters mandatory. What could have gone wrong ?  
Greetings  
Georg

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [30 August 2018 10:20 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/10 "2018-08-30T10:20:59Z")

</div>

thanks Georg, Shinji

Can I ask you to post a summary of this issue and its resolution as an issue here please?  
[https://github.com/ethercis/ethercis/issues](https://github.com/ethercis/ethercis/issues)

Appreciate you working through this and sharing your learning with the community, so we can improve the documentation etc

thanks  
Tony

Dr. Tony Shannon  
Director, Ripple Foundation [ripple.foundation](http://ripple.foundation/)  
Director, Apperta Foundation [apperta.org](http://apperta.org/)  
[tony.shannon@ripple.foundation](mailto:tony.shannon@ripple.foundation)

+44.789.988.5068 (UK)

+353.89.457.6011 (Ireland)

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [30 August 2018 13:11 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/11 "2018-08-30T13:11:07Z")

</div>

Hi Georg,

No. You have to post subjectId(usually, UUID) to create EHR.  
API of EtherCIS is similar to EhrScape.  
[https://code4health.org/platform/open\_interfaces\_apis/ehrscape/ehrscape\_api\_reference](https://code4health.org/platform/open_interfaces_apis/ehrscape/ehrscape_api_reference)

I am sorry I pointed the former version of EhterCIS repository. My  
repository is based on recent v1.2.0.  
[https://github.com/skoba/docker-ethercis](https://github.com/skoba/docker-ethercis)

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [30 August 2018 13:13 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/12 "2018-08-30T13:13:04Z")

</div>

Off course, Tony. It is my great pleasure that my humble works could  
contribute you.

Best regards,  
Shinji Kobayashi

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [30 August 2018 13:22 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/13 "2018-08-30T13:22:56Z")

</div>

We appreciate your efforts Shinji  
Many thanks again  
Tony

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [30 August 2018 18:04 UTC](https://discourse.openehr.org/t/missing-classes-in-ethercis-virtualehr/16598/14 "2018-08-30T18:04:01Z")

</div>

Hello Shinji,  
Thank you again for your advice.  
With the subjectId and the subjectNamespace given the creation of an EHR worked.  
When I use the Docker container with Version 1.2.0 the problem with the login via the Shiro webpage also worked as intended, so there the problem somehow seems to be fixed.

Hello Tony,  
I just created an issue with my initial problem with the missing classes in the repository you mentioned. My other problems were rather my misunderstandings and wrong usages of the API.  
Greetings  
Georg
