com.twelvemonkeys.servlet.image.IIOProviderContextListener - maven

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>

Related

Kafka Listener failed to start in spring project

In my spring project i am getting this error at server startup
Jun 28, 2020 3:54:53 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchMethodError: org.springframework.util.Assert.state(ZLjava/util/function/Supplier;)V
at org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.determineInferredType(MessagingMessageListenerAdapter.java:539)
at org.springframework.kafka.listener.adapter.MessagingMessageListenerAdapter.<init>(MessagingMessageListenerAdapter.java:118)
at org.springframework.kafka.listener.adapter.RecordMessagingMessageListenerAdapter.<init>(RecordMessagingMessageListenerAdapter.java:61)
at org.springframework.kafka.config.MethodKafkaListenerEndpoint.createMessageListenerInstance(MethodKafkaListenerEndpoint.java:185)
at org.springframework.kafka.config.MethodKafkaListenerEndpoint.createMessageListener(MethodKafkaListenerEndpoint.java:144)
at org.springframework.kafka.config.AbstractKafkaListenerEndpoint.setupMessageListener(AbstractKafkaListenerEndpoint.java:423)
at org.springframework.kafka.config.AbstractKafkaListenerEndpoint.setupListenerContainer(AbstractKafkaListenerEndpoint.java:408)
at org.springframework.kafka.config.AbstractKafkaListenerContainerFactory.createListenerContainer(AbstractKafkaListenerContainerFactory.java:306)
at org.springframework.kafka.config.AbstractKafkaListenerContainerFactory.createListenerContainer(AbstractKafkaListenerContainerFactory.java:57)
at org.springframework.kafka.config.KafkaListenerEndpointRegistry.createListenerContainer(KafkaListenerEndpointRegistry.java:183)
at org.springframework.kafka.config.KafkaListenerEndpointRegistry.registerListenerContainer(KafkaListenerEndpointRegistry.java:155)
at org.springframework.kafka.config.KafkaListenerEndpointRegistry.registerListenerContainer(KafkaListenerEndpointRegistry.java:129)
at org.springframework.kafka.config.KafkaListenerEndpointRegistrar.registerAllEndpoints(KafkaListenerEndpointRegistrar.java:164)
at org.springframework.kafka.config.KafkaListenerEndpointRegistrar.afterPropertiesSet(KafkaListenerEndpointRegistrar.java:158)
at org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor.afterSingletonsInstantiated(KafkaListenerAnnotationBeanPostProcessor.java:259)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:779)
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:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
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:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I am using spring version - 4.3.5
And kafka version - 2.2.0.RELEASE
Can you please help here what i am doing wrong
I have tried degrading spring version to 4.2.0 but it results in the same error
Your spring-context and spring-text are the same version?
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-text</artifactId>
<version>4.3.5.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).

Jenkins throws org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA

I am running automated tests using SOAPUI. My tests run safe when running in SOAPUI but one test fails when running in Jenkins as maven project.
10:54:36,633 ERROR [SoapUI] An error occurred [error: Unexpected element: CDATA], see error log for details
org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA
at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3486)
at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:712)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:696)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:683)
at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:208)
at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:580)
at com.eviware.soapui.support.xml.XmlUtils.createXmlObject(XmlUtils.java:263)
at com.eviware.soapui.model.propertyexpansion.resolvers.ResolverUtils.extractXPathPropertyValue(ResolverUtils.java:97)
at com.eviware.soapui.model.propertyexpansion.resolvers.ResolverUtils.parseProperty(ResolverUtils.java:67)
at com.eviware.soapui.model.propertyexpansion.resolvers.ResolverUtils.checkForExplicitReference(ResolverUtils.java:44)
at com.eviware.soapui.model.propertyexpansion.resolvers.ModelItemPropertyResolver.getScopedProperty(ModelItemPropertyResolver.java:218)
at com.eviware.soapui.model.propertyexpansion.resolvers.ModelItemPropertyResolver.resolveProperty(ModelItemPropertyResolver.java:51)
at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(PropertyExpander.java:184)
at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expandProperties(PropertyExpander.java:112)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext.expand(WsdlTestRunContext.java:157)
at com.eviware.soapui.model.testsuite.TestRunContext$expand.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at Script1.run(Script1.groovy:34)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:100)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:89)
at com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.GroovyScriptAssertion.assertScript(GroovyScriptAssertion.java:122)
at com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.GroovyScriptAssertion.internalAssertResponse(GroovyScriptAssertion.java:139)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlMessageAssertion.assertResponse(WsdlMessageAssertion.java:165)
at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest.assertResponse(RestTestRequest.java:156)
at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequest.setResponse(RestTestRequest.java:141)
at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.run(RestTestRequestStep.java:927)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:52)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:152)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:47)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
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:724)
Caused by: org.xml.sax.SAXParseException; systemId: file:; lineNumber: 1; columnNumber: 53; Unexpected element: CDATA
at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportFatalError(Piccolo.java:1038)
at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:723)
at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3454)
I am trying to load a stored variable from project custom properties.
`context.expand( '${#TestCase#ControllerIds#$[1]}' )`
Could some one tell me a fix for this.
I fixed the problem . actually not fixed but handled it in a different way.
def vUControllerIds = []
vUControllerIds = context.expand( '${#TestCase#VUControllerIds}' )
def vUControllerId = new GroovyShell().evaluate(vUControllerIds)
I had the same problem, fixed by switching to soap ui pro maven plugin version 5.1.0 where that bug has been fixed. You will also need to add extra dependency in order to avoid class not found error:
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-pro-maven-plugin</artifactId>
<version>5.1.0</version>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>10.2.0.1.0</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections-maven</artifactId>
<version>0.9.9-RC2</version>
</dependency>
.......
<plugin>

Maven Dependency and Logging - Slf4j and Log4j

I am using Maven to manage project dependencies in a spring based project.
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<!-- <scope>provided</scope> -->
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<!-- <scope>provided</scope> -->
</dependency>
However, some other projects deployed on the same server use slf4j and log4j libraries present in tomcat's lib directory and I cannot remove those.
Slf4J and Log4J version present in tomcat's lib directory are
slf4j-api-1.4.2
log4j-1.2.14
slf4j-log4j12-1.5.2
My project works fine when I remove these libraries from tomcat's lib directory and use the one mentioned in project's pom
When I comment the dependency in project's pom file and use the one's present in tomcat's lib below exception is thrown
> SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:657)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:282)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
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(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
>May 21, 2014 11:57:27 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
May 21, 2014 11:57:27 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/onevalue] startup failed due to previous errors
May 21, 2014 11:57:27 AM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
May 21, 2014 11:57:27 AM org.apache.catalina.core.StandardContext listenerStop
SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.ExceptionInInitializerError
at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4837)
at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5484)
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$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalStateException: org.slf4j.LoggerFactory could not be successfully initialized. See also http://www.slf4j.org/codes.html#unsuccessfulInit
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:303)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:657)
at org.springframework.web.context.ContextCleanupListener.<clinit>(ContextCleanupListener.java:43)
... 12 more
I also tried to use maven scope "provided" while keeping the libraries in tomcat's lib directory. Though the project runs, but now logging mechanism is not working, no logs are getting created, even the System.out.println() couldn't print anything on console window
It seems as if you need to downgrade your project to slf4j 1.4.2 to work with the log4j available in your tomcat. They are binary incompatible. You would also hang on to the <scope>provided</scope> afterwards, so you dont include them double.
The alternative is to get the other project to include the libraries themselves and remove from tomcat common. I know of no other exclusion mechanism on the tomcat.
For reference, and probably not helpful, I currently deploy on weblogic and it has a deployment specification that allows one to exclude server common classes and use bundled classes instead, such as the below snippet (with reference)
<wls:prefer-application-packages>
<!-- http://blog.terrencemiao.com/archives/annoying-slf4j-problem-in-weblogic-server-12c -->
<wls:package-name>org.slf4j</wls:package-name>
</wls:prefer-application-packages>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
This is my configuration and it works fine for me.

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

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

Resources