Skip to content

Prepare environment to develop (Eclipse J2E IDE)

Radosław Jajko edited this page Feb 20, 2018 · 1 revision

To prepare ScadaLTS for development:

Instruction for Eclipse JEE IDE


Before:

  • Download and install MySQL server (Workbench is also recommended) with default settings (login:root, password:root). Download
  • Download and install Tomcat Server v7.X Download

Installing

  • Open the project on github.com page and copy the repository URL to clipboard.
  • Open the Eclipse for EE and create a new project from git.
  • Create a repository based on the URL option and login to your GitHub account.
  • When the project has loaded, install suggested Spring add-on to Eclipse.
  • After IDE restart, download required libraries ("seroUtils.jar") by running "get_seroUtils.sh" shell command.
  • For Windows users download this library form here and move download file to project_folder/WebContent/WEB-INF/lib/
  • Open project properties and move to: Properties>Java Build Path>Order and Export
  • In this menu Select: Web App Libraries, EAR Libraries, Apache Tomcat v7.0, JRE System Library [jdk] to add to projects.
  • Make sure that seroUtils.jar has been correctly added, If in "Libraries" tab this jar file is listed everything is ok, if not add to project.

Now prepare a TomcatServer:

  • Find the directory where the Tomcat has been installed and to tomcat/lib/ directory copy all 3x MySQLConnectorsJava.jar's from project>WebContent>WEB-INF>lib
  • Now create new local server: Right Click on the project directory and click "run as>run on server"
  • "Manualy define a new server>Apache>Tomcat v7.0 Server>Add...>Browse" and choose the folder where Tomcat is installed. This folder is named as CATALINA_HOME environment variable as a path to tomcat directory.
  • Finish and make sure that a new Servers folder has been created in "Project Explorer"
  • Find context.xml file in this Servers tree-view and open it
  • Replace the content between context tags of this file with following code: `
<!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>

<Resource name="jdbc/scadalts"
      auth="Container"
      type="javax.sql.DataSource"
      factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
      testWhileIdle="true"
      testOnBorrow="true"
      testOnReturn="false"
      validationQuery="SELECT 1"
      validationInterval="30000"
      timeBetweenEvictionRunsMillis="30000"
      maxActive="80"
      minIdle="10"
      maxWait="10000"
      initialSize="10"
      removeAbandonedTimeout="1000"
      removeAbandoned="true"
      abandonWhenPercentageFull="75"
      logAbandoned="true"
      minEvictableIdleTimeMillis="30000"
      jmxEnabled="true"
      jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;
                                                    org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;
                                                    org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer;
                                                    org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport(threshold=1500)"
      username="root"
      password="root"
      driverClassName="com.mysql.jdbc.Driver"
      defaultTransactionIsolation="READ_COMMITTED"
      url="jdbc:mysql://localhost:3306/scadalts"
     />

<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->

<!-- Uncomment this to enable Comet connection tacking (provides events
     on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
` (Source from StackOverflow.com topic)

Test run

  • Clean, build and run on server the Scada-LTS to verify the preparation.