2016-10-04 50 views
0

我使用jdk 1.8在hybris 5.5.1上關注wiki hybris core trails。對於我來說,一切都很好,但我無法執行該測試中給出的任何測試case。無論什麼時候我嘗試運行任何測試類的junit測試,我會得到以下異常: -上下文hybris全局上下文工廠無法正確創建,由於,錯誤創建名爲'marshaller'的bean

org.springframework.beans.FatalBeanException:上下文hybris全局上下文工廠無法正確創建,因爲,創建bean with名稱'marshaller':調用init方法失敗;嵌套的異常是org.springframework.oxm.UncategorizedMappingException:未知的JAXB異常;嵌套異常是javax.xml.bind.JAXBException:無法實例化供應商com.sun.xml.internal.bind.v2.ContextFactory:javax.xml.bind.JAXBException:「de.hybris.platform.cuppy.ws。 openligadb.types」犯規含有ObjectFactory.class或jaxb.in​​dex - 帶鏈接的異常:

這裏是堆棧跟蹤我得到我的控制檯上就例外: -

[0; 32mINFO [主]( junit)[HybrisContextFactory]加載<>位於(global-cuppy-spring.xml,cuppy-ws-spring.xml)中的來自擴展名(cuppy)的spring config採用:(63.76 ms) [m [0; 33mWARN [main] (junit)[CloseAwareApplicationContext]在上下文初始化期間遇到異常 - 取消刷新嘗試 [morg.springframework.beans.factory.BeanCreationException:使用名稱'marshaller'創建bean時出錯:init方法的調用失敗;嵌套的異常是org.springframework.oxm.UncategorizedMappingException:未知的JAXB異常;嵌套異常是javax.xml.bind.JAXBException:無法實例化供應商com.sun.xml.internal.bind.v2.ContextFactory:javax.xml.bind.JAXBException:「de.hybris.platform.cuppy.ws.openligadb .types「不包含ObjectFactory.class或jaxb.in​​dex - 帶有鏈接的異常: [javax.xml.bind.JAXBException:」de.hybris.platform.cuppy.ws.openligadb.types「不包含ObjectFactory.class或jaxb.in​​dex] 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566) 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFact ory.java:476) 在org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:303) 在org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230 ) 在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) 在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) 在org.springframework .beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.Abstra在de.hybris.platform.core.HybrisContextFactory的$ de.hybris.platform.core.HybrisContextFactory.refreshContext(HybrisContextFactory.java:98) $ GlobalContextFactory.build(HybrisContextFactory.java: 176) 在de.hybris.platform.core.HybrisContextHolder.getGlobalInstanceCached(HybrisContextHolder.java:134) 在de.hybris.platform.core.HybrisContextHolder.getGlobalInstance(HybrisContextHolder.java:113) 在de.hybris.platform。 core.Registry.getSingletonGlobalApplicationContext(註冊表。的java:1059) 在de.hybris.platform.cache.impl.RegionCacheAdapter.getController(RegionCacheAdapter.java:75) 在de.hybris.platform.cache.impl.RegionCacheAdapter.getOrAddUnit(RegionCacheAdapter.java:205) 在de.hybris.platform.cache.AbstractCacheUnit.get(AbstractCacheUnit.java:180) at de.hybris.platform處的de.hybris.platform.persistence.type.ComposedType_HJMPWrapper $ FindAll0FinderResult.getFinderResult(ComposedType_HJMPWrapper.java:1543) 。 persistence.type.ComposedType_HJMPWrapper.ejbFindAll(ComposedType_HJMPWrapper.java:1598) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本機方法) 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在sun.reflect.DelegatingMethodAccessorImpl .invoke(DelegatingMethod AccessorImpl.java:43) at de.hybris.de.hybris.platform.util.Utilities.callMethod(Utilities.java:1069) de.hybris處的java.lang.reflect.Method.invoke(Method.java:497) 。 platform.util.Utilities.callMethod(Utilities.java:1059) at de.hybris.platform.persistence.framework.HomeInvocationHandler.invoke(HomeInvocationHandler.java:93) at com.sun.proxy。$ Proxy15.findAll(Unknown源) at de.hybris.platform.persistence.type.TypeManagerEJB.getAllItemTypes(TypeManagerEJB.java:177) at de.hybris.platform.persistence.property.DBPersistenceManager.loadAllTypes(DBPersistenceManager.java:631) at de。 hybris.platform.persistence.property.DBPersistenceManager.loadPersistenceInfosInternalInTX(DBPersistenceManager.java:614) at de。 hybris.platform.persistence.property.DBPersistenceManager.loadPersistenceInfosSafe(DBPersistenceManager.java:569) at de.hybris.platform.persistence.property.DBPersistenceManager.loadPersistenceInfos(DBPersistenceManager.java:539) at de.hybris.platform.core。 Abstract dent.doStartupSafe(AbstractTenant.java:702) at de.hybris.platform.core.AbstractTenant.doStartUp(AbstractTenant.java:656) at de.hybris.platform.core.Registry.assureTenantStarted(Registry.java:639) at de.hybris.platform.core.Registry.activateTenant(Registry.java:700) at de.hybris.platform.util的de.hybris.platform.core.Registry.setCurrentTenant(Registry.java:544) 。 Utilities.setJUnitTenant(Utilities.java:1472) at de.hybris.platform.testframework.runlistener.PlatformRu nListener.testRunStarted(PlatformRunListener.java:44) 在de.hybris.platform.testframework.ChainingRunNotifierWrapper $ 1.notifyListener(ChainingRunNotifierWrapper.java:97) 在de.hybris.platform.testframework.ChainingRunNotifierWrapper $ SafeNotifier.run(ChainingRunNotifierWrapper.java :239) 在de.hybris.platform.testframework.ChainingRunNotifierWrapper.fireTestRunStarted(ChainingRunNotifierWrapper.java:99) 在de.hybris.platform.testframework.HybrisJUnit4ClassRunner.run(HybrisJUnit4ClassRunner.java:124) 在org.eclipse.jdt .internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal .junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java: 459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 引起:org.springframework.oxm.UncategorizedMappingException:未知的JAXB異常;嵌套異常是javax.xml.bind.JAXBException:無法實例化供應商com.sun.xml.internal.bind.v2.ContextFactory:javax.xml.bind.JAXBException:「de.hybris.platform.cuppy.ws.openligadb .types「不包含ObjectFactory.class或jaxb.in​​dex - 帶有鏈接的異常: [javax.xml.bind.JAXBException:」de.hybris.platform.cuppy.ws.openligadb.types「不包含ObjectFactory.class或jaxb 。指數] 在org.springframework.oxm.jaxb.Jaxb2Marshaller.convertJaxbException(Jaxb2Marshaller.java:888) 在org.springframework.oxm.jaxb.Jaxb2Marshaller.getJaxbContext(Jaxb2Marshaller.java:463) 在org.springframework.oxm。 jaxb.Jaxb2Marshaller.afterPropertiesSet(Jaxb2Marshaller.java:435) 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625) 在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean( AbstractAutowireCapableBeanFactory.java:1562) ...

回答

0

初始化Junit的租戶:

ant yunitinit 
+0

如果該螞蟻目標不再存在(它已在最近的某個版本中被刪除),您還可以執行 「ant initialize -Dtenant = junit」來初始化junit tenant – Sebastian

+0

它在V6下仍然可用,何時刪除? –

+0

剛剛檢查它也可在V6.1 –

0

嘗試在'運行配置'中添加cuppy classes文件夾。 ObjectFactory.class在那裏生成。

相關問題