incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cummi...@apache.org
Subject svn commit: r1003055 - in /incubator/aries/trunk/samples-sandbox/words-sample: demoscript.html words-jpa/src/META-INF/persistence.xml
Date Thu, 30 Sep 2010 13:12:37 GMT
Author: cumminsh
Date: Thu Sep 30 13:12:37 2010
New Revision: 1003055

URL: http://svn.apache.org/viewvc?rev=1003055&view=rev
Log:
ARIES-422: Further minor improvements to instructions based on recent demo. 

Modified:
    incubator/aries/trunk/samples-sandbox/words-sample/demoscript.html
    incubator/aries/trunk/samples-sandbox/words-sample/words-jpa/src/META-INF/persistence.xml

Modified: incubator/aries/trunk/samples-sandbox/words-sample/demoscript.html
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples-sandbox/words-sample/demoscript.html?rev=1003055&r1=1003054&r2=1003055&view=diff
==============================================================================
--- incubator/aries/trunk/samples-sandbox/words-sample/demoscript.html (original)
+++ incubator/aries/trunk/samples-sandbox/words-sample/demoscript.html Thu Sep 30 13:12:37
2010
@@ -86,6 +86,7 @@ of the rest of the text of this document
 for a demo.</p>
 
 <h2>Pre-demo set-up</h2>
+
 <h3>Assembly set-up</h3>
 
 This should be done before starting the demo. Build the words-assembly
@@ -103,6 +104,13 @@ with using the ctrl-space content assist
 - it will speed the process of producing the code and xml up considerably.
 </p>
 
+<h4>Setting ${java_home}</h4>
+
+
+<p>You'll need to add a variable called java_home. Go to <b>Window&rarr;Preferences&rarr;Run/debug&rarr;String
substitution</b> and add
+a variable called java_home which points to your java home.
+</p>
+
 <h3>Database set-up</h3>
 
 <p>The database will be automatically created when the words-assembly build is run.

@@ -196,9 +204,7 @@ as follows:</p>
 <p class="field">-cp ${target_home}/openjpa-all-2.0.0.jar:${build_project}/src org.apache.openjpa.enhance.PCEnhancer
${build_files}</p>
 
 
-(Here [your_java_home] should be 
-your Java 6 installation, and [your_openJPA_home]  the root of the OpenJPA download. The
other two
-variables will be filled in by eclipse when the enhancer builder run.)
+(The variables will be filled in by eclipse when the enhancer builder run.)
 </p>
 
 <h3>JPA library</h3>
@@ -687,7 +693,7 @@ Navigate to the manifest and add an impo
 <p class="instruction">
 Expand the newly created project, expand JPA content, and
 open persistence.xml. On the general tab, make sure the Association
-class is on the list of managed classes, and make sure 'exclude unlisted classes' is selected.
+class is on the list of managed classes, and <emph>you must make sure</emph>
'exclude unlisted classes' is selected.
 Navigate to the Connection tab and fill in the following (as a JTA data source):
 </p>
 <p class="field">aries:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/wordsdb)
@@ -763,8 +769,8 @@ and generate a setter (but no getter).</
 </p>
 
 <p class="code">
-    public void setEntityManager(EntityManager em) {
-      this.entityManager = em;
+    public void setEntityManager(EntityManager entityManager) {
+      this.entityManager = entityManager;
     }
 </p>
 
@@ -778,21 +784,21 @@ the logic to handle persisting our data.
 using the <span class="template">recordAssociation</span> template.
 </p>
 
-<p class="code">		Association found = em.find(Association.class, word);
+<p class="code">		Association found = entityManager.find(Association.class, word);
 		if (found != null) {
 			found.setAssociated(association);
 		} else {
 			Association a = new Association();
 			a.setWord(word);
 			a.setAssociated(association);
-			em.persist(a);
+			entityManager.persist(a);
 		}
 </p>
 
 <p class="instruction">and getLastAssociation() using the <span class="template">getLastAssociation</span>
template
 </p>
 
-<p class="code">		Association found = em.find(Association.class, word);
+<p class="code">		Association found = entityManager.find(Association.class, word);
 		if (found != null) {
 			return found.getAssociated();
 		} else {
@@ -881,9 +887,16 @@ To resolve, make sure the OpenJPA plugin
 <li>""nonfatal general error: org.apache.openjpa.persistence.PersistenceException:
Error extracting class information from "bundleresource://43.fwk1934652240/"." This error
is 
 caused by forgetting the following line from the persistence.xml (also available as checkbox
on the General tab):		
 <p class="xml">&lt;exclude-unlisted-classes&gt;true&lt;/exclude-unlisted-classes&gt;
-
+<li>Forgetting to explicitly exclude unlisted classes can also cause the following
runtime error:
+<p class="code">&lt;openjpa-2.0.0-r422266:935683 nonfatal general error&gt;
org.apache.openjpa.persistence.PersistenceException: Error extracting class information from
"bundleresource://42.fwk1060257586/".
+	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:208)
+	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
 </p>
+<To resolve, make  the following line is in the persistence.xml (also available as checkbox
on the General tab):		
+<p class="xml">&lt;exclude-unlisted-classes&gt;true&lt;/exclude-unlisted-classes&gt;
 
+</p>
+</li>
 
 <li>Using the OpenJPA entity enhancement Eclipse plugin. The OpenJPA provide a plugin
for Eclipse which 
 automatically enhances entities, but it doesn't work very well, probably because it's

Modified: incubator/aries/trunk/samples-sandbox/words-sample/words-jpa/src/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples-sandbox/words-sample/words-jpa/src/META-INF/persistence.xml?rev=1003055&r1=1003054&r2=1003055&view=diff
==============================================================================
--- incubator/aries/trunk/samples-sandbox/words-sample/words-jpa/src/META-INF/persistence.xml
(original)
+++ incubator/aries/trunk/samples-sandbox/words-sample/words-jpa/src/META-INF/persistence.xml
Thu Sep 30 13:12:37 2010
@@ -1,11 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<persistence version="2.0"
-	xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
-	<persistence-unit name="words-jpa" transaction-type="JTA">
+<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+	<persistence-unit name="words-jpa">
 		<jta-data-source>aries:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/wordsdb)</jta-data-source>
 		<class>org.apache.words.jpa.Association</class>
-		<exclude-unlisted-classes>true</exclude-unlisted-classes>
-		<properties/>
 	</persistence-unit>
 </persistence>



Mime
View raw message