Giter VIP home page Giter VIP logo

eurekaclinical-common's Introduction

Eureka! Clinical Common Web Application Framework

Georgia Clinical and Translational Science Alliance (Georgia CTSA), Emory University, Atlanta, GA

What does it do?

It implements a custom web application development framework that uses best of breed components:

  • Google Guice 3.0 (dependency injection)
  • Jersey 1.19.4 (REST)
  • Hibernate 5.0.12.Final (object-relational mapping)
  • Tomcat 7

It supports calling these components through the standard APIs specified in and provided by the Eureka! Clinical Web Application Standard APIs project.

It extends the functionality in the Eureka! Clinical Web Application Standard APIs project with the following features and implementations:

  • REST communication objects for users, roles, groups and authorization templates (org.eurekaclinical.common.comm)
  • Base classes for implementing REST clients (org.eurekaclinical.common.comm.clients)
  • Base classes for implementing Guice modules (org.eurekaclinical.common.config)
  • Servlet filters for user authorization (org.eurekaclinical.common.filter)
  • Servlets for login and logout; destroying a session; and proxying (org.eurekaclinical.common.servlet)

See Structure of Eureka! Clinical microservices for how to use the framework. The goal for the version 2.0 release is for all Eureka! Clinical web application components to use this framework.

Latest release: Latest release

Version 3.0

  • Removed RolesFromServiceFilter because Eureka! Clinical webapps no longer need role information.
  • Removed WebappServletModule, which was superceded by APIGatewayServletModule.
  • Removed AbstractAuthorizingServletModule and AbstractAuthorizingJerseyServletModule, which are unused.
  • Add POST and PUT calls for passing a string into an Eureka! Clinical API gateway proxy.
  • Require version 2.1 or greater of eurekaclinical-standard-apis.

Version 2.0

The goal of the 2.0 series is to have sufficient functionality for all Eureka! Clinical web applications to depend on eurekaclinical-common.

Version 1.0

Implemented partial functionality, and only some parts of Eureka! Clinical used it.

Build requirements

Runtime requirements

Building it

The project uses the maven build tool. Typically, you build it by invoking mvn clean install at the command line. For simple file changes, not additions or deletions, you can usually use mvn install. See https://github.com/eurekaclinical/dev-wiki/wiki/Building-Eureka!-Clinical-projects for more details.

Maven dependency

<dependency>
    <groupId>org.eurekaclinical</groupId>
    <artifactId>eurekaclinical-common</artifactId>
    <version>version</version>
</dependency>

Developer documentation

Getting help

Feel free to contact us at [email protected].

eurekaclinical-common's People

Contributors

arpost avatar dgunda1 avatar ndeshpa avatar nityanandareddy avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

eurekaclinical-common's Issues

ClientSessionListener throws com.google.inject.OutOfScopeException

For example:

INFO: Destroying session for client org.eurekaclinical.user.client.EurekaClinicalUserClient for service /eureka-webapp
Aug 24, 2017 3:48:53 PM org.apache.catalina.session.StandardSession expire
SEVERE: Session event listener threw exception
com.google.inject.ProvisionException: Guice provision errors:

1) Error in custom provider, com.google.inject.OutOfScopeException: Cannot access scoped object. Either we are not currently inside an HTTP Servlet request, or you may have forgotten to apply com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
  at edu.emory.cci.aiw.cvrg.eureka.webapp.config.AppModule.configure(AppModule.java:80)
  while locating org.eurekaclinical.user.client.EurekaClinicalUserClient

1 error
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
	at org.eurekaclinical.common.config.ClientSessionListener.sessionDestroyed(ClientSessionListener.java:83)
	at org.apache.catalina.session.StandardSession.expire(StandardSession.java:806)
	at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:656)
	at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:532)
	at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:517)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1352)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.google.inject.OutOfScopeException: Cannot access scoped object. Either we are not currently inside an HTTP Servlet request, or you may have forgotten to apply com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
	at com.google.inject.servlet.GuiceFilter.getContext(GuiceFilter.java:135)
	at com.google.inject.servlet.GuiceFilter.getRequest(GuiceFilter.java:121)
	at com.google.inject.servlet.ServletScopes$2$1.get(ServletScopes.java:114)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
	... 12 more

This appears to occur only when tomcat sweeps active sessions and cleans up any invalid ones. It appears to be a harmless error, but we should handle it (check isValid() ourselves?).

JavaDoc

JavaDoc is not working with mvn install

Uncaught exception in Eureka! Clinical client

A org.apache.http.client.CircularRedirectException occurs when the user is not fully authenticated, so we may want to catch this and respond with a 400 status code.

SEVERE: Servlet.service() for servlet [default] in context with path [/eureka-webapp] threw exception
com.sun.jersey.api.client.ClientHandlerException: org.apache.http.client.ClientProtocolException
        at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)
        at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123)
        at com.sun.jersey.api.client.Client.handle(Client.java:652)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
        at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
        at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:509)
        at org.eurekaclinical.common.comm.clients.EurekaClinicalClient.doGetForProxy(EurekaClinicalClient.java:769)
        at org.eurekaclinical.common.comm.clients.ProxyingClient.proxyGet(ProxyingClient.java:70)
        at org.eurekaclinical.common.servlet.ProxyServlet.doGet(ProxyServlet.java:157)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
        at org.eurekaclinical.standardapis.filter.AbstractRolesFilter.doFilter(AbstractRolesFilter.java:85)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at org.jasig.cas.client.util.AssertionThreadLocalFilter.doFilter(AssertionThreadLocalFilter.java:54)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at org.jasig.cas.client.util.HttpServletRequestWrapperFilter.doFilter(HttpServletRequestWrapperFilter.java:75)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:168)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76)
        at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.http.client.ClientProtocolException
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:822)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
        at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173)
        ... 54 more
Caused by: org.apache.http.client.CircularRedirectException: Circular redirect to 'https://<hostname>/cas-server/login?service=https%3A%2F%2F<hostname>%2Feurekaclinical-user-service%2Fapi%2Fprotected%2Fusers%2Fme&gateway=true'
        at org.apache.http.impl.client.DefaultRedirectStrategy.getLocationURI(DefaultRedirectStrategy.java:168)
        at org.apache.http.impl.client.DefaultRedirectStrategy.getRedirect(DefaultRedirectStrategy.java:193)
        at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:1021)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:482)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
        ... 56 more

ProxyServlet does not handle large POST body content

It currently reads the body into a String, which could create issues for large content uploads. Hopefully we can deal with the content entirely as a stream. If not, we should have a size threshold above which we put the content on disk.

ProxyServlet seems to be passing cookies in responses

The ProxyServlet seems to be designed not to pass cookies in the response headers for Eureka Clinical API gateways, yet the browser ends up with cookies from REST APIs anyway. We need to figure out what is going on.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.