wildfly-9.0.2 Web project Deployment Detailed steps

Source: Internet
Author: User
Tags jboss wildfly

First, configure the operating system environment variables

Java_home = C:\Program Files (x86) \java\jdk1.7.0_67

Jboss_home = F:\server\wildfly-9.0.2

Classpath =%java_home%\lib\tools.jar;%java_home%\lib\dt.jar;%java_home%\bin;

PATH =%java_home%\bin;%jboss_home%\bin;

Second, add the console to manage the account

Run the F:\server\wildfly-9.0.2\bin\add-user.bat, follow the prompts to create the step-by-step;

Third, start the service to verify the initial environment correctness

Run F:\server\wildfly-9.0.2\bin\standalone.bat

Access http://localhost:9990/Enter the user name and password created;

Iv. Configuration Items Required data source (This example is MS SQL Server database)

4.1 Edit F:\server\wildfly-9.0.2\standalone\configuration\standalone.xml Add a data source

<datasources>
<datasource jndi-name= "java:jboss/datasources/exampleds" pool-name= "Exampleds" enabled= "true" use-java-context= "True" >
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jndi-name= "JAVA:JBOSS/DATASOURCES/CODEWH" pool-name= "CODEWH" enabled= "true" use-java-context= " True ">
<connection-url>jdbc:jtds:sqlserver://127.0.0.1:1433/codewh</connection-url>
<driver>sourceforge.jtds</driver>
<security>
<user-name>sa</user-name>
<password>123</password>
</security>
</datasource>
<drivers>
<driver name= "H2" module= "COM.H2DATABASE.H2" >
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name= "sourceforge.jtds" module= "sourceforge.jtds" >
<xa-datasource-class>net.sourceforge.jtds.jdbc.Driver</xa-datasource-class>
</driver>
</drivers>
</datasources>

4.2 Creating a Data source module catalog and files

Create F:\server\wildfly-9.0.2\modules\sourceforge\jtds\main Directory

Copy the Jtds-1.3.0.jar to the directory and create the Module.xml file with the following file contents:

<?XML version= "1.0" encoding= "UTF-8"?><Modulexmlns= "urn:jboss:module:1.0"name= "Sourceforge.jtds">    <Resources>        <Resource-rootPath= "Jtds-1.3.0.jar"/>    </Resources>    <Dependencies>    </Dependencies></Module>

JAVA Data Source acquisition: (DataSource) ctx.lookup ("Java:jboss/datasources/codewh");

V. Editorial F:\server\wildfly-9.0.2\standalone\configuration\standalone.xml

5.1 Configuring Project Deployment location Information

<Subsystemxmlns= "urn:jboss:domain:deployment-scanner:2.0">  <Deployment-scannerPath= "Deployments"relative-to= "Jboss.server.base.dir"Scan-interval= "the"Runtime-failure-causes-rollback= "${jboss.deployment.scanner.rollback.on.failure:false}"/>  <Deployment-scannername= "Code"Path= "F:/server/deploy"scan-enabled= "true"Scan-interval= "the"auto-deploy-zipped= "false"auto-deploy-exploded= "false"Deployment-timeout= "+"/></Subsystem>

5.2 Modify the Web service port:

<socket-binding-group name= "Standard-sockets" default-interface= "public" port-offset= "${ jboss.socket.binding.port-offset:0} ">
<socket-binding name= "Management-http" interface= "Management" port= "${jboss.management.http.port:9990}"/>
<socket-binding name= "Management-https" interface= "Management" port= "${jboss.management.https.port:9993}"/>
<socket-binding name= "AJP" port= "${jboss.ajp.port:8009}"/>
<socket-binding name= "http" port= "${jboss.http.port:86}"/>
<socket-binding name= "https" port= "${jboss.https.port:8443}"/>
<socket-binding name= "txn-recovery-environment" port= "4712"/>
<socket-binding name= "Txn-status-manager" port= "4713"/>
<outbound-socket-binding name= "MAIL-SMTP" >
<remote-destination host= "localhost" port= "/>"
</outbound-socket-binding>
</socket-binding-group>

5.3 Set the default access interface:

<server name= "Default-server" >
<!--
<location name= "/" handler= "Welcome-content"/>
-
<filter-ref name= "Server-header"/>
<filter-ref name= "X-powered-by-header"/>
</server>
<servlet-container name= "Default" >
<jsp-config development= "true"/>
<websockets/>
</servlet-container>

In Project Engineering add jboss-web.xml file (\web-inf\jboss-web.xml) content as follows:

<? XML version= "1.0" encoding= "UTF-8" ?> < Jboss-web >     < Context-root >/</context-root>  </jboss-web >

VI. deployment of Project engineering documents

After creating the F:\server\deploy\code.war directory , copy all the project files to the directory;

Create a F:\server\deploy\code.war.deployed file ;

Seven, start F:\server\wildfly-9.0.2\bin\standalone.bat

Access to http://localhost:86/successfully completes all deployment efforts.

wildfly-9.0.2 Web project Deployment Detailed steps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.