java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet - tomcat7

I am migrating my web application from Jboss 4.2 to tomcat 7 . After using the tomcat 7 i am facing the following exception.
java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:855)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1883)
at org.apache.catalina.startup.ContextConfig.getDefaultWebXmlFragment(ContextConfig.java:1469)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1246)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have tried to remove the catalina.jar (according to the solution given for the same exception)from the lib to solve the issue but it didn't worked.I am not getting any way to solve this issue can anyone please help on this issue.

In your pom.xml
if you have included dependencies like tomcat-catalina,
put the scope as provided
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>7.0.47</version>
<scope>provided</scope>
</dependency>
The container ( here tomcat ) itself provides some dependencies ( like tomcat-catalina jar ) when you deploy your app. So you don't need to include them in your application. But the jars are needed for compilation. This is achieved by setting the scope as 'provided'

I believe, this error is about the deployment assembly. You do not need the catalina.jar in the deployment assembly.

For the ones like me facing this issue with Spring Boot, adding this dependency solved it :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>

For me, this error was being produced because my derived implementation of ServletContextListener had a CONCTRUCTOR PARAMETER. Apparently Spring/Java/Whatever can't load it up if you have ctor params, even though the params have values in the Application Context.
Hope this helps others.

I had this problem today, and it was because my executable spring boot jar had /BOOT-INF/lib/tomcat-embed-core-9.0.62.jar and my deployed WAR also had ../ROOT/WEB-INF/lib/tomcat-embed-core-9.0.62.jar. The jars were identical, but the tomcat webapp classloader creates a ProtectionDomain for the jars provided from BOOT-INF, and my deployed WAR was attempting to load the class from ROOT/WEB-INF/lib.
The fix is to make sure my deployed WAR uses jars from BOOT-INF ... I just have to figure out how to make that happen.

add <scope>provided</scope> into pom.xml :
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>7.0.27</version>
<scope>provided</scope>
</dependency>

There is another solution when you do need the catalina.jar, add
<Loader delegate="true"/>
to
<Context />
element in %TOMCAT_HOME%/conf/context.xml

Related

Spring Boot Property Launcher + EhCache Failed to read schema document

I am working on a Spring Boot(2.3.0.RELEASE) project where there is a need to use a external loader to load few proprietary libraries. Hence we are using Spring's Property Launcher as follows,
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
<mainClass>com.app.Application</mainClass>
</configuration>
</plugin>
We also use Ehcache version 3.8.1 along with Spring's CacheAutoConfiguration.
The problem we are facing is, for some reason the ehcache schema xsd file is not visible to the classloader and it is failing with the below exception.
I have verified the xsd is present in the exact path that its failing on.
Caused by: org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'jar:file:/C:/workspace/poc/external-loader-poc/target/external-loader-poc.jar!/BOOT-INF/lib/ehcache-3.8.1.jar!/ehcache-core.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument1(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source) ~[na:1.8.0_251]
at javax.xml.validation.SchemaFactory.newSchema(Unknown Source) ~[na:1.8.0_251]
at javax.xml.validation.SchemaFactory.newSchema(Unknown Source) ~[na:1.8.0_251]
at org.ehcache.xml.ResourceConfigurationParser.<clinit>(ResourceConfigurationParser.java:67) ~[ehcache-3.8.1.jar!/:na]
... 58 common frames omitted
Caused by: java.io.FileNotFoundException: JAR entry BOOT-INF/lib/ehcache-3.8.1.jar!/ehcache-core.xsd not found in C:\workspace\poc\external-loader-poc\target\external-loader-poc.jar
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source) ~[na:1.8.0_251]
at sun.net.www.protocol.jar.JarURLConnection.getInputStream(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source) ~[na:1.8.0_251]
at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source) ~[na:1.8.0_251]
However this issue doesn't happen when using the JarLauncher or WarLauncher. It only happens with the PropertyLauncher.
Any suggestions would be of great help.
I had the same issue. I was using SpringBoot 2.3.0.RELEASE with ehcache 3. Just upgraded to Spring boot 2.3.2.RELEASE. The issue resolved. If possible try upgrading the SpringBoot.
I was facing the same issue. I was using SpringBoot 2.5.13 with ehcache 3.9.7.
It seems that as per ehcache 3.x release, either only the new version should be used or the javax.cache API as defined in the JSR-107 specification (more details on https://www.ehcache.org/#using_jsr107_api).
Removing the following from my pom.xml helped resolve the issue
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.1.0</version>
</dependency>

java.lang.NoClassDefFoundError: org/springframework/orm/hibernate5/HibernateTransactionManager

I am trying to integrate spring with hibernate and I have spring-orm .4.3.6 jar file in my project.But still I am getting below error :
java.lang.NoClassDefFoundError: org/springframework/orm/hibernate5/HibernateTransactionManager
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:570)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:697)
Tried googling it.But did not find answer.
Can someone help?
This class is coming out of the spring-orm dependency (notice the hibernate5 package in there. There is equally hibernate3 and hibernate4 packages in the same jar not to break compatibility).
The Maven Coordinates are:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.10.RELEASE</version>
</dependency>

Failed to scan some Jars from classloader hierarchy

I'm using Spring Boot 2.0.0.M2 and Vaadin 8.1.0.rc1 in my project. Since I need to use custom widgets, I've added vaadin-client-compiler dependency to my project. The first weird thing that happened was that embedded Tomcat become replaced by embedded Jetty automatically. The second problem was that I've started to get warnings like this one during application initialization:
2017-08-01 11:07:27.822 WARN 1012 --- [ main] o.a.tomcat.util.scan.StandardJarScanner : Failed to scan [file:/Users/mac/.m2/repository/com/vaadin/vaadin-sass-compiler/0.9.13/sac-1.3.jar] from classloader hierarchy
java.io.FileNotFoundException: /Users/mac/.m2/repository/com/vaadin/vaadin-sass-compiler/0.9.13/sac-1.3.jar (No such file or directory)
at java.util.zip.ZipFile.open(Native Method) ~[na:1.8.0_101]
at java.util.zip.ZipFile.<init>(ZipFile.java:219) ~[na:1.8.0_101]
at java.util.zip.ZipFile.<init>(ZipFile.java:149) ~[na:1.8.0_101]
at java.util.jar.JarFile.<init>(JarFile.java:166) ~[na:1.8.0_101]
at java.util.jar.JarFile.<init>(JarFile.java:130) ~[na:1.8.0_101]
at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:60) ~[tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:43) ~[tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:327) ~[tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:277) ~[tomcat-embed-core-8.5.5.jar:8.5.5]
at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262) [apache-jsp-8.5.9.1.jar:2.3]
at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:104) [apache-jsp-8.5.9.1.jar:2.3]
at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:101) [apache-jsp-8.5.9.1.jar:2.3]
at org.springframework.boot.web.embedded.jetty.JasperInitializer.doStart(JasperInitializer.java:91) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131) [jetty-util-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105) [jetty-util-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) [jetty-server-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:120) [jetty-server-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:844) [jetty-server-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344) [jetty-servlet-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1501) [jetty-webapp-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1463) [jetty-webapp-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785) [jetty-server-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261) [jetty-servlet-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545) [jetty-webapp-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131) [jetty-util-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.server.Server.start(Server.java:452) [jetty-server-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105) [jetty-util-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113) [jetty-server-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.server.Server.doStart(Server.java:419) [jetty-server-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.4.6.v20170531.jar:9.4.6.v20170531]
at org.springframework.boot.web.embedded.jetty.JettyWebServer.initialize(JettyWebServer.java:103) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.web.embedded.jetty.JettyWebServer.<init>(JettyWebServer.java:81) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getJettyWebServer(JettyServletWebServerFactory.java:537) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getWebServer(JettyServletWebServerFactory.java:175) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:161) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:134) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536) [spring-context-5.0.0.RC2.jar:5.0.0.RC2]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:122) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M2.jar:2.0.0.M2]
Still application worked properly: I just wanted to get rid of these warnings. So I've decided to set back Tomcat instead of Jetty and excluded Jetty like this:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<version>${vaadin.version}</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</exclusion>
</exclusions>
</dependency>
After it was done, warnings haven't disappeared, but have changed a bit:
java.io.FileNotFoundException: /Users/mac/.m2/repository/com/vaadin/vaadin-sass-compiler/0.9.13/sac-1.3.jar (No such file or directory)
at java.util.zip.ZipFile.open(Native Method) ~[na:1.8.0_101]
at java.util.zip.ZipFile.<init>(ZipFile.java:219) ~[na:1.8.0_101]
at java.util.zip.ZipFile.<init>(ZipFile.java:149) ~[na:1.8.0_101]
at java.util.jar.JarFile.<init>(JarFile.java:166) ~[na:1.8.0_101]
at java.util.jar.JarFile.<init>(JarFile.java:130) ~[na:1.8.0_101]
at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:60) ~[tomcat-embed-core-8.5.15.jar:8.5.15]
at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49) ~[tomcat-embed-core-8.5.15.jar:8.5.15]
at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:338) ~[tomcat-embed-core-8.5.15.jar:8.5.15]
at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:288) ~[tomcat-embed-core-8.5.15.jar:8.5.15]
at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262) [apache-jsp-8.5.9.1.jar:2.3]
at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:104) [apache-jsp-8.5.9.1.jar:2.3]
at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:101) [apache-jsp-8.5.9.1.jar:2.3]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196) [tomcat-embed-core-8.5.15.jar:8.5.15]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.15.jar:8.5.15]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) [tomcat-embed-core-8.5.15.jar:8.5.15]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.5.15.jar:8.5.15]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_101]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
I've found a thread on Vaadin forum suggesting to use 8.0.32 version of Tomcat to fix it. When I switched to it, application stopped working at all:
Caused by: java.lang.ClassNotFoundException: org.apache.juli.WebappProperties
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 29 more
Then I've found some other thread suggesting to use Tomcat 8.5.5 as it has some fix (can't remember the URL of a thread). I've tried 8.5.5: warnings came back. Then I've also tried 8.5.19 and even 9.0.0.M25 with the same result.
So where is the problem: Spring, Tomcat, Vaadin or Maven dependencies versioning? And how do I solve it? These warnings don't fail the application, but I don't want them to appear in my startup log.
UPDATE
Here is my POM, Application-class and full mvn spring-boot:run output: https://gist.github.com/dtitov/ce9c098c8aa64073b3a22d2178f9aac7
Disclaimer: Probably this would be better suited as a comment but it does not fit the space.
1) You can use the stable Vaadin 8.1.0 and vaadin-spring-boot-starter 2.0.1. The Vaadin module versions are managed by the vaadin-bom (${vaadin.version} is a property in my pom and has a value of 8.1.0):
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
After this, you won't need to change their versions each time you change your Vaadin version (unless you really need to use a specific version):
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
</dependency>
2) You should use the same vaadin-maven-plugin as your Vaadin version to avoid widgetset version mismatches/issues. You're using Vaadin 8.1.0 but the plugin version is 8.0.6. You can use <version>${vaadin.version}</version> to sync them.
3) As per the docs, vaadin-client-compiler is used only at compile time and should not be deployed with your application:
vaadin-client-compiler-8.x.x.jar
The Vaadin Client Compiler is a Java-to-JavaScript compiler that allows building client-side modules, such as the Client-Side Engine (widget set) required for server-side applications. The compiler is needed, for example, for compiling add-on components to the application widget set, as described in "Using Vaadin Add-ons".
For detailed information regarding the compiler, see "Compiling a Client-Side Module". Note that you should not deploy this library with a web application.
You can add <scope>provided</scope> to the dependency and that should probably fix your tomcat issue.
Important edit: I've checked the logs and it looks like you don't even need it in your classpath for your widgetset. The vaadin-maven-plugin uses it to compile your widgetset behind the curtain:
[INFO] --- vaadin-maven-plugin:8.1.0:compile (default) # test ---
[INFO] Using com.vaadin:vaadin-client-compiler version 8.1.0
[INFO] Compiling module MyCustomWidgetSet
[INFO] Computing all possible rebind results for 'com.vaadin.client.metadata.ConnectorBundleLoader'
...
After removing it, everything went as expected. Not entirely sure, but it's possible that it's required only for certain add-ons or the vaadin-maven-plugin. I didn't need to write any so far, so perhaps someone that has actually required it could provide more insight.
4) You can also remove vaadin-client-compiled as per the same docs suggestion.
Generally, for other libraries, it can help to disable the scan of manifest in the jar(s) referencing weired Class-Path. Refers to Disable scanManifest of Jar Scan in tomcat embed in spring boot for details (use precise enough filters).

integrating spring and wso2 identity server remote client

I am trying to integrate spring and wso2 identity server remote client
but I am facing some dependency issues
My POM
<dependency>
<groupId>org.wso2.carbon.identity.user.ws</groupId>
<artifactId>org.wso2.carbon.um.ws.api.stub</artifactId>
<version>5.1.3</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.user.ws</groupId>
<artifactId>org.wso2.carbon.um.ws.api</artifactId>
<version>5.1.3</version>
</dependency>
<dependency>
<groupId>org.apache.axis2.wso2</groupId>
<artifactId>axis2</artifactId>
<version>1.6.1.wso2v12</version>
</dependency>
While running I am getting below exception:
Caused by: java.util.zip.ZipException: invalid stored block lengths
at java.util.zip.InflaterInputStream.read(Unknown Source)
at org.springframework.boot.loader.jar.ZipInflaterInputStream.read(ZipIn
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.util.ServiceLoader.parseLine(Unknown Source)
... 52 common frames omitted
And while building thorugh maven I am getting below error:
error reading repository \org\wso2\securev
ault\org.wso2.securevault\1.0.0-wso2v2\org.wso2.securevault-1.0.0-wso2v2

com.twelvemonkeys.servlet.image.IIOProviderContextListener

I am using maven to build project which deploys on the tomcat server. The build process completed successfully but when i am trying to deploy the project on tomcat 7 its throwing error.
I can see the twelemonkey-servlet.jar is present in the lib folder in WEB-INF.
pom.xml
<repository>
<id>project.local</id>
<name>project</name>
<url>file://${project.basedir}/repo</url>
</repository>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-metadata</artifactId>
<version>3.06</version>
</dependency>
<dependency>
<groupId>com.twelvemonkeys</groupId>
<artifactId>twelvemonkeys-servlet</artifactId>
<version>3.08</version>
</dependency>
The build is successful but while deployment i am getting following exception
SEVERE: Error configuring application listener of class org.apache.catalina.deploy.ApplicationListener#386d4852
java.lang.ClassNotFoundException: com.twelvemonkeys.servlet.image.IIOProviderContextListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
please suggest solution if someone faced this problem before.
Late answer, but I had the same problem today. I noticed the artifactId for the twelvemonkeys servlet has changed since version 3. Using the dependency below, it works for me.
<dependency>
<groupId>com.twelvemonkeys.servlet</groupId>
<artifactId>servlet</artifactId>
<version>3.1.2</version>
</dependency>

Resources