Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

Wildfly server configurations:

* Note:JBoss Wildfly 10 Documentations:


https://docs.jboss.org/author/display/WFLY10/DataSource+configuration

1- Download wildfly-10.1.0.Final.zip application server from


http://wildfly.org/downloads/
2- Extract zip file and move it to partition C:/

3- Opern configuration file named 'standalone.xml' from (ROOT_FOLDER)\standalone\


configuration (i.e. C:\wildfly-10.1.0.Final\standalone\configuration)
and change port from 8080 to 7070 in this line:
<socket-binding name="http" port="${jboss.http.port:8080}"/>

4- Add a new Management user to the server using the 'add-user.bat' in


(ROOT_FOLDER)\bin.
a- Write 'a' to choose Management user.
b- Enter credentials as: username: wildfly, password: wildfly1_
c- Press enter to leave next option empty (We will not add this user to any
groups).
d- Enter 'yes' to confirm adding new user.
f- Enter 'no' to next option.
g- Press any key to continue.

5- Start the server using the 'standalone.bat' in (ROOT_FOLDER)\bin and wait until
you read line 'Server started'

6- Login to console http://localhost:9990/console using previously created


management username and password

7- Add database drivers from Deployments -> click add to open the wizard -> upload
a new deployment -> upload your Connector (i.e. JDBC Driver)
a- for Oracle: ojdbc7.jar (You can find this jar at the WEB-INF\lib at the
project workspace)
b- for SQL Server: mssql-jdbc-6.2.1.jre8.jar (You can find this jar at the
WEB-INF\lib at the project workspace)
c- for PostgreSQL: postgresql-42.1.4.jar (You can find this jar at the WEB-
INF\lib at the project workspace)

8- Add 3 datasources from Configuration -> Subsystems -> Datasources -> Non-XA ->
Add
a- from popup windows choose datasource type -> next, write name and JNDI
name. -> next
b- JNDI name has to start with 'java:/' or 'java:jboss/', we chose to start
with 'java:/' -> next (i.e. Oracle JNDI name will be java:/jdbc/ETR_HCM_PKG)
c- Choose JDBC Driver from detected drivers. -> next
d- Write connection settings (URL, username, password). (From Direct
Connection in hibernate.cfg.xml) -> next
e- Finish.
f- Click the created datasource and choose view
g- Disable datasource so you can apply next changes
h- Click Pool panel -> Edit
i- Min Pool Size: 10, Max Pool Size: 20, check Prefill = true
j- Save changes -> and enable datasource
f- Reload the server to apply changes.

* Note: XA Datasources are used by applications whose transactions are


distributed across multiple databases.
9- Update JBoss Tools:
a- We are using ‘JBoss Tool 4.4.4.Final’, We need to add 'JBoss AS, WildFly &
EAP Server Tools'
b- Open Help menu -> Install new software -> write link:
'http://download.jboss.org/jbosstools/neon/stable/updates/' and press enter
c- Search for wildfly you will find 'JBoss AS, WildFly & EAP Server Tools'
d- Accept conditions and download and install server tools.to Eclipse and
then restart the IDE.
e- Restart Server

10- Add server to eclipse


a- In server panels -> New server -> JBoss Community -> wildfly 10.x server -
> next -> next
b- Choose wildfly root folder as Home Directory (i.e. C:\wildfly-
10.1.0.Final)
c- Make sure that configuration file to be 'standalone.xml' -> next
d- Add War "ETransactions" -> Finish

II- hibernate.cfg.xml changes:


- replace line <property
name="hibernate.transaction.jta.platform">org.hibernate.engine.transaction.jta.plat
form.internal.WeblogicJtaPlatform</property>
with <property
name="hibernate.transaction.jta.platform">org.hibernate.engine.transaction.jta.plat
form.internal.JBossAppServerJtaPlatform</property>

III- Add 'jboss-deployment-structure.xml' file in WEB-INF folder


1- This file can be used to control class loading for the deployment.
2- Dependencies:
a- WildFly is based on module classloading.
b- Module dependencies (visibility) can be explicitly or can be
"implicit".
c- When a deployment is being processed by the server, it goes through
a chain of "deployment processors". Each of these processors will have a way to
check if the deployment meets a certain criteria and if it does, the deployment
processor adds a implicit module dependency to that deployment
d- Some subsystems will always add a API classes, even if the trigger
condition is not met. for example: org.jboss.logging
e- Sometimes there might be a need to update the version of
dependencies provided by JBoss or WildFly subsystems in order to use new features
(for example JPA, Hibernate, JMS).

f- jboss-deployment-structure.xml content:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<!-- exclude-subsystem prevents a subsystems deployment
unit processors running on a deployment -->
<!-- which gives basically the same effect as removing the
subsystem, but it only affects single deployment -->
<exclude-subsystems>
<subsystem name="jsf" />
</exclude-subsystems>

<!-- Exclusions allow you to prevent the server from


automatically adding some dependencies -->
<exclusions>
<module name="org.hibernate" />
<module name="org.javassist" />
</exclusions>

<!-- This allows you to define additional dependencies, it


is the same as using the Dependencies: manifest attribute -->
<dependencies>
<module name="org.javassist" />
</dependencies>

</deployment>
</jboss-deployment-structure>

You might also like