svn commit: r663736 - in /ofbiz/trunk/framework/appserver/templates/jboss422: deploy.sh patches/ patches/derby-ds.xml patches/derby-ol-ds.xml patches/jboss-ee-cfg.patch run.conf run.sh

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r663736 - in /ofbiz/trunk/framework/appserver/templates/jboss422: deploy.sh patches/ patches/derby-ds.xml patches/derby-ol-ds.xml patches/jboss-ee-cfg.patch run.conf run.sh

jaz-3
Author: jaz
Date: Thu Jun  5 14:02:33 2008
New Revision: 663736

URL: http://svn.apache.org/viewvc?rev=663736&view=rev
Log:
updated jboss422 deployment configurations:

1. now setups up derby (in jboss)
2. configures entityengine.xml to use jboss datasource/tx manager
3. removed more conflicting libraries
4. no longer edits run.sh; adds OFBIZ_HOME to run.conf; now auto-installs config


Added:
    ofbiz/trunk/framework/appserver/templates/jboss422/patches/
    ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ds.xml
    ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ol-ds.xml
    ofbiz/trunk/framework/appserver/templates/jboss422/patches/jboss-ee-cfg.patch
    ofbiz/trunk/framework/appserver/templates/jboss422/run.conf
Removed:
    ofbiz/trunk/framework/appserver/templates/jboss422/run.sh
Modified:
    ofbiz/trunk/framework/appserver/templates/jboss422/deploy.sh

Modified: ofbiz/trunk/framework/appserver/templates/jboss422/deploy.sh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/jboss422/deploy.sh?rev=663736&r1=663735&r2=663736&view=diff
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/jboss422/deploy.sh (original)
+++ ofbiz/trunk/framework/appserver/templates/jboss422/deploy.sh Thu Jun  5 14:02:33 2008
@@ -7,6 +7,7 @@
 # in the JBoss deploy directory #
 #                               #
 #################################
+DERBY_VERSION="10.4.1.3"
 
 if [ -f "./META-INF/application.xml" ]; then
   rm -rf META-INF
@@ -19,7 +20,36 @@
   echo "removed wars"
 fi
 
-# move log4j.xml and jndi.properties
+# install derby
+if [ ! -f "../../lib/derby-$DERBY_VERSION.jar" ]; then
+  cp "${ofbizHome}/framework/entity/lib/jdbc/derby-$DERBY_VERSION.jar" ../../lib/
+  echo "installed derby-$DERBY_VERSION"
+fi
+
+# install derby plugin
+if [ ! -f "../../lib/derby-plugin.jar" ]; then
+  cp ../../../../docs/examples/varia/derby-plugin.jar ../../lib/
+  echo "installed derby-plugin.jar"
+fi
+
+# install derby datasource
+if [ ! -f "../derby-ds.xml" ]; then
+  cp ${ofbizHome}/framework/appserver/templates/jboss422/patches/derby*.xml ..
+  echo "derby datasource configuration installed"
+fi
+
+# configure the jboss entity engine (patch) configuration
+if [ ! -f "${ofbizHome}/framework/entity/config/entityengine-jboss422.xml" ]; then
+  patch -i ${ofbizHome}/framework/appserver/templates/jboss422/patches/jboss-ee-cfg.patch -o ${ofbizHome}/framework/entity/config/entityengine-jboss422.xml ${ofbizHome}/framework/entity/config/entityengine.xml
+  echo "created entityengine-jboss.xml"
+fi
+
+# move entityengine.xml, log4j.xml and jndi.properties
+if [ -f "${ofbizHome}/framework/entity/config/entityengine-jboss422.xml" ]; then
+  mv ${ofbizHome}/framework/entity/config/entityengine.xml ${ofbizHome}/framework/entity/config/entityengine.xml.jbak
+  mv ${ofbizHome}/framework/entity/config/entityengine-jboss422.xml ${ofbizHome}/framework/entity/config/entityengine.xml
+  echo "moved entityengine.xml"
+fi
 if [ -f "${ofbizHome}/framework/base/config/log4j.xml" ]; then
   mv ${ofbizHome}/framework/base/config/log4j.xml ${ofbizHome}/framework/base/config/_log4j.xml.bak
   echo "moved ${ofbizHome}/framework/base/config/log4j.xml"
@@ -32,7 +62,7 @@
 # copy all lib files
 mkdir lib
 <#list classpathJars as jar>
-<#if (!jar.contains("j2eespec") && !jar.contains("geronimo") && !jar.contains("catalina") && !jar.contains("mx4j") && !jar.contains("commons-el") && !jar.equals("mail.jar"))>
+<#if (!jar.contains("j2eespec") && !jar.contains("geronimo") && !jar.contains("catalina") && !jar.contains("mx4j") && !jar.contains("derby-") && !jar.contains("commons-logging") &&!jar.contains("commons-collections") &&!jar.contains("commons-codec") && !jar.contains("commons-el") && !jar.contains("avalon-framework") && !jar.contains("bsh") && !jar.contains("bsf") && !jar.contains("antlr") && !jar.contains("mail.jar"))>
 cp ${jar} ./lib
 </#if>
 </#list>
@@ -65,7 +95,12 @@
   echo "updated bsh.jar"
 fi
 
-# revert log4j.xml and jndi.properties
+# revert entityengine.xml log4j.xml and jndi.properties
+if [ -f "${ofbizHome}/framework/entity/config/entityengine.xml.jbak" ]; then
+  mv ${ofbizHome}/framework/entity/config/entityengine.xml ${ofbizHome}/framework/entity/config/entityengine-jboss422.xml
+  mv ${ofbizHome}/framework/entity/config/entityengine.xml.jbak ${ofbizHome}/framework/entity/config/entityengine.xml
+  echo "fixed entityengine.xml"
+fi
 if [ -f "${ofbizHome}/framework/base/config/_log4j.xml.bak" ]; then
   mv ${ofbizHome}/framework/base/config/_log4j.xml.bak ${ofbizHome}/framework/base/config/log4j.xml
   echo "fixed ${ofbizHome}/framework/base/config/log4j.xml"
@@ -75,5 +110,11 @@
   echo "fixed ${ofbizHome}/framework/base/config/jndi.properties"
 fi
 
+# setup the OFBIZ_HOME by updating run.conf
+if [ ! -f "../../../../bin/run.conf.obak" ]; then
+  mv ../../../../bin/run.conf ../../../../bin/run.conf.obak
+  cp ${ofbizHome}/setup/jboss422/run.conf ../../../../bin/run.conf
+  echo "modifed bin/run.conf (with backup)"
+fi
+
 echo "\n"
-echo "make sure run.sh includes -Dofbiz.home=${ofbizHome} as part of the JAVA_OPTS variable"
\ No newline at end of file

Added: ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ds.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ds.xml?rev=663736&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ds.xml (added)
+++ ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ds.xml Thu Jun  5 14:02:33 2008
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  -->
+
+<!-- The Derby embedded database JCA connection factory config
+$Id: derby-ds.xml,v 1.1.4.1 2004/11/03 13:28:39 loubyansky Exp $ -->
+
+
+<datasources>
+   <local-tx-datasource>
+
+      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
+      <!-- Datasources are not available outside the virtual machine -->
+      <jndi-name>OFBizDS</jndi-name>
+
+      <!-- for in-process persistent db, saved when jboss stops. The
+      org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown -->
+      <connection-url>jdbc:derby:${jboss.server.data.dir}${/}derby${/}ofbiz;create=true</connection-url>
+
+      <!-- The driver class -->
+      <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
+
+      <!-- The login and password -->
+      <user-name>sa</user-name>
+      <password></password>
+
+      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
+      <min-pool-size>2</min-pool-size>
+
+      <!-- The maximum connections in a pool/sub-pool -->
+      <max-pool-size>5</max-pool-size>
+
+      <!-- The time before an unused connection is destroyed -->
+      <idle-timeout-minutes>15</idle-timeout-minutes>
+
+      <!-- Whether to check all statements are closed when the connection is returned to the pool,
+           this is a debugging feature that should be turned off in production -->
+      <track-statements/>
+
+      <!-- This mbean can be used when using in process persistent derby -->
+      <depends>jboss:service=OFBiz</depends>
+   </local-tx-datasource>
+
+   <mbean code="org.jboss.jdbc.DerbyDatabase" name="jboss:service=OFBiz"/>
+</datasources>

Added: ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ol-ds.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ol-ds.xml?rev=663736&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ol-ds.xml (added)
+++ ofbiz/trunk/framework/appserver/templates/jboss422/patches/derby-ol-ds.xml Thu Jun  5 14:02:33 2008
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  -->
+
+<!-- The Derby embedded database JCA connection factory config
+$Id: derby-ds.xml,v 1.1.4.1 2004/11/03 13:28:39 loubyansky Exp $ -->
+
+
+<datasources>
+   <local-tx-datasource>
+
+      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
+      <!-- Datasources are not available outside the virtual machine -->
+      <jndi-name>OFBizOlapDS</jndi-name>
+
+      <!-- for in-process persistent db, saved when jboss stops. The
+      org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown -->
+      <connection-url>jdbc:derby:${jboss.server.data.dir}${/}derby${/}ofbizolap;create=true</connection-url>
+
+      <!-- The driver class -->
+      <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
+
+      <!-- The login and password -->
+      <user-name>sa</user-name>
+      <password></password>
+
+      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
+      <min-pool-size>2</min-pool-size>
+
+      <!-- The maximum connections in a pool/sub-pool -->
+      <max-pool-size>5</max-pool-size>
+
+      <!-- The time before an unused connection is destroyed -->
+      <idle-timeout-minutes>15</idle-timeout-minutes>
+
+      <!-- Whether to check all statements are closed when the connection is returned to the pool,
+           this is a debugging feature that should be turned off in production -->
+      <track-statements/>
+
+      <!-- This mbean can be used when using in process persistent derby -->
+      <depends>jboss:service=OFBizOlap</depends>
+   </local-tx-datasource>
+
+   <mbean code="org.jboss.jdbc.DerbyDatabase" name="jboss:service=OFBizOlap"/>
+</datasources>

Added: ofbiz/trunk/framework/appserver/templates/jboss422/patches/jboss-ee-cfg.patch
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/jboss422/patches/jboss-ee-cfg.patch?rev=663736&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/jboss422/patches/jboss-ee-cfg.patch (added)
+++ ofbiz/trunk/framework/appserver/templates/jboss422/patches/jboss-ee-cfg.patch Thu Jun  5 14:02:33 2008
@@ -0,0 +1,78 @@
+Index: framework/entity/config/entityengine.xml
+===================================================================
+--- framework/entity/config/entityengine.xml (revision 661518)
++++ framework/entity/config/entityengine.xml (working copy)
+@@ -28,15 +28,15 @@
+
+     <!-- the transaction factory class to use, one is needed for each way of getting JTA interfaces -->
+     <!-- Use this one for Geronimo -->
+-    <transaction-factory class="org.ofbiz.geronimo.GeronimoTransactionFactory"/>
++    <!--<transaction-factory class="org.ofbiz.geronimo.GeronimoTransactionFactory"/>-->
+
+     <!-- Use this one for getting the JTA objects from JNDI -->
+-    <!-- NOTE: to use the JndiFactory you must specify the necessary JNDI properties
++    <!-- NOTE: to use the JndiFactory you must specify the necessary JNDI properties -->
+     <transaction-factory class="org.ofbiz.entity.transaction.JNDIFactory">
+         <user-transaction-jndi jndi-server-name="default" jndi-name="java:comp/UserTransaction"/>
+-        <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/UserTransaction"/>
++        <transaction-manager-jndi jndi-server-name="default" jndi-name="java:/TransactionManager"/>
+     </transaction-factory>
+-    -->
++    
+     <!--
+     It is common to use UserTransaction for the TransactionManager, but if that doesn't work, try this: <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/TransactionManager"/>
+         Common UserTransaction locations:
+@@ -160,6 +160,7 @@
+         <read-data reader-name="seed-initial"/>
+         <read-data reader-name="demo"/>
+         <read-data reader-name="ext"/>
++        <!--
+         <inline-jdbc
+                 jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
+                 jdbc-uri="jdbc:derby:ofbiz;create=true"
+@@ -168,7 +169,8 @@
+                 isolation-level="ReadCommitted"
+                 pool-minsize="2"
+                 pool-maxsize="250"/>
+-        <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
++        -->
++        <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/OFBizDS" isolation-level="ReadCommitted"/>
+     </datasource>
+     <datasource name="localderbyodbc"
+         helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
+@@ -179,6 +181,7 @@
+         use-pk-constraint-names="false"
+         use-indices-unique="false"
+         alias-view-columns="false">
++        <!--
+         <inline-jdbc
+             jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
+             jdbc-uri="jdbc:derby:ofbizodbc;create=true"
+@@ -187,7 +190,8 @@
+             isolation-level="ReadCommitted"
+             pool-minsize="2"
+             pool-maxsize="250"/>
+-        <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
++        -->
++        <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/OFBizOdbcDS" isolation-level="ReadCommitted"/>
+     </datasource>
+     <datasource name="localderbyolap"
+             helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
+@@ -202,6 +206,7 @@
+         <read-data reader-name="seed-initial"/>
+         <read-data reader-name="demo"/>
+         <read-data reader-name="ext"/>
++        <!--
+         <inline-jdbc
+                 jdbc-driver="org.apache.derby.jdbc.EmbeddedDriver"
+                 jdbc-uri="jdbc:derby:ofbizolap;create=true"
+@@ -210,7 +215,8 @@
+                 isolation-level="ReadCommitted"
+                 pool-minsize="2"
+                 pool-maxsize="250"/>
+-        <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/DerbyDataSource" isolation-level="ReadCommitted"/> -->
++        -->
++        <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/OFBizOlapDS" isolation-level="ReadCommitted"/>
+     </datasource>
+    
+     <datasource name="localcloudscape"

Added: ofbiz/trunk/framework/appserver/templates/jboss422/run.conf
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/appserver/templates/jboss422/run.conf?rev=663736&view=auto
==============================================================================
--- ofbiz/trunk/framework/appserver/templates/jboss422/run.conf (added)
+++ ofbiz/trunk/framework/appserver/templates/jboss422/run.conf Thu Jun  5 14:02:33 2008
@@ -0,0 +1,51 @@
+## -*- shell-script -*- ######################################################
+##                                                                          ##
+##  JBoss Bootstrap Script Configuration                                    ##
+##                                                                          ##
+##############################################################################
+
+### $Id: run.conf 62747 2007-05-02 17:43:36Z [hidden email] $
+
+#
+# This file is optional; it may be removed if not needed.
+#
+
+#
+# Specify the maximum file descriptor limit, use "max" or "maximum" to use
+# the default, as queried by the system.
+#
+# Defaults to "maximum"
+#
+#MAX_FD="maximum"
+
+#
+# Specify the profiler configuration file to load.
+#
+# Default is to not load profiler configuration file.
+#
+#PROFILER=""
+
+#
+# Specify the location of the Java home directory.  If set then $JAVA will
+# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".
+#
+#JAVA_HOME="/opt/java/jdk"
+
+#
+# Specify the exact Java VM executable to use.
+#
+#JAVA=""
+
+#
+# Specify options to pass to the Java VM.
+#
+if [ "x$JAVA_OPTS" = "x" ]; then
+   #JAVA_OPTS="-Xmx1024M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
+   JAVA_OPTS="-Xmx512M -XX:PermSize=512M -Dofbiz.home=${ofbizHome}"
+fi
+
+# Sample JPDA settings for remote socket debuging
+#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
+
+# Sample JPDA settings for shared memory debugging
+#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,server=y,suspend=n,address=jboss"