Author: bvahdat
Date: Fri Oct  5 17:25:04 2012
New Revision: 1394668

URL: http://svn.apache.org/viewvc?rev=1394668&view=rev
Log:
The call for "super.doStart();" should be the first step and not the last one, 
so that there's a proper notNull-check for the context before we start using 
it.  

Modified:
    
camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java

Modified: 
camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java?rev=1394668&r1=1394667&r2=1394668&view=diff
==============================================================================
--- 
camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
 (original)
+++ 
camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaComponent.java
 Fri Oct  5 17:25:04 2012
@@ -77,6 +77,8 @@ public class JpaComponent extends Defaul
 
     @Override
     protected void doStart() throws Exception {
+        super.doStart();
+
         // lookup entity manager factory and use it if only one provided
         if (entityManagerFactory == null) {
             Map<String, EntityManagerFactory> map = 
getCamelContext().getRegistry().lookupByType(EntityManagerFactory.class);
@@ -130,7 +132,5 @@ public class JpaComponent extends Defaul
         if (transactionManager == null) {
             LOG.warn("No TransactionManager has been configured on this 
JpaComponent. Each JpaEndpoint will auto create their own 
JpaTransactionManager.");
         }
-
-        super.doStart();
     }
 }


Reply via email to