geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r487775 - in /geronimo/server/trunk: modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ modules/geronimo-naming-builder/src/main/schema/ modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/g...
Date Sat, 16 Dec 2006 09:06:30 GMT
Author: djencks
Date: Sat Dec 16 01:06:29 2006
New Revision: 487775

URL: http://svn.apache.org/viewvc?view=rev&rev=487775
Log:
GERONIMO-2657 Pay attention to spec descriptors as well as our proprietary ones.  Change the
naming schema to use the same constant strings as the spec. Include a test of spec descriptor
persistence refs

Modified:
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
    geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ear/src/test/java/org/apache/geronimo/testsuite/jpa/JPATest.java
    geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ejb/src/main/resources/META-INF/openejb-jar.xml
    geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/java/org/apache/geronimo/itest/TestServlet.java
    geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/webapp/WEB-INF/web.xml

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?view=diff&rev=487775&r1=487774&r2=487775
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Sat Dec 16 01:06:29 2006
@@ -55,6 +55,7 @@
     protected static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
     protected static final String JEE_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
     protected static final NamespaceElementConverter J2EE_CONVERTER = new NamespaceElementConverter(J2EE_NAMESPACE);
+    protected static final NamespaceElementConverter JEE_CONVERTER = new NamespaceElementConverter(JEE_NAMESPACE);
     protected static final NamespaceElementConverter NAMING_CONVERTER = new NamespaceElementConverter(GerAbstractNamingEntryDocument.type.getDocumentElementName().getNamespaceURI());
 
     private final Environment defaultEnvironment;

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd?view=diff&rev=487775&r1=487774&r2=487775
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
(original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
Sat Dec 16 01:06:29 2006
@@ -168,8 +168,8 @@
 
     <xsd:simpleType name="persistence-context-typeType">
         <xsd:restriction base="xsd:string">
-            <xsd:enumeration value="transaction-scoped"/>
-            <xsd:enumeration value="extended"/>
+            <xsd:enumeration value="Transactional"/>
+            <xsd:enumeration value="Extended"/>
         </xsd:restriction>
     </xsd:simpleType>
 

Modified: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java?view=diff&rev=487775&r1=487774&r2=487775
==============================================================================
--- geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
Sat Dec 16 01:06:29 2006
@@ -43,6 +43,8 @@
 import org.apache.geronimo.xbeans.geronimo.naming.GerPersistenceContextRefType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPersistenceContextTypeType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPropertyType;
+import org.apache.geronimo.xbeans.javaee.PersistenceContextRefType;
+import org.apache.geronimo.xbeans.javaee.PropertyType;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 
@@ -50,43 +52,71 @@
  * @version $Rev$ $Date$
  */
 public class PersistenceContextRefBuilder extends AbstractNamingBuilder {
-    private static final QName PERSISTENCE_CONTEXT_REF_QNAME = GerPersistenceContextRefDocument.type.getDocumentElementName();
+    private static final QName PERSISTENCE_CONTEXT_REF_QNAME = new QName(JEE_NAMESPACE, "persistence-context-ref");
     private static final QNameSet PERSISTENCE_CONTEXT_REF_QNAME_SET = QNameSet.singleton(PERSISTENCE_CONTEXT_REF_QNAME);
+    private static final QName GER_PERSISTENCE_CONTEXT_REF_QNAME = GerPersistenceContextRefDocument.type.getDocumentElementName();
+    private static final QNameSet GER_PERSISTENCE_CONTEXT_REF_QNAME_SET = QNameSet.singleton(GER_PERSISTENCE_CONTEXT_REF_QNAME);
+    private static final Set<String> PERSISTENCE_UNIT_INTERFACE_TYPES = Collections.singleton("org.apache.geronimo.persistence.PersistenceUnitGBean");
+    private final AbstractNameQuery defaultPersistenceUnitAbstractNameQuery;
 
-    public PersistenceContextRefBuilder(Environment defaultEnvironment) {
+    public PersistenceContextRefBuilder(Environment defaultEnvironment, AbstractNameQuery
defaultPersistenceUnitAbstractNameQuery) {
         super(defaultEnvironment);
+        this.defaultPersistenceUnitAbstractNameQuery = defaultPersistenceUnitAbstractNameQuery;
     }
 
     protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) throws DeploymentException
{
-        return plan != null && plan.selectChildren(PersistenceContextRefBuilder.PERSISTENCE_CONTEXT_REF_QNAME_SET).length
> 0;
+        return plan != null && plan.selectChildren(PersistenceContextRefBuilder.GER_PERSISTENCE_CONTEXT_REF_QNAME_SET).length
> 0;
     }
 
     public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException
{
-        List<GerPersistenceContextRefType> persistenceContextRefsUntyped = convert(plan.selectChildren(PersistenceContextRefBuilder.PERSISTENCE_CONTEXT_REF_QNAME_SET),
NAMING_CONVERTER, GerPersistenceContextRefType.class, GerPersistenceContextRefType.type);
-        for (GerPersistenceContextRefType persistenceContextRef: persistenceContextRefsUntyped)
{
-            String persistenceContextRefName = persistenceContextRef.getPersistenceContextRefName();
-            boolean transactionScoped = !persistenceContextRef.getPersistenceContextType().equals(GerPersistenceContextTypeType.EXTENDED);
-            GerPropertyType[] propertyTypes = persistenceContextRef.getPropertyArray();
+        List<PersistenceContextRefType> specPersistenceContextRefsUntyped = convert(specDD.selectChildren(PERSISTENCE_CONTEXT_REF_QNAME_SET),
JEE_CONVERTER, PersistenceContextRefType.class, PersistenceContextRefType.type);
+        Map<String, GerPersistenceContextRefType> gerPersistenceContextRefsUntyped
= getGerPersistenceContextRefs(plan);
+        for (PersistenceContextRefType persistenceContextRef : specPersistenceContextRefsUntyped)
{
+            String persistenceContextRefName = persistenceContextRef.getPersistenceContextRefName().getStringValue().trim();
+
+            boolean transactionScoped = !persistenceContextRef.getPersistenceContextType().getStringValue().equals("extended");
+
+            PropertyType[] propertyTypes = persistenceContextRef.getPersistencePropertyArray();
             Map properties = new HashMap();
-            for (int j = 0; j < propertyTypes.length; j++) {
-                GerPropertyType propertyType = propertyTypes[j];
-                String key = propertyType.getKey();
-                String value = propertyType.getValue();
+            for (PropertyType propertyType : propertyTypes) {
+                String key = propertyType.getName().getStringValue();
+                String value = propertyType.getValue().getStringValue();
                 properties.put(key, value);
             }
 
-
-            Set interfaceTypes = Collections.singleton("org.apache.geronimo.persistence.PersistenceUnitGBean");
             AbstractNameQuery persistenceUnitNameQuery;
-            if (persistenceContextRef.isSetPersistenceUnitName()) {
-                String persistenceUnitName = persistenceContextRef.getPersistenceUnitName();
-                persistenceUnitNameQuery = new AbstractNameQuery(null, Collections.singletonMap("name",
persistenceUnitName), interfaceTypes);
+            GerPersistenceContextRefType gerPersistenceContextRef = gerPersistenceContextRefsUntyped.remove(persistenceContextRefName);
+            if (gerPersistenceContextRef != null) {
+                persistenceUnitNameQuery = findPersistenceUnit(gerPersistenceContextRef);
+                addProperties(gerPersistenceContextRef, properties);
+            } else if (persistenceContextRef.isSetPersistenceUnitName()) {
+                String persistenceUnitName = persistenceContextRef.getPersistenceUnitName().getStringValue().trim();
+                persistenceUnitNameQuery = new AbstractNameQuery(null, Collections.singletonMap("name",
persistenceUnitName), PERSISTENCE_UNIT_INTERFACE_TYPES);
             } else {
-                GerPatternType gbeanLocator = persistenceContextRef.getPattern();
+                persistenceUnitNameQuery = defaultPersistenceUnitAbstractNameQuery;
+            }
 
-                persistenceUnitNameQuery = buildAbstractNameQuery(gbeanLocator, null, null,
interfaceTypes);
+            try {
+                localConfiguration.findGBeanData(persistenceUnitNameQuery);
+            } catch (GBeanNotFoundException e) {
+                throw new DeploymentException("Could not resolve reference at deploy time
for query " + persistenceUnitNameQuery, e);
             }
 
+            PersistenceContextReference reference = new PersistenceContextReference(localConfiguration.getId(),
persistenceUnitNameQuery, transactionScoped, properties);
+
+            ((Map) componentContext.get(JNDI_KEY)).put(ENV + persistenceContextRefName, reference);
+
+        }
+
+        for (GerPersistenceContextRefType gerPersistenceContextRef : gerPersistenceContextRefsUntyped.values())
{
+            String persistenceContextRefName = gerPersistenceContextRef.getPersistenceContextRefName();
+            boolean transactionScoped = !gerPersistenceContextRef.getPersistenceContextType().equals(GerPersistenceContextTypeType.EXTENDED);
+            Map properties = new HashMap();
+            addProperties(gerPersistenceContextRef, properties);
+
+
+            AbstractNameQuery persistenceUnitNameQuery = findPersistenceUnit(gerPersistenceContextRef);
+
             try {
                 localConfiguration.findGBeanData(persistenceUnitNameQuery);
             } catch (GBeanNotFoundException e) {
@@ -100,13 +130,46 @@
         }
     }
 
+    private void addProperties(GerPersistenceContextRefType persistenceContextRef, Map properties)
{
+        GerPropertyType[] propertyTypes = persistenceContextRef.getPropertyArray();
+        for (GerPropertyType propertyType : propertyTypes) {
+            String key = propertyType.getKey();
+            String value = propertyType.getValue();
+            properties.put(key, value);
+        }
+    }
+
+    private Map<String, GerPersistenceContextRefType> getGerPersistenceContextRefs(XmlObject
plan) throws DeploymentException {
+        Map<String, GerPersistenceContextRefType> map = new HashMap<String, GerPersistenceContextRefType>();
+        if (plan != null) {
+            List<GerPersistenceContextRefType> refs = convert(plan.selectChildren(GER_PERSISTENCE_CONTEXT_REF_QNAME_SET),
NAMING_CONVERTER, GerPersistenceContextRefType.class, GerPersistenceContextRefType.type);
+            for (GerPersistenceContextRefType ref : refs) {
+                map.put(ref.getPersistenceContextRefName().trim(), ref);
+            }
+        }
+        return map;
+    }
+
+    private AbstractNameQuery findPersistenceUnit(GerPersistenceContextRefType persistenceContextRef)
{
+        AbstractNameQuery persistenceUnitNameQuery;
+        if (persistenceContextRef.isSetPersistenceUnitName()) {
+            String persistenceUnitName = persistenceContextRef.getPersistenceUnitName();
+            persistenceUnitNameQuery = new AbstractNameQuery(null, Collections.singletonMap("name",
persistenceUnitName), PERSISTENCE_UNIT_INTERFACE_TYPES);
+        } else {
+            GerPatternType gbeanLocator = persistenceContextRef.getPattern();
+
+            persistenceUnitNameQuery = buildAbstractNameQuery(gbeanLocator, null, null, PERSISTENCE_UNIT_INTERFACE_TYPES);
+        }
+        return persistenceUnitNameQuery;
+    }
+
     public QNameSet getSpecQNameSet() {
-        SchemaConversionUtils.registerNamespaceConversions(Collections.singletonMap(PERSISTENCE_CONTEXT_REF_QNAME.getLocalPart(),
new NamespaceElementConverter(PERSISTENCE_CONTEXT_REF_QNAME.getNamespaceURI())));
+        SchemaConversionUtils.registerNamespaceConversions(Collections.singletonMap(GER_PERSISTENCE_CONTEXT_REF_QNAME.getLocalPart(),
new NamespaceElementConverter(GER_PERSISTENCE_CONTEXT_REF_QNAME.getNamespaceURI())));
         return QNameSet.EMPTY;
     }
 
     public QNameSet getPlanQNameSet() {
-        return PERSISTENCE_CONTEXT_REF_QNAME_SET;
+        return GER_PERSISTENCE_CONTEXT_REF_QNAME_SET;
     }
 
     public static final GBeanInfo GBEAN_INFO;
@@ -114,8 +177,9 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(PersistenceContextRefBuilder.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+        infoBuilder.addAttribute("defaultPersistenceUnitAbstractNameQuery", AbstractNameQuery.class,
true, true);
 
-        infoBuilder.setConstructor(new String[] {"defaultEnvironment"});
+        infoBuilder.setConstructor(new String[]{"defaultEnvironment", "defaultPersistenceUnitAbstractNameQuery"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java?view=diff&rev=487775&r1=487774&r2=487775
==============================================================================
--- geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
Sat Dec 16 01:06:29 2006
@@ -72,13 +72,13 @@
     }
 
     public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException
{
-        List<PersistenceUnitRefType> specPersistenceUnitRefsUntyped = convert(specDD.selectChildren(PersistenceUnitRefBuilder.PERSISTENCE_UNIT_REF_QNAME_SET),
NAMING_CONVERTER, PersistenceUnitRefType.class, PersistenceUnitRefType.type);
+        List<PersistenceUnitRefType> specPersistenceUnitRefsUntyped = convert(specDD.selectChildren(PersistenceUnitRefBuilder.PERSISTENCE_UNIT_REF_QNAME_SET),
JEE_CONVERTER, PersistenceUnitRefType.class, PersistenceUnitRefType.type);
         Map<String, GerPersistenceUnitRefType> gerPersistenceUnitRefsUntyped = getGerPersistenceUnitRefs(plan);
         for (PersistenceUnitRefType PersistenceUnitRef: specPersistenceUnitRefsUntyped) {
             String persistenceUnitRefName = PersistenceUnitRef.getPersistenceUnitRefName().getStringValue().trim();
 
             AbstractNameQuery persistenceUnitNameQuery;
-            GerPersistenceUnitRefType gerPersistenceUnitRef = gerPersistenceUnitRefsUntyped.get(persistenceUnitRefName);
+            GerPersistenceUnitRefType gerPersistenceUnitRef = gerPersistenceUnitRefsUntyped.remove(persistenceUnitRefName);
             if (gerPersistenceUnitRef != null) {
                 persistenceUnitNameQuery = findPersistenceUnit(gerPersistenceUnitRef);
             } else if (PersistenceUnitRef.isSetPersistenceUnitName()) {

Modified: geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ear/src/test/java/org/apache/geronimo/testsuite/jpa/JPATest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ear/src/test/java/org/apache/geronimo/testsuite/jpa/JPATest.java?view=diff&rev=487775&r1=487774&r2=487775
==============================================================================
--- geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ear/src/test/java/org/apache/geronimo/testsuite/jpa/JPATest.java
(original)
+++ geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ear/src/test/java/org/apache/geronimo/testsuite/jpa/JPATest.java
Sat Dec 16 01:06:29 2006
@@ -36,7 +36,12 @@
         selenium.open("/jpa/servlet");
         selenium.waitForPageToLoad("30000");
         //assertEquals("Hello J2EE 1.4", selenium.getTitle());
-        assertEquals("TestServlet\nTest Servlet container managed entity manager test OK:
true\nTest Servlet app managed entity manager factory test OK: true", selenium.getText("xpath=/html/body"));
+        assertEquals("TestServlet\n" +
+                "Test EJB container managed entity manager test OK: true\n" +
+                "Test EJB app managed entity manager factory test OK: true\n" +
+                "Test servlet container managed entity manager test OK: true\n" +
+                "Test servlet app managed entity manager factory test OK: true\n" +
+                "commit OK", selenium.getText("xpath=/html/body"));
 
     }
 }

Modified: geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ejb/src/main/resources/META-INF/openejb-jar.xml?view=diff&rev=487775&r1=487774&r2=487775
==============================================================================
--- geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ejb/src/main/resources/META-INF/openejb-jar.xml
(original)
+++ geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-ejb/src/main/resources/META-INF/openejb-jar.xml
Sat Dec 16 01:06:29 2006
@@ -44,7 +44,7 @@
             <persistence-context-ref>
                 <persistence-context-ref-name>jpa/test</persistence-context-ref-name>
                 <persistence-unit-name>test-unit</persistence-unit-name>
-                <persistence-context-type>transaction-scoped</persistence-context-type>
+                <persistence-context-type>Transactional</persistence-context-type>
             </persistence-context-ref>
             <persistence-unit-ref>
                 <persistence-unit-ref-name>jpa/testEMF</persistence-unit-ref-name>

Modified: geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/java/org/apache/geronimo/itest/TestServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/java/org/apache/geronimo/itest/TestServlet.java?view=diff&rev=487775&r1=487774&r2=487775
==============================================================================
--- geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/java/org/apache/geronimo/itest/TestServlet.java
(original)
+++ geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/java/org/apache/geronimo/itest/TestServlet.java
Sat Dec 16 01:06:29 2006
@@ -27,6 +27,12 @@
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import javax.ejb.CreateException;
+import javax.transaction.UserTransaction;
+import javax.transaction.SystemException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.RollbackException;
 
 
 /**
@@ -42,17 +48,40 @@
         httpServletResponse.getOutputStream().print("TestServlet\n");
         try {
             InitialContext ctx = new InitialContext();
+
+            //test ejb access using geronimo plan refs
             TestSessionHome home = (TestSessionHome)ctx.lookup("java:comp/env/TestSession");
             boolean result = home.create().testEntityManager();
-            httpServletResponse.getOutputStream().print("Test Servlet container managed entity
manager test OK: " + result);
+            httpServletResponse.getOutputStream().print("Test EJB container managed entity
manager test OK: " + result);
             result = home.create().testEntityManagerFactory();
-            httpServletResponse.getOutputStream().print("\nTest Servlet app managed entity
manager factory test OK: " + result);
+            httpServletResponse.getOutputStream().print("\nTest EJB app managed entity manager
factory test OK: " + result);
+
+            //test servlet access using spec dd refs
+            TestSessionBean bean = new TestSessionBean();
+            UserTransaction ut = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
+            ut.begin();
+            result = bean.testEntityManager();
+            httpServletResponse.getOutputStream().print("\nTest servlet container managed
entity manager test OK: " + result);
+            result = bean.testEntityManagerFactory();
+            httpServletResponse.getOutputStream().print("\nTest servlet app managed entity
manager factory test OK: " + result);
+            ut.commit();
+            httpServletResponse.getOutputStream().print("\ncommit OK");
         } catch (NamingException e) {
             System.out.print("Exception:");
             e.printStackTrace();
         } catch (RemoteException e) {
             e.printStackTrace();
         } catch (CreateException e) {
+            e.printStackTrace();
+        } catch (SystemException e) {
+            e.printStackTrace();
+        } catch (NotSupportedException e) {
+            e.printStackTrace();
+        } catch (HeuristicMixedException e) {
+            e.printStackTrace();
+        } catch (HeuristicRollbackException e) {
+            e.printStackTrace();
+        } catch (RollbackException e) {
             e.printStackTrace();
         }
         httpServletResponse.flushBuffer();

Modified: geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/webapp/WEB-INF/web.xml?view=diff&rev=487775&r1=487774&r2=487775
==============================================================================
--- geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/trunk/testsuite/enterprise-testsuite/jpa-tests/jpa-war/src/main/webapp/WEB-INF/web.xml
Sat Dec 16 01:06:29 2006
@@ -16,10 +16,10 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 -->
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
-         version="2.4"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         version="2.5"
         >
 
     <display-name>Geronimo EJBRef Itest War</display-name>
@@ -42,6 +42,17 @@
         <home>org.apache.geronimo.itest.TestSessionHome</home>
         <remote>org.apache.geronimo.itest.TestSession</remote>
     </ejb-ref>
+
+    <persistence-context-ref>
+        <persistence-context-ref-name>jpa/test</persistence-context-ref-name>
+        <persistence-unit-name>test-unit</persistence-unit-name>
+        <persistence-context-type>Transactional</persistence-context-type>
+    </persistence-context-ref>
+    <persistence-unit-ref>
+        <persistence-unit-ref-name>jpa/testEMF</persistence-unit-ref-name>
+        <persistence-unit-name>test-unit</persistence-unit-name>
+    </persistence-unit-ref>
+
 
 <!--
     <security-constraint>



Mime
View raw message