티스토리 툴바


'개발환경/WAS'에 해당되는 글 2

  1. 2012/01/31 apache2 + tomcat7 연동
  2. 2011/01/28 Adding multiple last resources is disallowed.

apache2 + tomcat7 연동

2012/01/31 19:46 | Posted by 포데브(엄지사랑) 엄지사랑
제목과 같이 구글링을 하여 설치하고 설정했을 때 아래와 같은 에러를 만났다.

ForbiddenYou don't have permission to access / on this server. 

이 문제의 원인을 디렉토리의 퍼미션 문제라고 많은 곳에서 언급하고 있으나 디렉토리 모드가 755로 되어 있으므로 이 문제는 아닌것 같다.
아래 두 사이트로 추정컨데 아마도 proxy_http  모듈이 로드되지 않아서 발생했던 문제인것 같다. 

http://techbug.tistory.com/195 
http://blog.naver.com/PostView.nhn?blogId=zukjimote&logNo=42304917 

그리고 기타 참고할 만한 사이트의 링크를 남긴다.(나중에 내가 참고하기 위해서... ^^)
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
http://blog.daum.net/donfig/3163746 
http://blog.naver.com/PostView.nhn?blogId=junix&logNo=80130084062 
http://theeye.pe.kr/entry/Apache-integrated-Tomcat-with-ProxyPass-options
http://jo.centis1504.net/?p=102
: 환경

Ubuntu 10.04.3 LTS
apache2 (2.2.14-5ubuntu8.7)
apache-tomcat-7.0.22


: 아파치 설치

$ sudo apt-get install apache2


: 설치된 apache2 버전 확인

$ apache2 -v
Server version: Apache/2.2.14 (Ubuntu)
Server built:   Nov  3 2011 03:31:27


: 연동에 필요한 아파치 모듈

proxy
proxy_ajp
proxy_html
proxy_http

$ sudo apt-get install libapache2-mod-proxy-html
$ sudo a2enmod proxy_ajp
$ sudo a2enmod proxy_html
$ sudo a2enmod proxy_http

Run '/etc/init.d/apache2 restart' to activate new configuration!

$ ll /etc/apache2/mods-enabled/ | grep proxy
proxy.conf -> ../mods-available/proxy.conf
proxy.load -> ../mods-available/proxy.load
proxy_ajp.load -> ../mods-available/proxy_ajp.load
proxy_html.conf -> ../mods-available/proxy_html.conf
proxy_html.load -> ../mods-available/proxy_html.load
proxy_http.load -> ../mods-available/proxy_http.load


: virtual host 설정

$ sudo vi default
 
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName cardbook.com
        ServerAlias cardbook.com *.cardbook.com

        ProxyRequests Off
        ProxyPreserveHost On
        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>
        ProxyPass / http://localhost:8080/
        ProxyPassReverse / http://localhost:8080/

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

</VirtualHost>

$ sudo /etc/init.d/apache2 restart  


끝.
저작자 표시
크리에이티브 커먼즈 라이선스
Creative Commons License

Adding multiple last resources is disallowed.

2011/01/28 12:16 | Posted by 포데브(엄지사랑) 엄지사랑
환경: JDK1.6.0_21 + JBoss EAP 4.3.2 + Spring 2.5.6 + iBatis 2.3.4

위의 환경에서 2개이상의 DataSource를 설정하고 JTA 트랜잭션을 설정했을 때 아래와 같은 에러가 발생했다. 

[com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@473fc2
09:29:19,759[ERROR] (JakartaCommonsLoggingImpl.java:19) - Error calling Connection.prepareStatement:
org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fff1:c23b:4d420dcd:e status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fff1:c23b:4d420dcd:e status: ActionStatus.ABORT_ONLY >))
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:96)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)

다음을 URL에서 해결의 실마리를 찾았다.

http://venugopaal.wordpress.com/2009/02/11/jboss5-adding-multiple-last-resources-is-disallowed/

1. You have 2 EAR files in a single server instance. Not just 2 ear files, but from within a transaction of a deployed EAR file, when you try to access the other EAR file, get some data from there and try to commit the transaction. This is not allowed in arjuna API (AFAIK). To fix this, edit JBOSS_HOME/server/default/conf/jbossjta-properties.xml and add the following line

<property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true" />

The problem does not stop here..The datasource has to support it.

Modify the *ds.xml to look like this ( localtxdatasource would not work) :

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<xa-datasource>
<jndi-name>CatMgrDS</jndi-name>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:mysql://192.168.157.57:3306/30cm</xa-datasource-property>
<xa-datasource-property name="User">root</xa-datasource-property>
<xa-datasource-property name="Password">root</xa-datasource-property>
<!– the minimum size of the connection pool –>
<min-pool-size>1</min-pool-size>
<!– The maximum connections in a pool/sub-pool –>
<max-pool-size>4</max-pool-size>
</xa-datasource>
</datasources>

Next step is to make sure you have the latest version of mysql-connector(in my case atleast). Versions prior to 5.1.10 doesn’t support XA datasource(ref :http://marc.info/?l=kandula-dev&m=113945114400475&w=2) I replaced my old mysql connector with the latest one.

Things should work fine then. will keep this writing up to date to my best possible extent


필자의 경우 첫번째 방법인 

JBOSS_HOME/server/{instance}/conf/jbossjta-properties.xml 에

<property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true" />

를 추가함으로써 해결했다.

...
<properties depends="arjuna" name="jta">
    <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1"

            value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/>
    <property name="com.arjuna.ats.jta.supportSubtransactions" value="NO"/>
    <property name="com.arjuna.ats.jta.jtaTMImplementation"

            value="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"/>
    <property name="com.arjuna.ats.jta.jtaUTImplementation"
            value="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>

<property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true" />

</properties>

...

저작자 표시
크리에이티브 커먼즈 라이선스
Creative Commons License
이전 1 다음