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

Edit this page


Referenced by
AppFuseSupport_ko




JSPWiki v2.2.33

[RSS]


Hide Menu

AppFuseOnJBoss_ko


AppFuse 1.8+ and JBoss 4.0.2

Contributed by Ivan Coro (ivcoro at hotmail)

(1) 먼저, 당신은 appfuse배치 디렉토리 전체는 jboss배치 디렉토리로 복사할 필요가 있다. JBoss의 디폴트 배치 디렉토리는 "/server/default/deploy/"와 같은 것이다. 나는 디렉토리를 "appfuse.war"와 같은 형식으로 이름(.war로 끝나는 이름)을 바꿀 필요가 있다. 그렇게 하면 jboss는 에러없이 이것을 감지하고 재로딩할수 있다.

(2) 다음, 당신은 jboss내 데이터소스를 설정할 필요가 있다. 이것을 하기 위해, 당신은 "appfuse-ds.xml"이라는 이름의 파일이 필요하고 이것을 당신의 배치된 애플리케이션 디렉토리와 같은 레벨(이를테면, /server/default/deploy/)의 JBoss의 "deploy" 디렉토리에 둘 필요가 있다. 이 파일의 내용은 다음과 같다.

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

(3) 다음, 당신은 애플리케이션의 WEB-INF디렉토리내 넣을 "jboss-web.xml"이라는 이름의 파일을 생성할 필요가 있다. 이 파일은 jboss배치를 위해 필요하고, 파일의 내용은 다음과 같다.

<?xml version="1.0" encoding="UTF-8" ?>
<jboss-web>
    <context-root>/appfuse</context-root>
    <resource-ref>
    <res-ref-name>jdbc/appfuse</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <jndi-name>java:jdbc/appfuse</jndi-name>
    </resource-ref>
</jboss-web>
NOTE: 만약 당신이 appfuse라는 이름의 디폴트 애플리케이션명을 사용하지 않는다면 appfuse라는 단어를 당신이 생성한 애플리케이션 인스턴스의 이름으로 변경할 필요가 있다.

(4) JBoss서비스 재시작하기

당신은 JBoss에 AppFuse를 자동으로 배치하는 방법을 보기 위해 Ken Yee's blog를 볼 수도 있다.

AppFuse 1.7 and JBoss 3.x.

Contributed by Rick Hightower.

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).

WARNING:

JBoss holds onto the cache of users and roles. So if you changed a users role, they would not be able to see it for 1/2 an hour.

I subclassed UserManagerImpl, and created a version specific to JBoss, then I changed UserManagerImpl to use a stub method called flushAuthCache. UserManagerJBossSpecific invalidates the user cache using JMX. JBoss is pretty cool!

Since I am using Spring. I did not have to change any other code in the system. Just one configuration file!

Spring change:

	<bean id="userManager" class="org.appfuse.webapp.service.UserManagerJBossSpecific">
		<property name="userDAO"><ref local="userDAO"/></property>
	</bean>

UserManagerJBossSpecific.java

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   Edit this page   More info...   Attach file...
This page last changed on 06-Nov-2006 13:53:00 MST by DongGukLee.