Coder Social home page Coder Social logo

itmo-web-lr3's Introduction

web3-eclipselink-jsf-example

Setup Instructions ๐Ÿ› ๏ธ

Project dependencies


  • WildFly 26.1.3 Preview Jakarta 9.1: This is a critical dependency. WildFly 27+ only supports Jakarta EE 10.0.0 where .xml configurations for managed beans are no longer available.

  • Jakarta EE Web Profile 9.1.0 and EclipseLink ORM 3.0.2: Ensure your pom.xml has these. Check pom.xml for reference.


Configuration steps

1. Download and Install WildFly on Helios

2. Standalone Configuration

2.1 Set up Ports
2.2 Add PostgreSQL Module
  • Run the following command from the [WILDFLY_ROOT]/bin directory:
./jboss-cli.sh

Note: Don't worry if you get disconnected from the server; it's expected. Calmly proceed to the next step!

  • Execute the following command:
module add --name=org.postgresql --resources=/usr/local/share/java/classes/postgresql.jar --dependencies=javax.api,javax.transaction.api
2.3 Update standalone.xml
  • Open standalone.xml located at [WILDFLY_ROOT]/standalone/configuration/.
  • Replace the <datasources> section with the snippet below:

Don't forget to replace username_from_pgpass and password_from_pgpass
You can get them by executing cat .pgpass from ~

<datasources>
   <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
            <connection-url>jdbc:postgresql://pg:5432/studs</connection-url>
      <driver>postgresql</driver>
      <security>
            <user-name>username_from_pgpass</user-name>
            <password>password_from_pgpass</password>
      </security>
   </datasource>
   <drivers>
            <driver name="postgresql" module="org.postgresql">
                  <driver-class>org.postgresql.Driver</driver-class>
                  <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
            </driver>
            <driver name="postgres" module="org.postgresql">
                  <driver-class>org.postgresql.Driver</driver-class>
            </driver>
      <driver name="h2" module="com.h2database.h2">
            <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
      </driver>
   </drivers>
</datasources>

3. Configure System Resources

In some cases, you might need to increase the metaspace size.

  • Add these lines to your .bash_profile:
export _JAVA_OPTIONS="-Xmx512M -XX:MaxMetaspaceSize=3200m"
export JAVA_VERSION="17.0+"
export JAVA_HOME="/usr/local/openjdk17"
export PATH=/usr/local/openjdk17/bin/:$PATH

You can do it like this: echo 'these lines here' >> .bash_profile
Or just open Vim and do it like this

Note: Don't forget to relogin into Helios for these changes to take effect.

! Important !: If your server crashed - check if it is still running (ps -A) and then kill -9 [PID]

4. Update Database Credentials

  • Provide the correct login and password in the resources/db.cfg file.

Same credentials from .pgpass

5. Build and Deploy

  • Build the Maven .war archive and deploy it to the server using my deploy.sh:
./deploy.sh

itmo-web-lr3's People

Contributors

overfitted avatar dependabot[bot] avatar

Watchers

 avatar

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.