geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanhongf...@apache.org
Subject svn commit: r1156942 - in /geronimo/server/trunk/plugins/uddi: uddi-jetty/pom.xml uddi-jetty/src/main/plan/plan.xml uddi-tomcat/pom.xml uddi-tomcat/src/main/plan/plan.xml uddi-war-repackage/src/main/java/org/apache/juddi/config/PersistenceManager.java
Date Fri, 12 Aug 2011 02:19:28 GMT
Author: hanhongfang
Date: Fri Aug 12 02:19:28 2011
New Revision: 1156942

URL: http://svn.apache.org/viewvc?rev=1156942&view=rev
Log:
use specific property name instead of general property in openjpa to avoid possible side effect.
GERONIMO-6109 Derby connection failure in uddi when PortOffset is not 0

Modified:
    geronimo/server/trunk/plugins/uddi/uddi-jetty/pom.xml
    geronimo/server/trunk/plugins/uddi/uddi-jetty/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/uddi/uddi-tomcat/pom.xml
    geronimo/server/trunk/plugins/uddi/uddi-tomcat/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/uddi/uddi-war-repackage/src/main/java/org/apache/juddi/config/PersistenceManager.java

Modified: geronimo/server/trunk/plugins/uddi/uddi-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/uddi/uddi-jetty/pom.xml?rev=1156942&r1=1156941&r2=1156942&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/uddi/uddi-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/uddi/uddi-jetty/pom.xml Fri Aug 12 02:19:28 2011
@@ -151,7 +151,7 @@
                             <config-xml-content>
                                 <gbean name="DerbyProperties">
                                 	<attribute name="systemProperties">
-                                		openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort
+ PortOffset}/UddiDatabase;create=false;
+                                		uddi.openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort
+ PortOffset}/UddiDatabase;create=false;
                                 	</attribute>
                                 </gbean>
                             </config-xml-content>

Modified: geronimo/server/trunk/plugins/uddi/uddi-jetty/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/uddi/uddi-jetty/src/main/plan/plan.xml?rev=1156942&r1=1156941&r2=1156942&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/uddi/uddi-jetty/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/uddi/uddi-jetty/src/main/plan/plan.xml Fri Aug 12 02:19:28
2011
@@ -23,7 +23,7 @@
   <!-- System Properties -->
  <gbean name="DerbyProperties" class="org.apache.geronimo.system.properties.SystemProperties">
      <attribute name="systemProperties">
-          openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort}/UddiDatabase;create=false;
+          uddi.openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort}/UddiDatabase;create=false;
      </attribute>
  </gbean>
   <!--<gbean name="UDDIResources" class="org.apache.geronimo.system.util.DirectoryInitializationGBean">-->

Modified: geronimo/server/trunk/plugins/uddi/uddi-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/uddi/uddi-tomcat/pom.xml?rev=1156942&r1=1156941&r2=1156942&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/uddi/uddi-tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugins/uddi/uddi-tomcat/pom.xml Fri Aug 12 02:19:28 2011
@@ -194,7 +194,7 @@
                             <config-xml-content>
                                 <gbean name="DerbyProperties">
                                 	<attribute name="systemProperties">
-                                		openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort
+ PortOffset}/UddiDatabase;create=false;
+                                		uddi.openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort
+ PortOffset}/UddiDatabase;create=false;
                                 	</attribute>
                                 </gbean>
                             </config-xml-content>

Modified: geronimo/server/trunk/plugins/uddi/uddi-tomcat/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/uddi/uddi-tomcat/src/main/plan/plan.xml?rev=1156942&r1=1156941&r2=1156942&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/uddi/uddi-tomcat/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/uddi/uddi-tomcat/src/main/plan/plan.xml Fri Aug 12 02:19:28
2011
@@ -52,7 +52,7 @@
    <!-- System Properties -->
     <gbean name="DerbyProperties" class="org.apache.geronimo.system.properties.SystemProperties">
         <attribute name="systemProperties">
-             openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort}/UddiDatabase;create=false;
+             uddi.openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort}/UddiDatabase;create=false;
         </attribute>
     </gbean>
 </web-app>

Modified: geronimo/server/trunk/plugins/uddi/uddi-war-repackage/src/main/java/org/apache/juddi/config/PersistenceManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/uddi/uddi-war-repackage/src/main/java/org/apache/juddi/config/PersistenceManager.java?rev=1156942&r1=1156941&r2=1156942&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/uddi/uddi-war-repackage/src/main/java/org/apache/juddi/config/PersistenceManager.java
(original)
+++ geronimo/server/trunk/plugins/uddi/uddi-war-repackage/src/main/java/org/apache/juddi/config/PersistenceManager.java
Fri Aug 12 02:19:28 2011
@@ -23,41 +23,40 @@ import javax.persistence.Persistence;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import java.util.Properties;
 
-public class PersistenceManager
-{
-  private static Log log = LogFactory.getLog(PersistenceManager.class);
-  public static final String PERSISTENCE_UNIT_NAME = "juddiDatabase";
-  private static EntityManagerFactory emf;
+public class PersistenceManager {
+    private static Log log = LogFactory.getLog(PersistenceManager.class);
+    public static final String PERSISTENCE_UNIT_NAME = "juddiDatabase";
+    private static EntityManagerFactory emf;
 
-  public static EntityManager getEntityManager()
-  {
-    try
-    {
-      if (emf == null)
-        AppConfig.getInstance();
-    }
-    catch (ConfigurationException e) {
-      log.error("Error initializing config in PersistenceManager", e);
-      throw new ExceptionInInitializerError(e);
-    }
-
-    return emf.createEntityManager();
-  }
+    public static EntityManager getEntityManager() {
+        try {
+            if (emf == null)
+                AppConfig.getInstance();
+        } catch (ConfigurationException e) {
+            log.error("Error initializing config in PersistenceManager", e);
+            throw new ExceptionInInitializerError(e);
+        }
 
-  public static void closeEntityManager() {
-    if (emf.isOpen())
-      emf.close();
-  }
+        return emf.createEntityManager();
+    }
 
-  protected static void initializeEntityManagerFactory(String persistenceUnitName) {
-    try {
-      if (emf == null)
-        emf = Persistence.createEntityManagerFactory(persistenceUnitName, System.getProperties());
+    public static void closeEntityManager() {
+        if (emf.isOpen())
+            emf.close();
     }
-    catch (Throwable t) {
-      log.error("entityManagerFactory creation failed", t);
-      throw new ExceptionInInitializerError(t);
+
+    protected static void initializeEntityManagerFactory(String persistenceUnitName) {
+        try {
+            if (emf == null) {
+                Properties properties = new Properties();
+                properties.put("openjpa.ConnectionURL", System.getProperty("uddi.openjpa.ConnectionURL"));
+                emf = Persistence.createEntityManagerFactory(persistenceUnitName, properties);
+            }
+        } catch (Throwable t) {
+            log.error("entityManagerFactory creation failed", t);
+            throw new ExceptionInInitializerError(t);
+        }
     }
-  }
 }



Mime
View raw message