0
Answered
Possible maven dependency clash
I get the following error when trying to run MyCollab community locally. I believe it is a dependency clash between javax-validation:validation-api:1.0.0.GA vs javax-validation:validation-api:1.1.0.Final
See stacktrace:
WARNING: Exception encountered during context initialization - cancelling refresh attempt
See stacktrace:
WARNING: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validator' defined in com.esofthead.mycollab.spring.ValidatorConfiguration: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
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.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:800)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:444)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1349)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1342)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:163)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:387)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:354)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.esofthead.mycollab.jetty.GenericServerRunner.execute(GenericServerRunner.java:162)
at com.esofthead.mycollab.jetty.GenericServerRunner.run(GenericServerRunner.java:117)
at com.esofthead.mycollab.jetty.CommunityServerRunner.main(CommunityServerRunner.java:41)
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:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:41)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
... 40 more
Caused by: java.lang.ClassNotFoundException: javax.validation.ParameterNameProvider
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Customer support service by UserEcho
Is this issue existing yet? I run the maven dependency tree mvn dependency:tree and I do not find the validation-api:1.0.0 GA. Anyway, we deal with this issue in the past, and the same library with different names cause us headache :)
Here is my result:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ mycollab-app-community ---
Thank you for your response. My guess is that it is a dependency issue but not 100% sure. In IntelliJ I do find 2 libraries, the 1.0.0.GA and the 1.1.0.Final. The javax/validation/ParameterNameProvider is not present in the 1.0.0.GA version but is in the 1.1.0.Final. That is why I think the system is loading the wrong library. I have not been able to determine which dependency has a dependency on 1.0.0.GA.
What steps do I need to take to create a mvn build for the product?
Thank you in advance,
I look forward to hearing from you.
Jacques
To create a MyCollab build (installer files for Windows, MacOS, Linux) you guys come to project mycollab-deployer-community and run mvn clean install -Dmaven.test.skip=true, if the process runs well it will create installer files in the target folder.
PS: the latest code in github has issue on UI library, the UI may layout not correct. We are fixing. For the stable enhance MyCollab for your purpose, you should wait for 1-2 days until our team do the regression tests and confirmed all functions are ok
Probably we will try to write more documents how to develop MyCollab in the coming weeks. Please stay tune.
Hai Nguyen
* Jetty 9.2 supports Java 7 and it causes this issue
* Jetty 9.3 does not support Java 7 and it does not cause this issue
We must downgrade to Jetty 9.2 to support Java 7 for the community users, and we are working around on this issue. Thank you for reporting this issue.
PS: we want to utilize Jetty 9.3 to support HTTP/2 and this issue makes us a lot of headache to separate the build between the community and cloud service :). I will mark this request as resolved when we release the new version.
Hai Nguyen