JUnit fails due to ClassNotFoundException de.hybris.platform.licence.DefaultLice

如果hybris报如下,
Exception in thread "main" java.lang.NoClassDefFoundError: de/hybris/platform/licence/DefaultLicence
    at de.hybris.platform.util.Utilities.checkLicence(Utilities.java:2701)
    at de.hybris.platform.core.Registry.activateMasterTenant(Registry.java:404)
    at de.hybris.platform.core.Registry.activateMasterTenant(Registry.java:398)
    at de.hybris.platform.util.Utilities.setJUnitTenant(Utilities.java:1625)
    at de.hybris.platform.testframework.runlistener.PlatformRunListener.testRunStarted(PlatformRunListener.java:43)
    at de.hybris.platform.testframework.ChainingRunNotifierWrapper$1.notifyListener(ChainingRunNotifierWrapper.java:97)
    at de.hybris.platform.testframework.ChainingRunNotifierWrapper$SafeNotifier.run(ChainingRunNotifierWrapper.java:239)
    at de.hybris.platform.testframework.ChainingRunNotifierWrapper.fireTestRunStarted(ChainingRunNotifierWrapper.java:99)
    at de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:117)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
Caused by: java.lang.ClassNotFoundException: de.hybris.platform.licence.DefaultLicence
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 13 more



More likely you haven't properly configured config project in your IDE. It should contain hybrislicense.jar file in it's dependencies. Also make sure that platform project depends on config project.

你可能感兴趣的:(JUnit fails due to ClassNotFoundException de.hybris.platform.licence.DefaultLice)