This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch dev/2.0.0-M2
in repository https://gitbox.apache.org/repos/asf/isis.git

commit a89cb4ec41ca832b4139f3ed1e8cc67dfc644b13
Author: Andi Huber <ahu...@apache.org>
AuthorDate: Wed Nov 22 12:08:32 2017 +0100

    ISIS-1754 proper DN class-loading
---
 .../core/runtime/system/context/IsisContext.java   |  3 ++-
 .../DataNucleusApplicationComponents.java          | 27 +++++++++++-----------
 .../wicket/viewer/IsisWicketApplication.java       |  2 ++
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
index ee1cc1c..40929e2 100644
--- 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
+++ 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
@@ -48,7 +48,7 @@ public interface IsisContext {
                                ()->new IllegalStateException(
                                                "internal error: should have 
been populated by IsisSessionFactoryBuilder") );
        }
-       
+
        /**
         * 
         * @return Isis's default class loader
@@ -79,4 +79,5 @@ public interface IsisContext {
        clear();
     }
 
+
 }
diff --git 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
index a68ce06..8fafca8 100644
--- 
a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
+++ 
b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/DataNucleusApplicationComponents.java
@@ -25,26 +25,26 @@ import java.util.Set;
 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManagerFactory;
 
-import com.google.common.base.Joiner;
-import com.google.common.collect.Maps;
-
-import org.datanucleus.PersistenceNucleusContext;
-import org.datanucleus.PropertyNames;
-import org.datanucleus.api.jdo.JDOPersistenceManagerFactory;
-import org.datanucleus.metadata.MetaDataListener;
-import org.datanucleus.metadata.MetaDataManager;
-import org.datanucleus.store.StoreManager;
-import org.datanucleus.store.schema.SchemaAwareStoreManager;
-
 import org.apache.isis.core.commons.components.ApplicationScopedComponent;
 import org.apache.isis.core.commons.config.IsisConfiguration;
 import org.apache.isis.core.commons.factory.InstanceUtil;
 import org.apache.isis.core.metamodel.spec.ObjectSpecification;
 import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
+import org.apache.isis.core.runtime.system.context.IsisContext;
 import 
org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata;
 import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPropertiesAware;
 import 
org.apache.isis.objectstore.jdo.metamodel.facets.object.query.JdoNamedQuery;
 import 
org.apache.isis.objectstore.jdo.metamodel.facets.object.query.JdoQueryFacet;
+import org.datanucleus.PersistenceNucleusContext;
+import org.datanucleus.PropertyNames;
+import org.datanucleus.api.jdo.JDOPersistenceManagerFactory;
+import org.datanucleus.metadata.MetaDataListener;
+import org.datanucleus.metadata.MetaDataManager;
+import org.datanucleus.store.StoreManager;
+import org.datanucleus.store.schema.SchemaAwareStoreManager;
+
+import com.google.common.base.Joiner;
+import com.google.common.collect.Maps;
 
 public class DataNucleusApplicationComponents implements 
ApplicationScopedComponent {
 
@@ -148,8 +148,9 @@ public class DataNucleusApplicationComponents implements 
ApplicationScopedCompon
                 
datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_TABLES, "true"); 
// but have DN do everything else...
                 
datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_COLUMNS, "true");
                 
datanucleusProps.put(PropertyNames.PROPERTY_SCHEMA_AUTOCREATE_CONSTRAINTS, 
"true");
-
-                persistenceManagerFactory = 
JDOHelper.getPersistenceManagerFactory(datanucleusProps);
+                
+                persistenceManagerFactory = JDOHelper
+                               .getPersistenceManagerFactory(datanucleusProps, 
IsisContext.getClassLoader() );
                 createSchema(persistenceManagerFactory, 
persistableClassNameSet, datanucleusProps);
 
             } else {
diff --git 
a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
 
b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
index ae3f78d..d249d68 100644
--- 
a/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
+++ 
b/core/viewer-wicket-impl/src/main/java/org/apache/isis/viewer/wicket/viewer/IsisWicketApplication.java
@@ -333,6 +333,8 @@ public class IsisWicketApplication
         List<Future<Object>> futures = null;
         try {
             super.init();
+            
+            IsisContext.setClassLoader(this.getClass().getClassLoader());
 
             futures = startBackgroundInitializationThreads();
 

-- 
To stop receiving notification emails like this one, please contact
ahu...@apache.org.

Reply via email to