Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

when ran sample it throws error #9

Closed
hellereye opened this issue Feb 15, 2014 · 4 comments
Closed

when ran sample it throws error #9

hellereye opened this issue Feb 15, 2014 · 4 comments

Comments

@hellereye
Copy link

I deploy sample into tomcat, it throws error

INFO - tartStop-1 - licationContextInitializer - Activating the default profile
within the application context.
ERROR - tartStop-1 - ContextLoader - Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Config
uration problem: URL must not be null
Offending resource: class path resource [META-INF/spring/persistence-infrastruct
ure-context.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.err
or(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
ontext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
ontext.java:76)
at org.springframework.data.repository.config.AbstractRepositoryConfigDe
finitionParser.handleError(AbstractRepositoryConfigDefinitionParser.java:158)
at org.springframework.data.repository.config.AbstractRepositoryConfigDe
finitionParser.parse(AbstractRepositoryConfigDefinitionParser.java:87)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(N
amespaceHandlerSupport.java:73)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseCustomElement(BeanDefinitionParserDelegate.java:1419)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseCustomElement(BeanDefinitionParserDelegate.java:1409)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe
rBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
at org.springframework.context.support.AbstractApplicationContext.obtain
FreshBeanFactory(AbstractApplicationContext.java:522)
at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:436)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebA
pplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationConte
xt(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitiali
zed(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:4738)
at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5158)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:70
2)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)

    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)

    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
  1. at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
  2.  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    

java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
15-Feb-2014 12:27:50.466 SEVERE [localhost-startStop-1] org.apache.catalina.core
.StandardContext.startInternal Error listenerStart
15-Feb-2014 12:27:50.610 INFO [localhost-startStop-1] org.apache.catalina.util.S
essionIdGenerator.createSecureRandom Creation of SecureRandom instance for sessi
on ID generation using [SHA1PRNG] took [127] milliseconds.
15-Feb-2014 12:27:50.613 SEVERE [localhost-startStop-1] org.apache.catalina.core
.StandardContext.startInternal Context [/axon-trader-webui-0.1-SNAPSHOT] startup
failed due to previous errors
WARN - tartStop-1 - XmlWebApplicationContext - Exception thrown from Applicat
ionListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c
all 'refresh' before multicasting events via the context: Root WebApplicationCon
text: startup date [Sat Feb 15 12:27:48 CST 2014]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApp
licationEventMulticaster(AbstractApplicationContext.java:337)
at org.springframework.context.support.AbstractApplicationContext.publis
hEvent(AbstractApplicationContext.java:324)
at org.springframework.context.support.AbstractApplicationContext.doClos
e(AbstractApplicationContext.java:1025)
at org.springframework.context.support.AbstractApplicationContext.close(
AbstractApplicationContext.java:988)
at org.springframework.web.context.ContextLoader.closeWebApplicationCont
ext(ContextLoader.java:556)
at org.springframework.web.context.ContextLoaderListener.contextDestroye
d(ContextLoaderListener.java:142)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext
.java:4779)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext
.java:5372)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:70
2)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)

    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)

    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
  1. at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
  2.  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    

java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
WARN - tartStop-1 - XmlWebApplicationContext - Exception thrown from Lifecycl
eProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refr
esh' before invoking lifecycle methods via the context: Root WebApplicationConte
xt: startup date [Sat Feb 15 12:27:48 CST 2014]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLif
ecycleProcessor(AbstractApplicationContext.java:350)
at org.springframework.context.support.AbstractApplicationContext.doClos
e(AbstractApplicationContext.java:1033)
at org.springframework.context.support.AbstractApplicationContext.close(
AbstractApplicationContext.java:988)
at org.springframework.web.context.ContextLoader.closeWebApplicationCont
ext(ContextLoader.java:556)
at org.springframework.web.context.ContextLoaderListener.contextDestroye
d(ContextLoaderListener.java:142)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext
.java:4779)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext
.java:5372)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:726)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:70
2)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697)

    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)

    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:
  1. at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
  2.  at java.util.concurrent.FutureTask.run(FutureTask.java:262)
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    

java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
15-Feb-2014 12:27:50.706 SEVERE [localhost-startStop-1] org.apache.catalina.load
er.WebappClassLoader.clearReferencesThreads The web application [/axon-trader-we
bui-0.1-SNAPSHOT] appears to have started a thread named [FileWatchdog] but has
failed to stop it. This is very likely to create a memory leak.

@abuijze
Copy link
Member

abuijze commented Feb 15, 2014

That's strange. It works fine, here.
Which War did you deploy? Did you build it from the master branch?

@hellereye
Copy link
Author

Thank you for your reply,
yes, I build it from the master branch and pass tests,I According to the user manual run this sample whit jetty ,it throw error,but error info display of incomplete (use command mvn jetty:run-war) ,so I deploy axon-trader-webui-0.1-SNAPSHOT.war to tomacat server .

Error info in jetty :
INFO - main - licationContextInitializer - Activating the default profile
within the application context.
WARN - main - ConfigurationFactory - No configuration found. Config
uring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Us
ers/Administrator/AppData/Local/Temp/Jetty_0_0_0_0_8080_axon.trader.webui.0.1.SN
APSHOT.war____j6j2nc/webapp/WEB-INF/lib/ehcache-core-2.2.0.jar!/ehcache-failsafe
.xml
ERROR - main - ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'portfolioCommandHandler': Injection of autowired dependencies failed; ne
sted exception is org.springframework.beans.factory.BeanCreationException: Could
not autowire method: public void org.axonframework.samples.trader.orders.comman
d.PortfolioCommandHandler.setRepository(org.axonframework.repository.Repository)
; nested exception is org.springframework.beans.factory.BeanCreationException: E
rror creating bean with name 'portfolioRepository': Initialization of bean faile
d; nested exception is org.springframework.beans.ConversionNotSupportedException
: Failed to convert property value of type 'net.sf.ehcache.jcache.JCache' to req
uired type 'javax.cache.Cache' for property 'cache'; nested exception is java.la
ng.IllegalStateException: Cannot convert value of type [net.sf.ehcache.jcache.JC
ache] to required type [javax.cache.Cache] for property 'cache': no matching edi
tors or conversion strategy found....

when inject 'portfolioCommandHandler' throw error

@abuijze
Copy link
Member

abuijze commented Feb 18, 2014

Hi,

there were some cache related issues. I have no idea why it worked on my workspace, but clearing the (workspace) caches allowed me to reproduce the issue.
Please pull in the latest changes on master (commit 4fbde16). That should fix the issue.

Cheers,

Allard

@hellereye
Copy link
Author

Yes it caused by the cache ,I had commented cache bean(in cqrs-infrastructure-context.xml) and all references ,it works ok;
Cheers,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants