我有一个playFramework2.4项目,当我使用" activator run"运行项目时它工作正常。
然而,当我分发" activator dist",然后运行应用程序时,它会出错。 我似乎有一些冲突的依赖关系,但我不知道为什么我在运行应用程序时看不到同样的问题。
org.springframework.beans.factory.BeanCreationException:错误 使用名称' MyService':Bean实例化来创建bean 构造函数失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:失败 实例化[org.apache.cxf.jaxws22.spring.JAXWS22SpringEndpointImpl]: 构造函数抛出异常;嵌套异常是 java.lang.NoClassDefFoundError: 组织/阿帕奇/ CXF /前端/ MethodDispatcher org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.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:755) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) org.springframework.context.support.ClassPathXmlApplicationContext。(ClassPathXmlApplicationContext.java:139) org.springframework.context.support.ClassPathXmlApplicationContext。(ClassPathXmlApplicationContext.java:83) global.Global.onStart(Global.java:89) play.core.j.JavaGlobalSettingsAdapter.onStart(JavaGlobalSettingsAdapter.scala:22) play.api.GlobalPlugin.onStart(GlobalSettings.scala:271) play.api.Play $$ anonfun $开始$ 1 $$ anonfun $ $应用MCV $ SP $ 1.适用(Play.scala:92) play.api.Play $$ anonfun $开始$ 1 $$ anonfun $ $应用MCV $ SP $ 1.适用(Play.scala:92) scala.collection.Iterator $ class.foreach(Iterator.scala:727) scala.collection.AbstractIterator.foreach(Iterator.scala:1157) scala.collection.IterableLike $ class.foreach(IterableLike.scala:72) play.api.Plugins.foreach(Plugins.scala:57) play.api.Play $$ anonfun $开始$ 1.适用$ MCV $ SP(Play.scala:92) play.api.Play $$ anonfun $开始$ 1.适用(Play.scala:87) play.api.Play $$ anonfun $开始$ 1.适用(Play.scala:87) play.utils.Threads $ .withContextClassLoader(Threads.scala:21) play.api.Play $。开始(Play.scala:87) play.core.server.DevServerStart $$ anonfun $ mainDev $ 1 $$不久$ 1 $$ anonfun $得到$ 1 $$ anonfun $ $申请1 $$ anonfun $ 1.适用(DevServerStart.scala:156) play.core.server.DevServerStart $$ anonfun $ mainDev $ 1 $$不久$ 1 $$ anonfun $得到$ 1 $$ anonfun $ $申请1 $$ anonfun $ 1.适用(DevServerStart.scala:121) scala.Option.map(Option.scala:145) play.core.server.DevServerStart $$ anonfun $ mainDev $ 1 $$不久$ 1 $$ anonfun $得到$ 1 $$ anonfun $ $适用1.适用(DevServerStart.scala:121) play.core.server.DevServerStart $$ anonfun $ mainDev $ 1 $$不久$ 1 $$ anonfun $得到$ 1 $$ anonfun $ $适用1.适用(DevServerStart.scala:119) scala.util.Success.flatMap(Try.scala:200) play.core.server.DevServerStart $$ anonfun $ mainDev $ 1 $$不久$ 1 $$ anonfun $得到$ 1.适用(DevServerStart.scala:119) play.core.server.DevServerStart $$ anonfun $ mainDev $ 1 $$不久$ 1 $$ anonfun $得到$ 1.适用(DevServerStart.scala:111) scala.concurrent.impl.Future $ PromiseCompletingRunnable.liftedTree1 $ 1(Future.scala:24) scala.concurrent.impl.Future $ PromiseCompletingRunnable.run(Future.scala:24) java.util.concurrent.ForkJoinTask $ RunnableExecuteAction.exec(ForkJoinTask.java:1402) java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) java.util.concurrent.ForkJoinPool $ WorkQueue.runTask(ForkJoinPool.java:1056) java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
答案 0 :(得分:0)
事实证明,当我调用activator dist时,我得到了其他一些导致冲突的依赖项。
最后,它找到了所有问题,然后进行了反复试验。
我使用sbt-dependency-graph来查看依赖项的来源,并使用响应here来排除某些冲突的依赖项。