Chinese version:JBoss AS 7.2.0 - 例子 - 通过SSL通道调用EJB or JBoss AS 7.2.0 - 例子 - 通过SSL通道调用EJB
Summary
This article introduces how to configure security-domain and JAAS, how to configure SSL and how to call EJB over SSL channel, with a simple but smart example.
To run the example successfully, please follow bellow steps strictly. Especially, please use the directories mentioned in this article. After you master this example, you can modify them according to your preference.
1. Environment Setting
1.1 Eclipse IDE
- Please download http://javaarm.com/file/software/development/jboss/jbosstools/eclipse-jee-kepler-R-win32_jbosstools-4.1.0.Beta2.zip or http://javaarm.com/file/software/development/jboss/jbosstools/eclipse-jee-kepler-R-win32_jbosstools-4.1.0.Beta2_JBossWeb.Only.zip (Please refer to Link for the details of how to build Eclipse IDE.)
- Then unzip this file into D:\develop\tools\, please make sure that you can see D:\develop\tools\eclipse-jee-kepler-R-win32\eclipse.exe.
1.2 JBoss AS 7.2.0
- Pleaes download http://javaarm.com/file/software/development/jboss/ApplicationServer/jboss-as-7.2.0.Final_binary.zip, unzip it to D:\java\, and rename the resulting directory to jboss-as-7.2.0.Final_experiment. Please make sure that you can see D:\java\jboss-as-7.2.0.Final_experiment\jboss-modules.jar.
- Please download http://javaarm.com/file/jboss/ApplicationServer/JBossAS7.2.0_EJB3-over-SSL/jboss-as-7.2.0.Final_modules_system_layers_base_com_mysql.zip, unzip it to D:\java\jboss-as-7.2.0.Final_experiment\modules\system\layers\base\com. Please make sure that you can see D:\java\jboss-as-7.2.0.Final_experiment\modules\system\layers\base\com\mysql\main\mysql-connector-java-5.1.21-bin.jar.
- Please delete D:\java\jboss-as-7.2.0.Final_experiment\standalone\configuration, download http://javaarm.com/file/jboss/ApplicationServer/JBossAS7.2.0_EJB3-over-SSL/JBossAS7.2.0_EJB3-over-SSL__configuration.zip, and unzip it to D:\java\jboss-as-7.2.0.Final_experiment\standalone\. Please make sure that you can see D:\java\jboss-as-7.2.0.Final_experiment\standalone\configuration \standalone.xml。
- Please delete D:\java\jboss-as-7.2.0.Final_experiment\standalone\deployments, download http://javaarm.com/file/jboss/ApplicationServer/JBossAS7.2.0_EJB3-over-SSL/JBossAS7.2.0_EJB3-over-SSL__deployments.zip, and unzip it to D:\java\jboss-as-7.2.0.Final_experiment\standalone\, Please make sure that you can see D:\java\jboss-as-7.2.0.Final_experiment\standalone\deployments\ybxiang-jboss7-example.ear.
1.3 ybxiang-jboss7-example
1.3.1 workspace
Please download http://javaarm.com/file/jboss/ApplicationServer/JBossAS7.2.0_EJB3-over-SSL/ybxiang-jboss7-example_workspace.zip, unzip it to D:\develop\projects. Please make sure that you can see D:\develop\projects\ybxiang-jboss7-example_workspace\.metadata\.log.
1.3.2 sourcecode
Please download http://javaarm.com/file/jboss/ApplicationServer/JBossAS7.2.0_EJB3-over-SSL/ybxiang-jboss7-example_2013-12-18_001.zip, unzip it to D:\develop\projects. Please make sure that you can see D:\develop\projects\ybxiang-jboss7-example\IDE-start.bat.
1.4 MySql schema 'ybxiangjboss7'
1.4.1 create schema
In MySql Server, create a schema named “ybxiangjboss7”, for example:
1.4.2 Populate initial data
Please run D:\develop\projects\ybxiang-jboss7-example\nms_db.restore.bat, to populate the data in ybxiangjboss7.sql into the schema named 'ybxiangjboss7'.
2. Run Example
2.1 Start IDE
Please double click D:\develop\projects\ybxiang-jboss7-example\IDE-start.bat to start the IDE
2.2 Start JBoss AS 7.2.0
In the IDE, you can start JBoss AS 7.2.0 in debug mode:
2.3 Run the EJB client application
2.4 Result
2.4.1 JBoss AS 7.2.0 log
2.4.2 EJB client application log
3.NOTE
Comments