GithubHelp home page GithubHelp logo

Comments (15)

jtmelton avatar jtmelton commented on September 2, 2024

@espenaf I have been able to duplicate an issue with the websocket on my side, which I'll try to debug this weekend. As for the server host/port/socket, those are only used when you have the thrift execution mode (as opposed to rest). I'll comment on this ticket with my findings.

from appsensor.

jtmelton avatar jtmelton commented on September 2, 2024

@espenaf Hi, I just pushed a change that resolved the issue on my side with websockets. It looks like sometimes the open session is not enough to write to all sessions. You need to keep track of them locally. I deleted my local cache and rebuilt everything from scratch. Hopefully this helps. Let me know if it works with the latest. You'll have to pull down the latest code and do another 'mvn install'

from appsensor.

espenaf avatar espenaf commented on September 2, 2024

Ok. Looking better, now the Activity Log started showing events, but AppSensorUI still throws the following exception right after login.

08:17:05.406 [http-nio-8084-exec-7] INFO o.o.a.u.h.AssociatedClientApplicationsAuthenticationSuccessHandler - Successful authentication for user: User [username=analyst, userAuthorities=[], groups=[Group [id=1, name=ANALYST, authorities=[Authority [id=2, name=VIEW_CONFIGURATION], Authority [id=4, name=VIEW_DATA]]]], clientApplications=[myclientapp, myclientgeoapp1, myclientgeoapp2, myclientgeoapp3]]
08:17:05.406 [http-nio-8084-exec-7] DEBUG o.o.a.u.h.AssociatedClientApplicationsAuthenticationSuccessHandler - Redirecting to DefaultSavedRequest Url: http://localhost:8084/
08:17:06.189 [http-nio-8084-exec-9] ERROR o.o.a.u.h.AssociatedApplicationsFilter - Error setting associated applications.
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.ws.rs.NotFoundException: HTTP 404 Not Found
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[tomcat-embed-core-8.0.26.jar:8.0.26]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:295) ~[spring-boot-actuator-1.2.6.RELEASE.jar:1.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:85) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) ~[spring-security-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.owasp.appsensor.ui.handler.AssociatedApplicationsFilter.doFilter(AssociatedApplicationsFilter.java:31) ~[classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:102) [spring-boot-actuator-1.2.6.RELEASE.jar:1.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:69) [spring-boot-actuator-1.2.6.RELEASE.jar:1.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526) [tomcat-embed-core-8.0.26.jar:8.0.26]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482) [tomcat-embed-core-8.0.26.jar:8.0.26]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_66]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_66]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.26.jar:8.0.26]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66]
Caused by: javax.ws.rs.NotFoundException: HTTP 404 Not Found
at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:956) ~[jersey-client-2.14.jar:na]
at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:855) ~[jersey-client-2.14.jar:na]
at org.glassfish.jersey.client.JerseyInvocation.access$600(JerseyInvocation.java:91) ~[jersey-client-2.14.jar:na]
at org.glassfish.jersey.client.JerseyInvocation$3.call(JerseyInvocation.java:705) ~[jersey-client-2.14.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.14.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.14.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:228) ~[jersey-common-2.14.jar:na]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:424) ~[jersey-common-2.14.jar:na]
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:701) ~[jersey-client-2.14.jar:na]
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:417) ~[jersey-client-2.14.jar:na]
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:313) ~[jersey-client-2.14.jar:na]
at org.owasp.appsensor.ui.rest.RestReportingEngineFacade.findResponses(RestReportingEngineFacade.java:103) ~[classes/:na]
at org.owasp.appsensor.ui.rest.RestReportingEngineFacade$$FastClassBySpringCGLIB$$5b83c141.invoke() ~[spring-core-4.1.7.RELEASE.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:317) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:350) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:299) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61) ~[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.owasp.appsensor.ui.rest.RestReportingEngineFacade$$EnhancerBySpringCGLIB$$675b37bb.findResponses() ~[spring-core-4.1.7.RELEASE.jar:na]
at org.owasp.appsensor.ui.controller.DashboardController.activeResponses(DashboardController.java:68) ~[classes/:na]
at org.owasp.appsensor.ui.controller.DashboardController.allContent(DashboardController.java:54) ~[classes/:na]
at org.owasp.appsensor.ui.controller.DashboardController$$FastClassBySpringCGLIB$$41fbf83.invoke() ~[spring-core-4.1.7.RELEASE.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) ~[spring-security-core-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) ~[spring-aop-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.owasp.appsensor.ui.controller.DashboardController$$EnhancerBySpringCGLIB$$68161932.allContent() ~[spring-core-4.1.7.RELEASE.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_66]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_66]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_66]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) ~[spring-web-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]
... 80 common frames omitted

The other Tabs/Widgets on the dashboard does not show anything, but I guess that might take some time before being shown. The GEO Map works fine though.

from appsensor.

jtmelton avatar jtmelton commented on September 2, 2024

Ok, better. Sounds like websockets are working now, but the REST facade is having issues. Can you tell me what the results of hitting this url is? http://localhost:8085/api/v1.0/reports/responses

Attached is an image of using the advanced rest client plugin for chrome on my machine:

image

from appsensor.

espenaf avatar espenaf commented on September 2, 2024

Using the same browser as logged into AppSensorUI I get an 401 Unauthorized with the following message:

Page requires sending configured client application identification header.

Same behaviour with both Firefox 40 and Chromium 45.

from appsensor.

jtmelton avatar jtmelton commented on September 2, 2024

OK that's to be expected. Can you try with the advanced rest client plugin
on chrome and set the header you see on the picture above of my setup?

On Sat, Oct 31, 2015, 1:49 PM Espen Fossen [email protected] wrote:

Using the same browser as logged into AppSensorUI I get an 401
Unauthorized with the following message:

Page requires sending configured client application identification header.

Same behaviour with both Firefox 40 and Chromium 45.


Reply to this email directly or view it on GitHub
#31 (comment).

from appsensor.

espenaf avatar espenaf commented on September 2, 2024

Ok. Working better. That gives me an 200 response with the following Request/Response headers:

Request headers
X-Appsensor-Client-Application-Name2: myclientapp
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/45.0.2454.101 Chrome/45.0.2454.101 Safari/537.36
Accept: /
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: JSESSIONID=F29C33406D0C71B63EADBF147378D80D

Response headers
Server: Apache-Coyote/1.1
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Sat, 31 Oct 2015 19:37:42 GMT

The Response content looks almost the same as in your screenshot.

from appsensor.

jtmelton avatar jtmelton commented on September 2, 2024

Great! So that means the rest server, rest client and websocket emitter are
all working properly. The last 2 possible issues are in the UI. The first
could be the rest facade in the UI that connects to the rest server and
makes queries. The second could be the react UI itself.

Based on the error, it looks like the connection (first issue). Can you
show the command you are using to start the rest server as well as the
command you are using to start the appsensor UI? Hoping there might be a
typo or something I left in there.

On Sat, Oct 31, 2015, 3:49 PM Espen Fossen [email protected] wrote:

Ok. Working better. That gives me an 200 response with the following
Request/Response headers:

Request headers
X-Appsensor-Client-Application-Name2: myclientapp
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,
like Gecko) Ubuntu Chromium/45.0.2454.101 Chrome/45.0.2454.101 Safari/537.36
Accept: /
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Cookie: JSESSIONID=F29C33406D0C71B63EADBF147378D80D

Response headers
Server: Apache-Coyote/1.1
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Sat, 31 Oct 2015 19:37:42 GMT

The Response content looks almost the same as in your screenshot.


Reply to this email directly or view it on GitHub
#31 (comment).

from appsensor.

espenaf avatar espenaf commented on September 2, 2024

The commands have been copied from the guide. Just to make sure, here are the actual commands used:

WebSocket Server: mvn spring-boot:run -DAPPSENSOR_WEB_SOCKET_HOST_URL=ws://localhost:8085/dashboard

Generator: mvn spring-boot:run

Appsensor UI: mvn spring-boot:run -DAPPSENSOR_REST_REPORTING_ENGINE_URL=http://localhost:8085 -DAPPSENSOR_CLIENT_APPLICATION_ID_HEADER_NAME=X-Appsensor-Client-Application-Name2 -DAPPSENSOR_CLIENT_APPLICATION_ID_HEADER_VALUE=myclientapp -DAPPSENSOR_WEB_SOCKET_HOST_URL=ws://localhost:8085/dashboard -Dspring.datasource.url=jdbc:mysql://localhost/appsensor -Dspring.datasource.username=appsensor_user -Dspring.datasource.password=appsensor_pass

I also manually tested logging into the mysql database using appsensor_user/appsensor_pass.

from appsensor.

jtmelton avatar jtmelton commented on September 2, 2024

OK I'll take a look on my end in a bit and run the same commands again.
I'll let you know what I find.

On Sat, Oct 31, 2015, 4:36 PM Espen Fossen [email protected] wrote:

The commands have been copied from the guide. Just to make sure, here are
the actual commands used:

WebSocket Server: mvn spring-boot:run
-DAPPSENSOR_WEB_SOCKET_HOST_URL=ws://localhost:8085/dashboard

Generator: mvn spring-boot:run

Appsensor UI: mvn spring-boot:run -DAPPSENSOR_REST_REPORTING_ENGINE_URL=
http://localhost:8085
-DAPPSENSOR_CLIENT_APPLICATION_ID_HEADER_NAME=X-Appsensor-Client-Application-Name2
-DAPPSENSOR_CLIENT_APPLICATION_ID_HEADER_VALUE=myclientapp
-DAPPSENSOR_WEB_SOCKET_HOST_URL=ws://localhost:8085/dashboard
-Dspring.datasource.url=jdbc:mysql://localhost/appsensor
-Dspring.datasource.username=appsensor_user
-Dspring.datasource.password=appsensor_pass

I also manually tested logging into the mysql database using
appsensor_user/appsensor_pass.


Reply to this email directly or view it on GitHub
#31 (comment).

from appsensor.

jtmelton avatar jtmelton commented on September 2, 2024

@espenaf Couldn't find anything. I had a couple of environment variables set, so I cleaned those and started completely over. I removed my local maven repository, re=installed from a fresh clean checkout. I then followed the instructions in the installation guide.
I started the rest server, then the client, then the UI, waiting for each to finish startup before trying the next one. All of them ran fine.

I did add a touch of extra logging to the rest facade. If you can pull down the code (don't have to reinstall this time ... just restart the UI and everything else is the same), and check the output of the log for the UI just after you login and paste it here, that would be helpful.

@ProZachJ If you have time, would you mind running through this once with the latest and see if you can duplicate this issue at all? I can't reproduce on my side.

from appsensor.

espenaf avatar espenaf commented on September 2, 2024

Just to make sure I took a fresh git clone and rebuild as according to the guide. After login I get the following log message followed by the same exception:

12:52:37.486 [http-nio-8084-exec-3] INFO o.s.b.a.a.l.AuditListener - AuditEvent [timestamp=Sun Nov 01 12:52:37 CET 2015, principal=analyst, type=AUTHENTICATION_SUCCESS, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@fffc7f0c: RemoteIpAddress: 127.0.0.1; SessionId: 6C9375CBBCB147208883DA1FF08C8144}]
12:52:37.493 [http-nio-8084-exec-3] INFO o.o.a.u.h.AssociatedClientApplicationsAuthenticationSuccessHandler - Successful authentication for user: User [username=analyst, userAuthorities=[], groups=[Group [id=1, name=ANALYST, authorities=[Authority [id=2, name=VIEW_CONFIGURATION], Authority [id=4, name=VIEW_DATA]]]], clientApplications=[myclientapp, myclientgeoapp1, myclientgeoapp2, myclientgeoapp3]]
12:52:37.493 [http-nio-8084-exec-3] DEBUG o.o.a.u.h.AssociatedClientApplicationsAuthenticationSuccessHandler - Using default Url: /
12:52:38.519 [http-nio-8084-exec-3] INFO o.o.a.u.r.RestReportingEngineFacade - Making REST call to http://localhost:8085 ... with path of /api/v1.0/reports/responses
12:52:38.525 [http-nio-8084-exec-3] ERROR o.o.a.u.h.AssociatedApplicationsFilter - Error setting associated applications.
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.ws.rs.NotFoundException: HTTP 404 Not Found
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979) ~[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE]

I tried stepping through the debugger in AssociatedApplicationsFilter. Not completely sure what I should be looking at, but I can confirm that it's the request to /api/dashboard/all which is causing the exception. As partly shown in the attached screenshot, four of the headers in the coyoteRequest contains only null for name and value. Don't know if it is related though.

appsensor

from appsensor.

jtmelton avatar jtmelton commented on September 2, 2024

@espenaf Sorry for the delay, and thanks so much for working through this with me. Yes, the request from JavaScript in the UI to the Java backend of the UI is /api/dashboard/all. However, the flow is basically this:

https://github.com/jtmelton/appsensor/blob/master/appsensor-ui/src/main/java/org/owasp/appsensor/ui/controller/DashboardController.java#L49

https://github.com/jtmelton/appsensor/blob/master/appsensor-ui/src/main/java/org/owasp/appsensor/ui/controller/DashboardController.java#L54

https://github.com/jtmelton/appsensor/blob/master/appsensor-ui/src/main/java/org/owasp/appsensor/ui/controller/DashboardController.java#L68

https://github.com/jtmelton/appsensor/blob/master/appsensor-ui/src/main/java/org/owasp/appsensor/ui/rest/RestReportingEngineFacade.java#L105

That flow goes from JavaScript to the backend dashboard controller to the rest facade and a REST call is made. That rest call is getting a 404 error, saying the rest server api does not exist. However, it looks as if it does exist according to your response above and the fact that the websocket (which runs on the same port) is working.

A couple more things to check:

  • Do you see any errors on startup for the rest-websocket-server?
  • You should see a line like this on the rest-websocket-server - does yours say 8085?
    INFO o.s.b.c.e.t.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 8085 (http)
  • try pulling the UI once more. I made the log message where you're getting stuck a bit clearer.
  • if you have curl (or something like it), maybe try to check the result manually:

For instance, my error message was:
INFO o.o.a.u.r.RestReportingEngineFacade - REST call success to "http://localhost:8085/api/v1.0/reports/responses?earliest=2015-10-01T22:56:03-04:00" with header name: "X-Appsensor-Client-Application-Name2" and value: "myclientapp"

So I tried with this command:
curl --header "X-Appsensor-Client-Application-Name2: myclientapp" http://localhost:8085/api/v1.0/reports/responses?earliest=2015-10-01T22:57:03-04:00

I got back an empty result ([]) which was expected.

I also tried shutting down the rest server while the UI was running (to try and mimic it being on the wrong port). However, the UI started sending error messages related to the websocket. Also, my error was a "connection refused", not a 404, for the rest api. It almost seems as if you're deploying the server, and a connection is made but the appropriate APIs are not starting up, or are not deployed at the right URI.

Again, thanks for working through this with me. If none of these suggestions work, maybe we can try a screenshare and I can see what's happening live.

from appsensor.

espenaf avatar espenaf commented on September 2, 2024

It took some digging, but here is the fix. The difference between my setup and yours is that I am currently in the +01:00 timezone, while you are in -04:00. The plus sign for an positiv time offset get interpreted as a space in an URI, which makes the rfc3339Timestamp input in DashboardController.allContent() wrong, ie. 2015-11-03T11:52:39 01:00 instead of 2015-11-03T11:52:39+01:00.

This eventually leads to an exception when string is converted to an DateTime object in DateUtils.fromString().

Attached PR should fixes the issues for the Dashboard, making it work as intended. Might be wise to go over other parts of the code for the same issue.

from appsensor.

jtmelton avatar jtmelton commented on September 2, 2024

@espenaf Thanks so much for the effort here - and great find! I'll take care of applying this to other areas as you suggested. Appreciate you working through this one with me.
/cc @ProZachJ

from appsensor.

Related Issues (20)

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.