cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I run my tests using nuxeo sdk 5.6

geekonspace
Star Contributor
Star Contributor

Hi, I developed several tests but those tests run with my sdk 5.5 but not with 5.6. This message is displayed in my console log:

11:24:20,634 INFO  [OSGiRuntimeService] Configuration: host application: null
11:24:20,929 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
11:24:20,958 INFO  [SchedulerSignalerImpl] Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
11:24:20,958 INFO  [QuartzScheduler] Quartz Scheduler v.null.null.null created.
11:24:20,960 INFO  [RAMJobStore] RAMJobStore initialized.
11:24:20,960 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
11:24:20,960 INFO  [StdSchedulerFactory] Quartz scheduler version: null.null.null
11:24:20,960 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
DatabaseHelper: Database used for VCS tests: org.nuxeo.ecm.core.storage.sql.DatabaseH2
11:24:21,716 ERROR [RepositorySettings] java.lang.ClassNotFoundException: org.h2.Driver
java.lang.ClassNotFoundException: org.h2.Driver
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at org.nuxeo.ecm.core.storage.sql.DatabaseH2.setUp(DatabaseH2.java:80)
	at org.nuxeo.ecm.core.storage.sql.DatabaseHelper.setUp(DatabaseHelper.java:154)
	at org.nuxeo.ecm.core.test.RepositorySettings.initialize(RepositorySettings.java:195)
	at org.nuxeo.ecm.core.test.CoreFeature.start(CoreFeature.java:74)
	at org.nuxeo.runtime.test.runner.FeaturesRunner.start(FeaturesRunner.java:198)
	at org.nuxeo.runtime.test.runner.FeaturesRunner.run(FeaturesRunner.java:257)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.jdt.internal.launching.LongCommandLineLauncher.main(LongCommandLineLauncher.java:43)
11:24:22,039 INFO  [OSGiRuntimeService] Nuxeo EP Started
======================================================================
= Component Loading Status: Pending: 0 / Unstarted: 0 / Total: 39
======================================================================
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/nuxeo-cap-5.6-tomcat-sdk/nxserver/lib/slf4j-log4j12-1.6.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/nuxeo-cap-5.6-tomcat-sdk/sdk/tests/slf4j-jdk14-1.5.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
11:24:22,245 ERROR [RepositorySettings] org.nuxeo.ecm.core.api.ClientException: Failed to load repository test
org.nuxeo.ecm.core.api.ClientException: Failed to load repository test
	at org.nuxeo.ecm.core.api.local.LocalSession.createSession(LocalSession.java:106)
	at org.nuxeo.ecm.core.api.local.LocalSession.getSession(LocalSession.java:171)
	at org.nuxeo.ecm.core.api.AbstractSession.connect(AbstractSession.java:234)
	at org.nuxeo.ecm.core.test.TestRepositoryHandler.openSession(TestRepositoryHandler.java:55)
	at org.nuxeo.ecm.core.test.RepositorySettings.openSessionAs(RepositorySettings.java:268)
	at org.nuxeo.ecm.core.test.RepositorySettings.createSession(RepositorySettings.java:245)
	at org.nuxeo.ecm.core.test.CoreFeature.initializeSession(CoreFeature.java:159)
	at org.nuxeo.ecm.core.test.CoreFeature.beforeRun(CoreFeature.java:86)
	at org.nuxeo.runtime.test.runner.FeaturesRunner.beforeRun(FeaturesRunner.java:165)
	at org.nuxeo.runtime.test.runner.FeaturesRunner.run(FeaturesRunner.java:261)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.jdt.internal.launching.LongCommandLineLauncher.main(LongCommandLineLauncher.java:43)
Caused by: java.lang.IllegalArgumentException: Repository not found: test
	at org.nuxeo.ecm.core.api.local.LocalSession.lookupRepository(LocalSession.java:147)
	at org.nuxeo.ecm.core.api.local.LocalSession.createSession(LocalSession.java:102)
	... 20 more
11:24:22,257 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutting down.
11:24:22,257 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED paused.
11:24:22,258 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED shutdown complete.

MY code:
@RunWith(FeaturesRunner.class)
@Features(CoreFeature.class)
@RepositoryConfig(type=BackendType.H2, user = "Administrator", init=DefaultRepositoryInit.class)
public class MyTest {
	@Inject FeaturesRunner runner;
	@Inject CoreSession session;
	
  @Test public void doMvelTest() throws ClientException {
	  assertNotNull(session);
      assertNotNull(session.getDocument(new PathRef("/default-domain")));
      
	  //test1
      DocumentModel ws3 = session.createDocumentModel("Workspace");
      //ws3.setPropertyValue("dc:title", "WS3");
      String[] fakeContributors = { "Administrator" };
      ws3.setPropertyValue("dc:contributors", fakeContributors);
      ws3.setPropertyValue("dc:creator", fakeContributors[0]);
      ws3.setPropertyValue("dc:creator", "Administrator");

your help would be greatly appreciated

1 REPLY 1

slacoin_Lacoin
Star Contributor
Star Contributor

The h2 is installed in the lib folder trough the mean of a template. I think that library wasn't installed in the lib folder when you've configured the SDK in your eclipse. Can you re-install the SDK in your eclipse and check if you still have the error ?

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.