[jboss-cvs] JBossAS SVN: r88030 - in projects/fresh/trunk: fresh-util and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Apr 29 18:24:32 EDT 2009
Author: ctomc
Date: 2009-04-29 18:24:32 -0400 (Wed, 29 Apr 2009)
New Revision: 88030
Modified:
projects/fresh/trunk/etc/0010-cp2-system-service.xml
projects/fresh/trunk/etc/0051-cp2-vfs-init-service.xml
projects/fresh/trunk/etc/0055-cp2-staticinit-service.xml
projects/fresh/trunk/fresh-util/pom.xml
projects/fresh/trunk/fresh-util/src/main/java/org/jboss/fresh/util/TxSupport.java
Log:
deploy to jboss 5 works now! added missed dependancies
Modified: projects/fresh/trunk/etc/0010-cp2-system-service.xml
===================================================================
--- projects/fresh/trunk/etc/0010-cp2-system-service.xml 2009-04-29 21:44:30 UTC (rev 88029)
+++ projects/fresh/trunk/etc/0010-cp2-system-service.xml 2009-04-29 22:24:32 UTC (rev 88030)
@@ -6,7 +6,7 @@
<mbean code="org.jboss.fresh.deployer.Cp2ConfigurationService" name="FRESH:service=Cp2ConfigurationService">
<attribute name="JNDIName">java:/FRESH/Configuration</attribute>
<attribute name="Properties">
- cp2.UserTransaction.jndiName=UserTransaction
+ cp2.UserTransaction.jndiName=java:comp/UserTransaction
</attribute>
</mbean>
Modified: projects/fresh/trunk/etc/0051-cp2-vfs-init-service.xml
===================================================================
--- projects/fresh/trunk/etc/0051-cp2-vfs-init-service.xml 2009-04-29 21:44:30 UTC (rev 88029)
+++ projects/fresh/trunk/etc/0051-cp2-vfs-init-service.xml 2009-04-29 22:24:32 UTC (rev 88030)
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<server>
-
-
+
<mbean code="org.jboss.fresh.deployer.ShellExecutorService" name="FRESH:service=VFS.Mem.Init">
<attribute name="BatchCode">
mkdir /home
@@ -231,6 +230,8 @@
<attribute name="UseLocal">true</attribute>
<attribute name="SvcName">java:/FRESH/SystemShell</attribute>
<depends>FRESH:service=SystemShell</depends>
+ <depends>jboss:service=ClientUserTransaction</depends>
+
</mbean>
</server>
\ No newline at end of file
Modified: projects/fresh/trunk/etc/0055-cp2-staticinit-service.xml
===================================================================
--- projects/fresh/trunk/etc/0055-cp2-staticinit-service.xml 2009-04-29 21:44:30 UTC (rev 88029)
+++ projects/fresh/trunk/etc/0055-cp2-staticinit-service.xml 2009-04-29 22:24:32 UTC (rev 88030)
@@ -8,5 +8,6 @@
<attribute name="UseLocal">true</attribute>
<attribute name="ExecuteOnStart">true</attribute>
<depends>FRESH:service=SystemShell</depends>
+ <depends>jboss:service=ClientUserTransaction</depends>
</mbean>
</server>
\ No newline at end of file
Modified: projects/fresh/trunk/fresh-util/pom.xml
===================================================================
--- projects/fresh/trunk/fresh-util/pom.xml 2009-04-29 21:44:30 UTC (rev 88029)
+++ projects/fresh/trunk/fresh-util/pom.xml 2009-04-29 22:24:32 UTC (rev 88030)
@@ -22,7 +22,7 @@
<dependency>
<groupId>apache-log4j</groupId>
<artifactId>log4j</artifactId>
- <scope>provided</scope>
+
</dependency>
Modified: projects/fresh/trunk/fresh-util/src/main/java/org/jboss/fresh/util/TxSupport.java
===================================================================
--- projects/fresh/trunk/fresh-util/src/main/java/org/jboss/fresh/util/TxSupport.java 2009-04-29 21:44:30 UTC (rev 88029)
+++ projects/fresh/trunk/fresh-util/src/main/java/org/jboss/fresh/util/TxSupport.java 2009-04-29 22:24:32 UTC (rev 88030)
@@ -1,6 +1,8 @@
package org.jboss.fresh.util;
import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.NameNotFoundException;
import javax.transaction.Status;
import javax.transaction.TransactionManager;
@@ -29,6 +31,29 @@
return Cp2Configuration.getUserTransactionJndiName();
}
+ protected static javax.transaction.UserTransaction getUserTransaction() throws NamingException
+ {
+ InitialContext context = new InitialContext();
+ try
+ {
+ return (javax.transaction.UserTransaction) context.lookup("java:comp/UserTransaction");
+ }
+ catch (NameNotFoundException nnfe)
+ {
+ try
+ {
+ //Embedded JBoss has no java:comp/UserTransaction
+ javax.transaction.UserTransaction ut = (javax.transaction.UserTransaction) context.lookup("UserTransaction");
+ ut.getStatus(); //for glassfish, which can return an unusable UT
+ return ut;
+ }
+ catch (Exception e)
+ {
+ throw nnfe;
+ }
+ }
+ }
+
public static UserTransaction getUT() throws Exception {
// cache for 10 secs then do another lookup.
//long ct = System.currentTimeMillis();
@@ -43,9 +68,10 @@
UserTransaction ut = (UserTransaction) tloc.get();
if(ut != null)
return ut;
-
- InitialContext ctx = new InitialContext();
- return (UserTransaction) ctx.lookup(getUTjndiName());
+
+ return getUserTransaction();
+ /*InitialContext ctx = new InitialContext();
+ return (UserTransaction) ctx.lookup(getUTjndiName());*/
}
More information about the jboss-cvs-commits
mailing list