Introduction

Device Manager UI is an user interface application to interact with device manager server to manage different devices by fetching the device details, adding devices, adding device groups etc

This document provides the deployment steps for setting up Device Manager UI server and all its dependencies.

For setting up this server the below applications or tools should be available in the server machine:

  1. JDK – 17
  2. TOMCAT – v9.0.xx
  3. MAVEN – v3.8 or above
  4. Device Manager 


Prequisites

The below software should be installed and available for running Device Manager UI.

If you already have an existing setup of Automatics you can follow the steps in this page for upgrading the software's Automatics Technology Stack - Upgrade 

Software Requirement

  • JDK 17

Please note that even though the recommended version of Orchestration is JDK17, it is reverse compatible with JDK11 also. So code also be compiled with JDK11. Follow Steps below to install Java 17 on CentOS/linux.

    • Update before installing any new program
sudo yum -y update
    • Install Java 17
sudo yum install java-17-openjdk
    • Verify Java is Installed
java -version


Sample output:

  • MariaDB 10.11

Follow below steps to install and configure MariaDB on CentOS/linux

    • All the packages need to be up-to-date. Use the following command to update your packages.

      sudo yum update

      Create a new repo file for the latest version.

      vi /etc/yum.repos.d/MariaDB.repo

      Copy and paste the following contents into the /etc/yum.repos.d/mariadb.repo file.

      [mariadb]
      name = MariaDB
      baseurl = http://yum.mariadb.org/10.11/centos7-amd64
      gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
      gpgcheck=1

      To exit and save the Vim file, type :wq and press Enter.

    • Install the Latest Version of MariaDB

Install 10.11 of MariaDB and the most common packages, using the command below.

sudo yum install MariaDB-server galera-4 MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common
    • Start MariaDB

      Start the MariaDB service with this command.

      sudo systemctl start mariadb

      To set MariaDB to start automatically when the VM boots up, use the following command.

      sudo systemctl enable mariadb

      Check the current status of MariaDB using this command.

      sudo systemctl status mariadb

      Check the currently installed MariaDB version with this command.

      sudo mysql -u root -p -V
  • Tomcat 9.0.XX

Follow below Steps to setup Tomcat server  on CentOs/linux.

wget -c https://downloads.apache.org/tomcat/tomcat-9/v9.0.85/bin/apache-tomcat-9.0.85.tar.gz
    • Extract the Tomcat archive to the directory in which you want to deploy the Automatics Tools
      sudo tar -xvf apache-tomcat-9.0.85.tar.gz -C /opt/automatics/
    • Navigate to the tomcat file path and run ./bin/startup.sh cmd to start the tomcat server.

Sample Output:


Maven – 3

Maven is the tool used for building and managing Device Manager project. Please follow the below links to download and install Maven:

Following page will provide the detailed steps to setup maven.

Automatics Orchestration Setup#Maven3


Device Manager Back End Server

Device Manager Server is REST API based tool to manage different device details , add & edit device details, device groups etc. Device Manager UI is an application for visualizing and perform actions on different functionalities of device manager backend server.

Please refer below link to know more about device manager setup and deployment.

Device Manager Deployment Document

Environment Setup

Following are the steps to be followed to setup Device Manager UI and its dependent software's in a Machine:

Build Device Manager UI .war file

Build the .war file of Device Manager UI  using Maven 3 and JDK 8.

To do this follow the below steps:

Example:

        

  • Now navigate to the project Home folder and run the command “mvn clean install”.
  • This will build DeviceManagerUI.war file of device-manager-ui in the folder “project_home/target”.

Deploy Device Manager UI application

Device Manager application should be deployed in Tomcat server (ver 8.5 or above). Follow the below steps to deploy the application.

  1. Copy DeviceManagerUI.war file from “project_home/target” to “TOMCAT_HOME/webapps” folder.
  2. If you need to run the tomcat server in a port other than 8080, please follow the below steps to change the same.
    • Navigate to the folder “TOMCAT_HOME/conf”.
    • Open server.xml and change the connector port in this file from 8080 to an available port of your choice. If another tomcat is running the same machine then change the DEFAULT Tomcat server SHUTDOWN port from 8005 to another available port. If you dont need to a SHUTDOWN port for tomcat then change the default port from 8005 to “-1”.
  3. To start Device Manager application go to “TOMCAT_HOME/bin” folder and run sh or startup.bat (if its running on Microsoft windows) script.
  4. To verify server logs check “TOMCAT_HOME/logs/catalina.out” file.
  • To launch Device Manager application go to the URL : “{protocol}://{host:port}/DeviceManagerUI/login.html“

  • For the first time, login with username as "admin" without password.
  • on success login user will be navigated to manage devices pages.

Following page will provide more information on device manager ui

Device Manager UI User Manual


  • No labels

2 Comments

  1. Login failed!!!

    02-Mar-2023 12:53:47.445 INFO [http-nio-8080-exec-7] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
     Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
            java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x030x010xcb0x010x000x010xc70x030x030x9cK"0x040x8e0x80qz0xfa0x0f0xe1C0x030xf9H0xe8(0x930xdd0x9eG0xceK#C0x100xb60xe3S0xe10x1e0x8b ]. HT
    TP method names must be tokens
                    at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:434)
                    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:513)
                    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
                    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:885)
                    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1688)
                    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
                    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
                    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
                    at java.base/java.lang.Thread.run(Thread.java:833)
    2023-03-02 12:53:47.448 ERROR 10033 --- [nio-8080-exec-5] c.a.d.r.h.impl.RestUserHandlerImpl       : Exception while getting user details from device manager.

    javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request
            at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:321) ~[resteasy-client-3.6.2.Final.jar:3.6.2.Final]
            at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:439) ~[resteasy-client-3.6.2.Final.jar:3.6.2.Final]
            at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:61) ~[resteasy-client-3.6.2.Final.jar:3.6.2.Final]
            at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:219) ~[resteasy-client-3.6.2.Final.jar:3.6.2.Final]
            at com.automatics.devicemanager.rest.handler.impl.RestUserHandlerImpl.getUserDetailsFromUserId(RestUserHandlerImpl.java:92) ~[classes/:v1.2]
            at com.automatics.devicemanager.services.UserServiceImpl.loadUserByUsername(UserServiceImpl.java:93) ~[classes/:v1.2]
            at com.automatics.devicemanager.security.CustomIdentityAuthenticationProvider.isValidUser(CustomIdentityAuthenticationProvider.java:41) ~[classes/:v1.2]
            at com.automatics.devicemanager.security.CustomIdentityAuthenticationProvider.authenticate(CustomIdentityAuthenticationProvider.java:61) ~[classes/:v1.2]
            at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:182) ~[spring-security-core-5.6.1.jar:5.6.1]
            at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:201) ~[spring-security-core-5.6.1.jar:5.6.1]
            at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter$AuthenticationManagerDelegator.authenticate(WebSecurityConfigurerAdapter.java:510) ~[spring-security-config-5.6.1.jar:5.6
    .1]
            at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:85) ~[spring-security-web-5.6.1.jar:5.6.1]
            at com.automatics.devicemanager.security.SimpleAuthenticationFilter.attemptAuthentication(SimpleAuthenticationFilter.java:38) ~[classes/:v1.2]
            at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:223) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:213) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.15.jar:5.3.15]
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.15.jar:5.3.15]
            at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183) ~[spring-security-web-5.6.1.jar:5.6.1]
            at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.15.jar:5.3.15]
            at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.15.jar:5.3.15]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.85]
            at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.15.jar:5.3.15]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.15.jar:5.3.15]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.85]
            at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.15.jar:5.3.15]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.15.jar:5.3.15]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.85]
            at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:126) ~[spring-boot-2.6.3.jar:2.6.3]
            at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:64) ~[spring-boot-2.6.3.jar:2.6.3]
            at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:101) ~[spring-boot-2.6.3.jar:2.6.3]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.15.jar:5.3.15]
            at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:119) ~[spring-boot-2.6.3.jar:2.6.3]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.85]
            at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.15.jar:5.3.15]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.15.jar:5.3.15]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[catalina.jar:8.5.85]
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) ~[catalina.jar:8.5.85]
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[catalina.jar:8.5.85]
            at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:698) ~[catalina.jar:8.5.85]
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[catalina.jar:8.5.85]
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:367) ~[catalina.jar:8.5.85]
            at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:639) ~[tomcat-coyote.jar:8.5.85]
            at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-coyote.jar:8.5.85]
            at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:885) ~[tomcat-coyote.jar:8.5.85]
            at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1688) ~[tomcat-coyote.jar:8.5.85]
            at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:8.5.85]
            at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-util.jar:8.5.85]
            at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-util.jar:8.5.85]
            at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.85]
            at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
    Caused by: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
            at java.base/sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(SSLSocketInputRecord.java:451) ~[na:na]
            at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:175) ~[na:na]
            at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111) ~[na:na]
            at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1505) ~[na:na]
            at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1420) ~[na:na]
            at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455) ~[na:na]
            at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426) ~[na:na]
            at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.13.jar:4.5.13]
            at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.13.jar:4.5.13]
            at org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine.invoke(ApacheHttpClient4Engine.java:317) ~[resteasy-client-3.6.2.Final.jar:3.6.2.Final]
            ... 70 common frames omitted

    1. FYI, error mentioned previously is related to the usage of "https" in the URL.
        - DEVICE_MANAGER_BASE_URL=http://localhost:8080/DeviceManager
           >> Access to the page / No Error

        - DEVICE_MANAGER_BASE_URL=https://localhost:8080/DeviceManager
           >> Error (See stack trace in my previous message] / Access denied