roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1053252 - in /roller/trunk: planet-business/ planet-business/src/main/java/org/apache/roller/planet/business/ planet-business/src/main/java/org/apache/roller/planet/business/jpa/ weblogger-business/ weblogger-business/src/main/java/org/apa...
Date Tue, 28 Dec 2010 04:46:18 GMT
Author: snoopdave
Date: Tue Dec 28 04:46:17 2010
New Revision: 1053252

URL: http://svn.apache.org/viewvc?rev=1053252&view=rev
Log:
More fixes to get Roller working on Tomcat, Glassfish and Websphere.
Related to: https://issues.apache.org/jira/browse/ROL-1894

Modified:
    roller/trunk/planet-business/pom.xml
    roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/DatabaseProvider.java
    roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/jpa/JPAPersistenceStrategy.java
    roller/trunk/weblogger-business/pom.xml
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
    roller/trunk/weblogger-war-assembly/src/main/assembly/for-javaee.xml
    roller/trunk/weblogger-war-assembly/src/main/assembly/for-jboss.xml
    roller/trunk/weblogger-war-assembly/src/main/assembly/for-tomcat.xml
    roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml

Modified: roller/trunk/planet-business/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/pom.xml?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/planet-business/pom.xml (original)
+++ roller/trunk/planet-business/pom.xml Tue Dec 28 04:46:17 2010
@@ -359,7 +359,7 @@
                 <property><name>jboss</name></property>
             </activation> 
             <properties>
-                <datasourceName>java:/jdbc/rollerdb</datasourceName>
+                <datasourceName>java:/RollerDS</datasourceName>
             </properties>
         </profile>
 

Modified: roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/DatabaseProvider.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/DatabaseProvider.java?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/DatabaseProvider.java
(original)
+++ roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/DatabaseProvider.java
Tue Dec 28 04:46:17 2010
@@ -203,4 +203,10 @@ public class DatabaseProvider  {
         return jdbcUsername;
     }
 
+    public String getFullJndiName() {
+        if (null != jndiName && jndiName.startsWith("java:")) {
+            return jndiName;
+        }
+        return "java:comp/env/" + jndiName;
+    }
 }

Modified: roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/jpa/JPAPersistenceStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/jpa/JPAPersistenceStrategy.java?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/jpa/JPAPersistenceStrategy.java
(original)
+++ roller/trunk/planet-business/src/main/java/org/apache/roller/planet/business/jpa/JPAPersistenceStrategy.java
Tue Dec 28 04:46:17 2010
@@ -73,6 +73,7 @@ public class JPAPersistenceStrategy {
 
         String jpaConfigurationType = PlanetConfig.getProperty("jpa.configurationType");
         if ("jndi".equals(jpaConfigurationType)) {
+            // Lookup EMF via JNDI: added for Geronimo
             String emfJndiName = "java:comp/env/" + PlanetConfig.getProperty("jpa.emf.jndi.name");
             try {
                 emf = (EntityManagerFactory) new InitialContext().lookup(emfJndiName);
@@ -97,21 +98,13 @@ public class JPAPersistenceStrategy {
             }
 
             if (dbProvider.getType() == DatabaseProvider.ConfigurationType.JNDI_NAME) {
-                // We're doing JNDI, so set OpenJPA JNDI name property
-                String jndiName = "java:comp/env/" + dbProvider.getJndiName();
-                emfProps.setProperty("openjpa.ConnectionFactoryName", jndiName);
+                emfProps.setProperty("javax.persistence.nonJtaDataSource", dbProvider.getJndiName());
 
             } else {
                 emfProps.setProperty("javax.persistence.jdbc.driver", dbProvider.getJdbcDriverClass());
                 emfProps.setProperty("javax.persistence.jdbc.url", dbProvider.getJdbcConnectionURL());
                 emfProps.setProperty("javax.persistence.jdbc.user", dbProvider.getJdbcUsername());
                 emfProps.setProperty("javax.persistence.jdbc.password", dbProvider.getJdbcPassword());
-
-                // And Hibernate JPA
-                emfProps.setProperty("hibernate.connection.driver_class", dbProvider.getJdbcDriverClass());
-                emfProps.setProperty("hibernate.connection.url", dbProvider.getJdbcConnectionURL());
-                emfProps.setProperty("hibernate.connection.username", dbProvider.getJdbcUsername());
-                emfProps.setProperty("hibernate.connection.password", dbProvider.getJdbcPassword());
             }
 
             try {

Modified: roller/trunk/weblogger-business/pom.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/pom.xml?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/weblogger-business/pom.xml (original)
+++ roller/trunk/weblogger-business/pom.xml Tue Dec 28 04:46:17 2010
@@ -424,7 +424,7 @@
                 <property><name>jboss</name></property>
             </activation> 
             <properties>
-                <datasourceName>java:/jdbc/rollerdb</datasourceName>
+                <datasourceName>java:/RollerDS</datasourceName>
             </properties>
         </profile>
 

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/DatabaseProvider.java
Tue Dec 28 04:46:17 2010
@@ -29,7 +29,6 @@ import javax.naming.NamingException;
 import javax.sql.DataSource;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.startup.StartupException;
 import org.apache.roller.weblogger.config.WebloggerConfig;
 
@@ -203,5 +202,12 @@ public class DatabaseProvider  {
     public String getJdbcUsername() {
         return jdbcUsername;
     }
+    
+    public String getFullJndiName() {
+        if (null != jndiName && jndiName.startsWith("java:")) {
+            return jndiName;
+        }
+        return "java:comp/env/" + jndiName;
+    }
 
 }

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
(original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/jpa/JPAPersistenceStrategy.java
Tue Dec 28 04:46:17 2010
@@ -71,6 +71,7 @@ public class JPAPersistenceStrategy {
     protected JPAPersistenceStrategy(DatabaseProvider dbProvider) throws WebloggerException
{
         String jpaConfigurationType = WebloggerConfig.getProperty("jpa.configurationType");
         if ("jndi".equals(jpaConfigurationType)) {
+            // Lookup EMF via JNDI: added for Geronimo
             String emfJndiName = "java:comp/env/" + WebloggerConfig.getProperty("jpa.emf.jndi.name");
             try {
                 emf = (EntityManagerFactory) new InitialContext().lookup(emfJndiName);
@@ -94,21 +95,13 @@ public class JPAPersistenceStrategy {
             }
 
             if (dbProvider.getType() == DatabaseProvider.ConfigurationType.JNDI_NAME) {
-                // We're doing JNDI, so set OpenJPA JNDI name property
-                String jndiName = "java:comp/env/" + dbProvider.getJndiName();
-                emfProps.setProperty("javax.persistence.nonJtaDataSource", jndiName);
+                emfProps.setProperty("javax.persistence.nonJtaDataSource", dbProvider.getJndiName());
 
             } else {
                 emfProps.setProperty("javax.persistence.jdbc.driver", dbProvider.getJdbcDriverClass());
                 emfProps.setProperty("javax.persistence.jdbc.url", dbProvider.getJdbcConnectionURL());
                 emfProps.setProperty("javax.persistence.jdbc.user", dbProvider.getJdbcUsername());
                 emfProps.setProperty("javax.persistence.jdbc.password", dbProvider.getJdbcPassword());
-
-                // And Hibernate JPA?
-                emfProps.setProperty("hibernate.connection.driver_class", dbProvider.getJdbcDriverClass());
-                emfProps.setProperty("hibernate.connection.url", dbProvider.getJdbcConnectionURL());
-                emfProps.setProperty("hibernate.connection.username", dbProvider.getJdbcUsername());
-                emfProps.setProperty("hibernate.connection.password", dbProvider.getJdbcPassword());
             }
 
             try {

Modified: roller/trunk/weblogger-war-assembly/src/main/assembly/for-javaee.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-war-assembly/src/main/assembly/for-javaee.xml?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/weblogger-war-assembly/src/main/assembly/for-javaee.xml (original)
+++ roller/trunk/weblogger-war-assembly/src/main/assembly/for-javaee.xml Tue Dec 28 04:46:17
2010
@@ -27,9 +27,11 @@
         <format>war</format>
     </formats>
     <includeBaseDirectory>false</includeBaseDirectory>
-
+    
     <fileSets>  
         <fileSet>
+            <outputDirectory>.</outputDirectory>
+            <directory>../weblogger-webapp/target/roller</directory>
             <excludes>
                 <!-- don't include all those Jave EE jars that Tomcat needs -->
                 <exclude>**/openjpa**</exclude>
@@ -40,5 +42,5 @@
             </excludes>
         </fileSet>
     </fileSets>
-
+    
 </assembly>

Modified: roller/trunk/weblogger-war-assembly/src/main/assembly/for-jboss.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-war-assembly/src/main/assembly/for-jboss.xml?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/weblogger-war-assembly/src/main/assembly/for-jboss.xml (original)
+++ roller/trunk/weblogger-war-assembly/src/main/assembly/for-jboss.xml Tue Dec 28 04:46:17
2010
@@ -18,8 +18,8 @@
 -->
 
 <!--
-  WARNING: to produce a JBoss compatible build you MUST first build Roller 
-  Weblogger using the -Djavaee=true option, e.g. mvn -Djavaee=true install
+   WARNING: to produce a JBoss compatible build you MUST first build Roller 
+   Weblogger using the -Djavaee=true option, e.g. mvn -Djavaee=true install
 -->
 <assembly>
     <id>jboss</id>
@@ -27,7 +27,7 @@
         <format>war</format>
     </formats>
     <includeBaseDirectory>false</includeBaseDirectory>
-
+    
     <fileSets>
         <fileSet>
             <outputDirectory>.</outputDirectory>
@@ -48,5 +48,5 @@
             </excludes>
         </fileSet>
     </fileSets>
-
+    
 </assembly>

Modified: roller/trunk/weblogger-war-assembly/src/main/assembly/for-tomcat.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-war-assembly/src/main/assembly/for-tomcat.xml?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/weblogger-war-assembly/src/main/assembly/for-tomcat.xml (original)
+++ roller/trunk/weblogger-war-assembly/src/main/assembly/for-tomcat.xml Tue Dec 28 04:46:17
2010
@@ -27,7 +27,7 @@
         <format>war</format>
     </formats>
     <includeBaseDirectory>false</includeBaseDirectory>
-
+    
     <fileSets>
         <fileSet>
             <outputDirectory>.</outputDirectory>
@@ -38,5 +38,5 @@
             </excludes>
         </fileSet>
     </fileSets>
-
+    
 </assembly>

Modified: roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml?rev=1053252&r1=1053251&r2=1053252&view=diff
==============================================================================
--- roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml (original)
+++ roller/trunk/weblogger-webapp/src/main/webapp/WEB-INF/jboss-web.xml Tue Dec 28 04:46:17
2010
@@ -2,8 +2,13 @@
 <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" 
      "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
 <jboss-web>
+   <context-root>roller</context-root>
    <resource-ref>
         <res-ref-name>jdbc/rollerdb</res-ref-name>
-        <jndi-name>java:/jdbc/rollerdb</jndi-name>
+        <jndi-name>java:/RollerDS</jndi-name>
+   </resource-ref>
+   <resource-ref>
+        <res-ref-name>mail/Session</res-ref-name>
+        <jndi-name>java:/Mail</jndi-name>
    </resource-ref>
 </jboss-web>



Mime
View raw message