OHDSI Home | Forums | Wiki | Github

WebAPI - Source & source_daimon configuration for Postgresql


(Robert Miller) #1

I’m trying to implement the WebAPI on Postgresql and am stuck at the configuration of source and source_daimon as described in the instructions. The WebAPI is successfully finding the sources as the localhost:8080/WebAPI/source/sources returns the assigned values. However, when testing the the api with ‘http://localhost:8080/WebAPI/vocabulary/concept/0’, I get an error.

I’m hoping someone can spot what I have wrong in terms of configuration. The CDM tables and Vocabulary are both located in the ‘cdm’ database / ‘public’ schema. The WebAPI is located in the ‘OHDSI’ database / ‘webapi’ schema.

source

1;“My Cdm”;“cdm”;“jdbc:postgresql://localhost:5432/cdm?user={user}&password={password}”;“postgresql”
2;“ohdsi”;“OHDSI”;“jdbc:postgresql://localhost:5432/OHDSI?user={user}&password={password}”;“postgresql”

source_daimon

1;1;0;“public”;0
2;1;1;“public”;1
3;2;2;“webapi”;0

…/WebAPI/sources/sources output

[{“sourceId”:1,“sourceName”:“My Cdm”,“sourceDialect”:“postgresql”,“sourceKey”:“cdm”,“daimons”:[{“sourceDaimonId”:1,“daimonType”:“CDM”,“tableQualifier”:“public”,“priority”:“0”},{“sourceDaimonId”:2,“daimonType”:“Vocabulary”,“tableQualifier”:“public”,“priority”:“1”}]},{“sourceId”:2,“sourceName”:“ohdsi”,“sourceDialect”:“postgresql”,“sourceKey”:“OHDSI”,“daimons”:[{“sourceDaimonId”:3,“daimonType”:“Results”,“tableQualifier”:“webapi”,“priority”:“0”}]}]

…/WebAPI/vocabulary/concept/0 output

{“payload”:{“cause”:null,“stackTrace”:[{“methodName”:“run”,“fileName”:“ServerRuntime.java”,“lineNumber”:268,“className”:“org.glassfish.jersey.server.ServerRuntime$1”,“nativeMethod”:false},{“methodName”:“call”,“fileName”:“Errors.java”,“lineNumber”:271,“className”:“org.glassfish.jersey.internal.Errors$1”,“nativeMethod”:false},{“methodName”:“call”,“fileName”:“Errors.java”,“lineNumber”:267,“className”:“org.glassfish.jersey.internal.Errors$1”,“nativeMethod”:false},{“methodName”:“process”,“fileName”:“Errors.java”,“lineNumber”:315,“className”:“org.glassfish.jersey.internal.Errors”,“nativeMethod”:false},{“methodName”:“process”,“fileName”:“Errors.java”,“lineNumber”:297,“className”:“org.glassfish.jersey.internal.Errors”,“nativeMethod”:false},{“methodName”:“process”,“fileName”:“Errors.java”,“lineNumber”:267,“className”:“org.glassfish.jersey.internal.Errors”,“nativeMethod”:false},{“methodName”:“runInScope”,“fileName”:“RequestScope.java”,“lineNumber”:297,“className”:“org.glassfish.jersey.process.internal.RequestScope”,“nativeMethod”:false},{“methodName”:“process”,“fileName”:“ServerRuntime.java”,“lineNumber”:254,“className”:“org.glassfish.jersey.server.ServerRuntime”,“nativeMethod”:false},{“methodName”:“handle”,“fileName”:“ApplicationHandler.java”,“lineNumber”:1030,“className”:“org.glassfish.jersey.server.ApplicationHandler”,“nativeMethod”:false},{“methodName”:“service”,“fileName”:“WebComponent.java”,“lineNumber”:377,“className”:“org.glassfish.jersey.servlet.WebComponent”,“nativeMethod”:false},{“methodName”:“service”,“fileName”:“ServletContainer.java”,“lineNumber”:381,“className”:“org.glassfish.jersey.servlet.ServletContainer”,“nativeMethod”:false},{“methodName”:“service”,“fileName”:“ServletContainer.java”,“lineNumber”:344,“className”:“org.glassfish.jersey.servlet.ServletContainer”,“nativeMethod”:false},{“methodName”:“service”,“fileName”:“ServletContainer.java”,“lineNumber”:221,“className”:“org.glassfish.jersey.servlet.ServletContainer”,“nativeMethod”:false},{“methodName”:“internalDoFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:292,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:207,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“WsFilter.java”,“lineNumber”:52,“className”:“org.apache.tomcat.websocket.server.WsFilter”,“nativeMethod”:false},{“methodName”:“internalDoFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:240,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:207,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilterInternal”,“fileName”:“HiddenHttpMethodFilter.java”,“lineNumber”:77,“className”:“org.springframework.web.filter.HiddenHttpMethodFilter”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“OncePerRequestFilter.java”,“lineNumber”:107,“className”:“org.springframework.web.filter.OncePerRequestFilter”,“nativeMethod”:false},{“methodName”:“internalDoFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:240,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:207,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilterInternal”,“fileName”:“RequestContextFilter.java”,“lineNumber”:98,“className”:“org.springframework.web.filter.RequestContextFilter”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“OncePerRequestFilter.java”,“lineNumber”:107,“className”:“org.springframework.web.filter.OncePerRequestFilter”,“nativeMethod”:false},{“methodName”:“internalDoFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:240,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:207,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilterInternal”,“fileName”:“CharacterEncodingFilter.java”,“lineNumber”:88,“className”:“org.springframework.web.filter.CharacterEncodingFilter”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“OncePerRequestFilter.java”,“lineNumber”:107,“className”:“org.springframework.web.filter.OncePerRequestFilter”,“nativeMethod”:false},{“methodName”:“internalDoFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:240,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:207,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“ErrorPageFilter.java”,“lineNumber”:108,“className”:“org.springframework.boot.context.web.ErrorPageFilter”,“nativeMethod”:false},{“methodName”:“access$000”,“fileName”:“ErrorPageFilter.java”,“lineNumber”:59,“className”:“org.springframework.boot.context.web.ErrorPageFilter”,“nativeMethod”:false},{“methodName”:“doFilterInternal”,“fileName”:“ErrorPageFilter.java”,“lineNumber”:88,“className”:“org.springframework.boot.context.web.ErrorPageFilter$1”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“OncePerRequestFilter.java”,“lineNumber”:107,“className”:“org.springframework.web.filter.OncePerRequestFilter”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“ErrorPageFilter.java”,“lineNumber”:101,“className”:“org.springframework.boot.context.web.ErrorPageFilter”,“nativeMethod”:false},{“methodName”:“internalDoFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:240,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“doFilter”,“fileName”:“ApplicationFilterChain.java”,“lineNumber”:207,“className”:“org.apache.catalina.core.ApplicationFilterChain”,“nativeMethod”:false},{“methodName”:“invoke”,“fileName”:“StandardWrapperValve.java”,“lineNumber”:212,“className”:“org.apache.catalina.core.StandardWrapperValve”,“nativeMethod”:false},{“methodName”:“invoke”,“fileName”:“StandardContextValve.java”,“lineNumber”:106,“className”:“org.apache.catalina.core.StandardContextValve”,“nativeMethod”:false},{“methodName”:“invoke”,“fileName”:“AuthenticatorBase.java”,“lineNumber”:502,“className”:“org.apache.catalina.authenticator.AuthenticatorBase”,“nativeMethod”:false},{“methodName”:“invoke”,“fileName”:“StandardHostValve.java”,“lineNumber”:141,“className”:“org.apache.catalina.core.StandardHostValve”,“nativeMethod”:false},{“methodName”:“invoke”,“fileName”:“ErrorReportValve.java”,“lineNumber”:79,“className”:“org.apache.catalina.valves.ErrorReportValve”,“nativeMethod”:false},{“methodName”:“invoke”,“fileName”:“AbstractAccessLogValve.java”,“lineNumber”:616,“className”:“org.apache.catalina.valves.AbstractAccessLogValve”,“nativeMethod”:false},{“methodName”:“invoke”,“fileName”:“StandardEngineValve.java”,“lineNumber”:88,“className”:“org.apache.catalina.core.StandardEngineValve”,“nativeMethod”:false},{“methodName”:“service”,“fileName”:“CoyoteAdapter.java”,“lineNumber”:528,“className”:“org.apache.catalina.connector.CoyoteAdapter”,“nativeMethod”:false},{“methodName”:“process”,“fileName”:“AbstractHttp11Processor.java”,“lineNumber”:1099,“className”:“org.apache.coyote.http11.AbstractHttp11Processor”,“nativeMethod”:false},{“methodName”:“process”,“fileName”:“AbstractProtocol.java”,“lineNumber”:670,“className”:“org.apache.coyote.AbstractProtocol$AbstractConnectionHandler”,“nativeMethod”:false},{“methodName”:“doRun”,“fileName”:“NioEndpoint.java”,“lineNumber”:1520,“className”:“org.apache.tomcat.util.net.NioEndpoint$SocketProcessor”,“nativeMethod”:false},{“methodName”:“run”,“fileName”:“NioEndpoint.java”,“lineNumber”:1476,“className”:“org.apache.tomcat.util.net.NioEndpoint$SocketProcessor”,“nativeMethod”:false},{“methodName”:“runWorker”,“fileName”:“ThreadPoolExecutor.java”,“lineNumber”:1142,“className”:“java.util.concurrent.ThreadPoolExecutor”,“nativeMethod”:false},{“methodName”:“run”,“fileName”:“ThreadPoolExecutor.java”,“lineNumber”:617,“className”:“java.util.concurrent.ThreadPoolExecutor$Worker”,“nativeMethod”:false},{“methodName”:“run”,“fileName”:“TaskThread.java”,“lineNumber”:61,“className”:“org.apache.tomcat.util.threads.TaskThread$WrappingRunnable”,“nativeMethod”:false},{“methodName”:“run”,“fileName”:“Thread.java”,“lineNumber”:745,“className”:“java.lang.Thread”,“nativeMethod”:false}],“response”:{“context”:{“headers”:{},“entity”:null,“entityType”:null,“entityAnnotations”:[],“entityStream”:{“closed”:false,“committed”:false},“length”:-1,“language”:null,“location”:null,“lastModified”:null,“date”:null,“mediaType”:null,“committed”:false,“links”:[],“entityClass”:null,“stringHeaders”:{},“acceptableMediaTypes”:[{“type”:"",“subtype”:"",“parameters”:{},“quality”:1000,“wildcardSubtype”:true,“wildcardType”:true}],“entityTag”:null,“allowedMethods”:[],“requestCookies”:{},“acceptableLanguages”:["*"],“responseCookies”:{}},“status”:404,“length”:-1,“language”:null,“location”:null,“lastModified”:null,“date”:null,“entity”:null,“cookies”:{},“mediaType”:null,“metadata”:{},“links”:[],“stringHeaders”:{},“statusInfo”:“NOT_FOUND”,“entityTag”:null,“allowedMethods”:[],“headers”:{}},“localizedMessage”:“HTTP 404 Not Found”,“message”:“HTTP 404 Not Found”,“suppressed”:[]},“headers”:{“id”:“5dd6a0ea-776c-dc39-5c0e-96a8930d663d”,“timestamp”:1471888442703}}

Any help would be greatly appreciated


(Don Torok) #2

The first thing is that the URL for the vocabulary service is http://localhost:8080/WebAPI/{source_key}/vocabulary/concept/0 where the source key is “cdm”, the source_key in your source table. Give that a try.


(Robert Miller) #3

That solved it. I assume the test requests provided on the Github page are outdated?

Much appreciated!


(Don Torok) #4

I will leave it to you to write up an issue in githup for webApi that the
ReadMe is incorrect. It takes a community.


(Vikram) #5

Hi @rtmill @DTorok

I am facing the same issue. I tried with your solution but didn’t succeed.

I am having some confusion regarding the DB schema. Hope you folks can guide me.

I have a single Database named OHDSI with schemas:public and webapi. This seems different from your where in you seem to have two seperate databse for CDM tables and vocabulary and webapi as per your instruction.

I went through the WebAPI documentation again , but coudn’t find anything to suggest me to create two database i.e cdm and OHDSI database.Where should i be looking for the db and schemas if i am missing something here…

I followed the below links for the webapi installation:
[[http://www.ohdsi.org/web/wiki/doku.php?id=documentation:software:webapi:webapi_installation_guide]](http://WebAPI installation guide)
[[http://www.ohdsi.org/web/wiki/doku.php?id=documentation:software:webapi:setup]](http://WebAPI setup)
[https://github.com/OHDSI/WebAPI/wiki/Source-Configuration](http://source configuration)

Thanks.


(Ambuj) #6

@DTorok
I am also using postgresql for the same.
I have webapi schema under OHDSI database, omop_cdm under CDM schema.
Here is what the entry for source and source_daimon looks like.
Can you please check if I entered it correctly.

image

Also, do we need to have data in Vocabularies in order to test it?
TIA


(Chris Knoll) #7

This has been asked a few times, so perhaps our documentation is failing. But these are the threads that have discussed it:

If there is a need to add additional instructions to describe the logical separation of the WebAPI database and CDM databse, that would be a welcome contribution from the community!

-Chris


(Ambuj) #8

Hi Chris,

I read the articles you mentioned on your previous post but I am still looking out for the solution of the environment and the entries I made for source and source_daimon tables.
I am new to this so coming up with silly questions.


t