Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup failed #1459

Closed
bugs-404 opened this issue Sep 11, 2017 · 6 comments
Closed

Startup failed #1459

bugs-404 opened this issue Sep 11, 2017 · 6 comments

Comments

@bugs-404
Copy link

Building java version: java 8
Runtime: java 8, tomcat 8.5

I built the activiti-6.0 with command mvn -T 1C clean install -DskipTests.

The build and test are OK.But after I deploied activiti-app.war I got following errors.

I also tried the official release war file which works fine.

08:40:31,991 [localhost-startStop-2] WARN org.springframework.web.context.support.AnnotationConfigWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapper': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.activiti.engine.IdentityService org.activiti.app.conf.Bootstrapper.identityService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityService' defined in class path resource [org/activiti/app/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.IdentityService]: Factory method 'identityService' threw exception; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.activiti.app.servlet.WebConfigurer.contextInitialized(WebConfigurer.java:62) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.activiti.engine.IdentityService org.activiti.app.conf.Bootstrapper.identityService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityService' defined in class path resource [org/activiti/app/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.IdentityService]: Factory method 'identityService' threw exception; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ... 24 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityService' defined in class path resource [org/activiti/app/conf/ActivitiEngineConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.IdentityService]: Factory method 'identityService' threw exception; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533) ... 26 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.activiti.engine.IdentityService]: Factory method 'identityService' threw exception; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ... 38 more Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at org.activiti.app.conf.ActivitiEngineConfiguration.processEngine(ActivitiEngineConfiguration.java:84) at org.activiti.app.conf.ActivitiEngineConfiguration.identityService(ActivitiEngineConfiguration.java:186) at org.activiti.app.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$c2d0f6a8.CGLIB$identityService$4(<generated>) at org.activiti.app.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$c2d0f6a8$$FastClassBySpringCGLIB$$75efd4fe.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309) at org.activiti.app.conf.ActivitiEngineConfiguration$$EnhancerBySpringCGLIB$$c2d0f6a8.identityService(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ... 39 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor$1.intercept(ConfigurationClassEnhancer.java:379) at org.activiti.spring.ProcessEngineFactoryBean$$EnhancerBySpringCGLIB$$4eb6ae3d.getObject(<generated>) at org.activiti.app.conf.ActivitiEngineConfiguration.processEngine(ActivitiEngineConfiguration.java:82) ... 50 more Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2270) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119) at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source) at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:257) at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:120) at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:69) at org.activiti.form.engine.FormEngineConfiguration.initMybatisConfiguration(FormEngineConfiguration.java:851) at org.activiti.form.engine.FormEngineConfiguration.initSqlSessionFactory(FormEngineConfiguration.java:839) at org.activiti.form.engine.FormEngineConfiguration.init(FormEngineConfiguration.java:395) at org.activiti.form.engine.FormEngineConfiguration.buildFormEngine(FormEngineConfiguration.java:375) at org.activiti.form.engine.configurator.FormEngineConfigurator.initFormEngine(FormEngineConfigurator.java:59) at org.activiti.form.engine.configurator.FormEngineConfigurator.beforeInit(FormEngineConfigurator.java:36) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.configuratorsBeforeInit(ProcessEngineConfigurationImpl.java:1419) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:683) at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:664) at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:65) at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:57) at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) ... 57 more Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)

@ryandawsonuk
Copy link
Contributor

Can you please specify which branch name you've checked out and whether you're running that command from the root directory of the project.

@daisuke-yoshimoto
Copy link
Contributor

@ryandawsonuk

java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

This error seems to be due to xerces.
https://stackoverflow.com/questions/10234201/appengine-error-java-lang-noclassdeffounderror-org-w3c-dom-elementtraversal

The jar of xerce contained in war is xercesImpl - 2.11.0.jar,
but the jar specified in the 6.0 - release branch is 2.10.0.
https://github.com/Activiti/Activiti/blob/6.0-release/pom.xml#L609

@ryandawsonuk
Copy link
Contributor

ryandawsonuk commented Sep 11, 2017

Sorry I misread and thought the error was on running the mvn command. I understand your point now that the released .war file doesn't seem to match the one you're seeing built from the source code branch from which it is meant to have been built.

However I'm not sure that xerces version in the .war is coming from the top-level pom version. What I've just done is go to modules/activiti-ui/activiti-app/target (in code checked out from 6.0-release) and delete my war and activiti-app dir there. I've then run 'mvn -T 1C clean install -DskipTests' from modules/activiti-ui and the war file that then gets built for me does contain the 2.11 version of xerces in its WEB-INF lib . Do you see the 2.10 version when you do the same?

@bugs-404
Copy link
Author

bugs-404 commented Sep 12, 2017

@ryandawsonuk

Can you please specify which branch name you've checked out

I downloaded the release tar package from link https://github.com/Activiti/Activiti/archive/activiti-6.0.0.tar.gz

whether you're running that command from the root directory of the project.

Yes,I did.


I found that if I replace the lib xml-apis-1.4.01.jar with the released .war file's lib xml-apis-1.4.01.jar,all work fine.

Perhaps there is something wrong with my mvn. But I don't know why.

My version: 1.2M 8 15 2016 xml-apis-1.4.01.jar.
Official released: 215K 9 12 09:29 xml-apis-1.4.01.jar

@bugs-404
Copy link
Author

All goes well after that I deleted /.m2/repository/xml-apis/xml-apis/1.4.01/ and let maven redownload xml-apis.

Thanks for your tips and research.@ryandawsonuk @daisuke-yoshimoto

@salaboy
Copy link
Contributor

salaboy commented Nov 28, 2017

@tianzk thanks for reporting back the fix. I'm closing this issue now

@salaboy salaboy closed this as completed Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants