Omocron Webportal Setup (Jan 2020)


1. Preparing the database.

The database we are using is 'Oracle Database 10g Express Edition (XE)'.
Download link for 'Oracle Database 10g XE for Windows 32-bit': 
https://drive.google.com/open?id=1brmFcZFqg8fKQnUHKbPMRsnOsXgelcsZ

Download link for 'Oracle Database 11g XE for Windows 64-bit': 
https://drive.google.com/open?id=1LKXt3vQUeaZCjPjDojgzl3syeqRa5kvo

E:\>

E:\>cd E:\Workspace\GitHub\omocron\Omocron DB Dump (20180816)

E:\Workspace\GitHub\omocron\Omocron DB Dump (20180816)>sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jan 18 16:47:39 2020

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Enter user-name: system
Enter password:

Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> @Omocron_install.sql

The logs for this execution are saved in the file "Omocron_install.spool".

2. Check database installation.

Oracle Database 10g Apex application will be running on the link: http://127.0.0.1:8080/apex

Here you can login with your 'system' user and check the installation.



3. Server setup. The server we are using is Apache Tomcat 9.0.30 (Windows x64). Download links: https://tomcat.apache.org/download-90.cgi http://mirrors.estointernet.in/apache/tomcat/tomcat-9/v9.0.30/bin/apache-tomcat-9.0.30-windows-x64.zip We have extracted the archive at the path 'E:\Workspace'. We have to change the HTTP port for Tomcat as the default 8080 port is used by Oracle Database 10g Apex application. For the port in use, Tomcat will throw this error: "Caused by: java.net.BindException: Address already in use: bind" Open the file: E:\Workspace\apache-tomcat-9.0.30\conf\server.xml Change these ports: A. <Server port="8095" shutdown="SHUTDOWN">...<Server> B. <Connector port="8090" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> C. <Connector port="8099" protocol="AJP/1.3" redirectPort="8443" /> Next, we start the server: E:\Workspace\apache-tomcat-9.0.30\bin>startup.bat OR E:\Workspace\apache-tomcat-9.0.30\bin>catalina.bat run Logs: Using CATALINA_BASE: "E:\Workspace\apache-tomcat-9.0.30" Using CATALINA_HOME: "E:\Workspace\apache-tomcat-9.0.30" Using CATALINA_TMPDIR: "E:\Workspace\apache-tomcat-9.0.30\temp" Using JRE_HOME: "E:\programfiles\Java_11" Using CLASSPATH: "E:\Workspace\apache-tomcat-9.0.30\bin\bootstrap.jar;E:\Workspace\apache-tomcat-9.0.30\bin\tomcat-juli.jar" Checking Tomcat:
E:\Workspace\apache-tomcat-9.0.30\webapps\ROOT\WEB-INF\web.xml <!-- Database connection parameters ___ Open --> <!-- <init-param> will be used if you want to initialize some parameter for a particular servlet. When request come to servlet first its init method will be called then doGet/doPost whereas if you want to initialize some variable for whole application you will need to use <context-param>. Every servlet will have access to the context variable. URL: https://stackoverflow.com/questions/28392888/init-param-and-context-param --> <context-param> <param-name>driverName</param-name> <param-value>oracle.jdbc.driver.OracleDriver</param-value> </context-param> <context-param> <param-name>dbURL</param-name> <param-value>jdbc:oracle:thin:@localhost:1521:xe</param-value> </context-param> <context-param> <param-name>dbUsername</param-name> <param-value>system</param-value> </context-param> <context-param> <param-name>dbPassword</param-name> <param-value>system</param-value> </context-param> <!-- Database connection parameters ___ Close --> <context-param> <param-name>logsDirectoryPath</param-name> <param-value>E:/omocron_logs</param-value> </context-param> There are issues with using Tomcat 9.0.30 and latest codebase. We would use Tomcat 8.0.27 and code base from April, 2018. Issue: Tomcat 8.0.27 is not working with Java 11. Logs: E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\bin>catalina.bat run Using CATALINA_BASE: "E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)" Using CATALINA_HOME: "E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)" Using CATALINA_TMPDIR: "E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\temp" Using JRE_HOME: "E:\programfiles\Java_11" Using CLASSPATH: "E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\bin\bootstrap.jar;E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\bin\tomcat-juli.jar" -Djava.endorsed.dirs=E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\endorsed is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. We would install Java 8 using file "jdk-8u201-windows-x64.exe". Download link: https://drive.google.com/open?id=1DzQtdd9e4gk82zhZAWFH9KkfpTy8R6g5 We create a ".bat" file to setup our environment for Tomcat 8.0.27 to run with Java 8. Location: E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\bin\set_env_variables.bat set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121 set JRE_HOME=C:\Program Files\Java\jre1.8.0_201 set PATH=%JAVA_HOME%\bin;%PATH% In 20180401 codebase, we would change the file to set our database connection parameters: public DbConn() { try { Class.forName("oracle.jdbc.driver.OracleDriver"); this.conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:xe", "system", "system"); } catch (ClassNotFoundException var2) { Logger.getLogger(DbConn.class.getName()).log(Level.SEVERE, (String)null, var2); } catch (SQLException var3) { Logger.getLogger(DbConn.class.getName()).log(Level.SEVERE, (String)null, var3); } } Then we would compile it again in the same environment as Tomcat 8.0.27: E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\webapps\ROOT\WEB-INF\classes\dbPack>"E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\bin\set_env_variables.bat" E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\webapps\ROOT\WEB-INF\classes\dbPack>java -version java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode) E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\webapps\ROOT\WEB-INF\classes\dbPack>javac DbConn.java --release 8 We start the server again. E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\bin>catalina.bat run Issue: The 20180401 codebase is hardcoded to use port 8084 for Tomcat. We need to fix it in file "E:\Workspace\GitHub\omocron\Omocron Tomcat 8.0.27 (20180401)\conf\server.xml" in line Connector port="8084" protocol="HTTP/1.1".

No comments:

Post a Comment