Author: Fredy Setz Technologies: JSF 2.2, CDI 1.1, EJB 3.2, JPA 2.1, REST Target Application Server: WildFly Source: https://github.com/wildfly/quickstart/
It is a sample Java EE application, which can be run on JBoss Wildfly Application Server. This project was tested with JBoss Wildfly 10.0.0.final.
This project allows a user to register. When the User is registered a validation email is sent to his email address. In the email the new member will find a validation URL where he can validate his email address.
The Data will be stored in memory with a H2 Datasource.
All you need to do is: -Install Java 7.0 (Java SDK 1.7) or better -Install Maven 3.1 or better -Download JBoss Wildfly and unpack it to a folder of your choice. -Configure JBOSS_HOME environment varible accordingly. -Configure mail-smtp on JBoss Wildfly -Start JBoss WildFly -Checkout the git source of this project -Build and Deploy the Enterprise Application -See How to use the Enterprise Application
the mail service need to be setup under the following jndi name java:jboss/mail/gmail. See this nice blogpost how you can do that http://khozzy.blogspot.ch/2013/10/how-to-send-mails-from-jboss-wildfly.html
-
The JBOSS_HOME is set correctly.
-
Open a command line and navigate to the root of the JBoss server directory.
-
The following shows the command line to start the server with the web profile:
For Linux: JBOSS_HOME/bin/standalone.sh For Windows: JBOSS_HOME\bin\standalone.bat
There is WildFly Maven Plugin (wildfly-maven-plugin) which will deploy the ear.
-
Make sure you have started the JBoss Server as described above.
-
Open a command line and navigate to the root directory of this quickstart.
-
Type this command to build and deploy the archive:
mvn clean package wildfly:deploy
-
This will deploy
target/example-jee-user-registration.ear
to the running instance of the server.
For more details about the deployment see: https://docs.jboss.org/wildfly/plugins/maven/latest/
The application can be accessed unter the following URL: http://localhost:8080/example-jee-user-registration-web.
- Enter data into First name(2-50 characters), Last name(2-50 characters), Email address, Password, At least one phone number and click the Register button. Both name fields and the password must have lower and upper case letters. Additionally the password must have at least one special character @#$%!&.
- If the data entered is valid, the new member will be registered and added to the Members display list.
- If the data is not valid, you must fix the validation errors and can try to add the member again.
- When the registration is successful, the new member will receive an email.
- Use the URL from your received email to validate the email address of the new user.
- Reload the start page. You will see that the email address of the new user is now validated.
If you like to receive an email every Time the Arquillian Tests are executed. Just replace the value of the constant INSERT_HERE_YOUR_EMAIL_ADDRESS in Class org.example.jee.test.MailTest
Execute all commands from root directory of this project.
Only build the Application:
mvn clean install For building the application
Import Java source code to eclipse (Requires you to first build the application):
mvn eclipse:clean
mvn eclipse:eclipse
Run the arquillian Tests (Make sure you have started the JBoss Server as described above):
mvn clean test -Parq-wildfly-remote
Download source and javadoc:
mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc
Undeploy the Archive (Make sure you have started the JBoss Server as described above):
mvn wildfly:undeploy