Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AppFuseSupport




JSPWiki v2.2.33

[RSS]


Hide Menu

AppFuseOnJBoss


This is version 5. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]


This is a quick-n-dirty howto for setting up AppFuse on JBoss. Contributed by Rick Hightower, who does Struts Training and Consulting.

AppFuse Security

Setting up AppFuse security in JBoss I was surprise how easy it was.

    <application-policy name = "appfuse">
       <authentication>
          <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
             flag = "required">
             <module-option name = "dsJndiName">jdbc/mysql</module-option>
             <module-option name = "principalsQuery">
	     select password from app_user where username=?
	     </module-option>
             <module-option name = "rolesQuery">
	     select role_name, 'Roles' from user_role where username=?
	     </module-option>

	   </login-module>
       </authentication>
    </application-policy>

It took me less time to setup Security than it did for me to setup logging. (Which is a bit of a nightmare!)

The above assumes you have a database driver mapped under jdbc/mysql.

Create DS file as follows, and put it in the deploy dir: (C:\tools\jboss-3.2.3\server\default\deploy/mysql-ds.xml)

<datasources>
  <local-tx-datasource>
    <jndi-name>jdbc/mysql</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/mysql</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password></password>
  </local-tx-datasource>
</datasources>

The login security stuff goes in the config directory of the server, e.g., C:\tools\jboss-3.2.3\server\default\conf\login-config.xml.

I attached the login-config.xml(info) file. Note the name has to be the name of your war (appfuse.war = appfuse). In reality, it has to be the name of the web context, but since my web context and war file name are the same it works.

mysql-ds.xml(info) has to be in the deploy dir, e.g., C:\tools\jboss-3.2.3\server\default\deploy\mysql-ds.xml.

(The war file goes into the deploy dir as well).

Logging

Setting up logging is a pain in JBoss. Don't mess with the console log... it misbehaves. Create a file logger and tail it.

Here is my log4j.xml(info) file (which has to be in the conf dir like the login-config.xml).

I just tail -f the log file.


Attachments:
jboss-web.xml Info on jboss-web.xml 355 bytes
mysql-ds.xml Info on mysql-ds.xml 992 bytes
log4j.xml Info on log4j.xml 5811 bytes
login-config.xml Info on login-config.xml 6280 bytes


Go to top   More info...   Attach file...
This particular version was published on 06-Nov-2006 13:52:23 MST by MattRaible.