I m working with jersey2.29 and Spring 4 to develop a web application. The following are my dependencies.
When starting Tomcat server 8 server, it doesn't start and I get the following error
Caused by: java.lang.NoSuchMethodError: org.glassfish.jersey.internal.l10n.LocalizableMessageFactory.(Ljava/lang/String;Lorg/glassfish/jersey/internal/l10n/LocalizableMessageFactory$ResourceBundleSupplier;)V
at org.glassfish.jersey.server.spring.LocalizationMessages.(LocalizationMessages.java:19)
at org.glassfish.jersey.server.spring.SpringWebApplicationInitializer.onStartup(SpringWebApplicationInitializer.java:46)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more
I tried adding all the latest jar files in WEB-INF/lib
You not have minimal dependency for jersey-spring4 which is Spring 4.3.8
org.springframework spring-aop 4.3.8.RELEASE jar Apache License, Version 2.0
org.springframework spring-beans 4.3.8.RELEASE jar Apache License, Version 2.0
org.springframework spring-core 4.3.8.RELEASE jar Apache License, Version 2.0
org.springframework spring-web 4.3.8.RELEASE jar Apache License, Version 2.0
You should use spring-jersey3 jar
Related
We have a Spring Boot web application developed with Spring Boot 2.4.3 and deploys Spring Actuator. I am investigating upgrading to Spring Boot 2.6.2 and have the majority of the issues working. I removed spring actuator starter from the project and war file and it deploys and runs fine. We are running using Java 11 and Wildfly 18.
If I add the spring actuator starter back into to the project pom file and war file pom files, it shows the following warning during deployment:
16:44:28,063 WARN [org.jboss.modules.define] (Thread-115) Failed to define class io.micrometer.core.instrument.binder.jersey.server.MetricsApplicationEventListener in Module "deployment.test.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link io/micrometer/core/instrument/binder/jersey/server/MetricsApplicationEventListener (Module "deployment.test.war" from Service Module Loader): org/glassfish/jersey/server/monitoring/ApplicationEventListener
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1095)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
at org.jboss.modules.Module.loadModuleClass(Module.java:731)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at deployment.test.war//org.springframework.boot.autoconfigure.condition.FilteringSpringBootCondition.resolve(FilteringSpringBootCondition.java:108)
at deployment.test.war//org.springframework.boot.autoconfigure.condition.FilteringSpringBootCondition$ClassNameFilter.isPresent(FilteringSpringBootCondition.java:140)
at deployment.test.war//org.springframework.boot.autoconfigure.condition.FilteringSpringBootCondition$ClassNameFilter$2.matches(FilteringSpringBootCondition.java:128)
at deployment.test.war//org.springframework.boot.autoconfigure.condition.OnClassCondition$StandardOutcomesResolver.getOutcome(OnClassCondition.java:227)
at deployment.test.war//org.springframework.boot.autoconfigure.condition.OnClassCondition$StandardOutcomesResolver.getOutcome(OnClassCondition.java:214)
at deployment.test.war//org.springframework.boot.autoconfigure.condition.OnClassCondition$StandardOutcomesResolver.getOutcomes(OnClassCondition.java:201)
at deployment.test.war//org.springframework.boot.autoconfigure.condition.OnClassCondition$StandardOutcomesResolver.resolveOutcomes(OnClassCondition.java:190)
at deployment.test.war//org.springframework.boot.autoconfigure.condition.OnClassCondition$ThreadedOutcomesResolver.lambda$new$0(OnClassCondition.java:150)
at java.base/java.lang.Thread.run(Thread.java:834)
I went down the path of trying to add jar files to the project for the missing class, but the problem adds to another missing class file. I could not find any major changes in Spring Actuator between Spring Boot versions 2.4.2 and 2.6.2 that would cause this problem.
Does anyone have any insight into changes in Spring Boot that might cause the deployment issue?
I am following the docs at
http://uima.apache.org/downloads/releaseDocs/2.2.2-incubating/docs/html/overview_and_setup/overview_and_setup.html#ugr.ovv.eclipse_setup
when I try to install the UIMA tools plugin, I get
Cannot complete the install because one or more required items could not be found.
Software being installed: UIMA Tools (includes Runtime) 2.8.1 (org.apache.uima.tools.feature.group 2.8.1)
Missing requirement: UIMA Eclipse: uimaj-ep-jcasgen 2.3.1 (org.apache.uima.jcas.jcasgenp 2.3.1) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Missing requirement: Apache UIMA Eclipse: uimaj-ep-jcasgen 2.4.0 (org.apache.uima.jcas.jcasgenp 2.4.0) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Missing requirement: Apache UIMA Eclipse: uimaj-ep-jcasgen 2.4.1 (org.apache.uima.jcas.jcasgenp 2.4.1) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Missing requirement: Apache UIMA Eclipse: uimaj-ep-jcasgen 2.4.2 (org.apache.uima.jcas.jcasgenp 2.4.2) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Missing requirement: Apache UIMA Eclipse: uimaj-ep-jcasgen 2.5.0 (org.apache.uima.jcas.jcasgenp 2.5.0) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Missing requirement: Apache UIMA Eclipse: uimaj-ep-jcasgen 2.6.0 (org.apache.uima.jcas.jcasgenp 2.6.0) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Missing requirement: Apache UIMA Eclipse: uimaj-ep-jcasgen 2.7.0 (org.apache.uima.jcas.jcasgenp 2.7.0) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Missing requirement: Apache UIMA Eclipse: uimaj-ep-jcasgen 2.8.0 (org.apache.uima.jcas.jcasgenp 2.8.0) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Missing requirement: Apache UIMA Eclipse: uimaj-ep-jcasgen 2.8.1 (org.apache.uima.jcas.jcasgenp 2.8.1) requires 'package org.eclipse.core.internal.compatibility 0.0.0' but it could not be found
Cannot satisfy dependency:
From: UIMA Tools (includes Runtime) 2.8.1 (org.apache.uima.tools.feature.group 2.8.1)
To: org.apache.uima.jcas.jcasgenp 0.0.0
where can I install this package
org.eclipse.core.internal.compatibility 0.0.0'
so that I can then install
uimaj-ep-jcasgen 2.8.1 (org.apache.uima.jcas.jcasgenp 2.8.1)
I am using Eclipse Neon and was able to install the Eclipse EMF tools for Neon.
Solved it by:
copying the content of $UIMA_HOME/eclipsePlugins/* to $ECLIPSE_HOME/eclipse/plugins/ ( where $UIMA_HOME is where you installed the UIMA SDK
and $ECLIPSE_HOME is where you installed eclipse)
Then running eclipse with "-clean"
Note: Using Eclipse neon on linux and uima 2.9
In my spring webapplication I am trying to get my dependencies resolved by Ivy. So here's my setup:
ivy.xml: http://pastebin.com/sDykaRn4
ivysettings.xml: http://pastebin.com/NmQsdG2m
build.xml: http://pastebin.com/Z5Z2XmmW
web.xml: http://pastebin.com/r06wbLr5
/WEB-INF/dispatcher-servlet.xml: http://pastebin.com/F4bdPyr4
My dependencies are getting well resolved by Ivy into my .ivy2/cache folder and then copied to lib.dir. The report gives me the following conflicts:
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| compile | 257 | 223 | 221 | 50 || 204 | 204 |
| runtime | 248 | 215 | 213 | 48 || 197 | 197 |
| test | 249 | 216 | 214 | 48 || 198 | 198 |
---------------------------------------------------------------------
Module Selected Evicted
xercesImpl by xerces 2.10.0 2.8.1 2.8.0
xml-apis by xml-apis 1.4.01 1.3.02 1.3.04 1.3.03
jaxen by jaxen 1.1.4 1.1.1
jsch by com.jcraft 0.1.51 0.1.42
commons-io by commons-io 1.4 1.3.2 1.3
xalan by xalan 2.7.1 2.7.0
slf4j-api by org.slf4j 1.7.12 1.5.3 1.5.8 1.6.1
backport-util-concurrent by backport-util-concurrent 3.1 3.0
poi by org.apache.poi 3.12 3.0.2-FINAL
commons-codec by commons-codec 1.9 1.6 1.2
commons-lang by commons-lang 2.6 2.3 2.4 2.1
tiles-jsp by org.apache.tiles 2.1.2 3.0.1
tiles-servlet by org.apache.tiles 2.1.2 3.0.1
tiles-core by org.apache.tiles 2.1.2 3.0.1
tiles-api by org.apache.tiles 3.0.1 2.1.2
spring-web by org.springframework 3.2.4.RELEASE 2.5.6
jackson-mapper-asl by org.codehaus.jackson 1.4.2 1.5.2
httpcore by org.apache.httpcomponents 4.2 4.0-beta1
servlet-api by javax.servlet 2.5 2.4 2.3
activation by javax.activation 1.1 1.0.2
jcommon by jfree 1.0.16 1.0.0
commons-logging by commons-logging 1.2 1.1.1 1.0 1.1 1.1.3 1.0.4 1.0.3
commons-digester by commons-digester 2.1 1.8 1.8.1 2.0
commons-collections by commons-collections 20040616 2.0 3.2.1 3.2 3.1
commons-beanutils by commons-beanutils 1.7.0 1.8.3
itext by com.lowagie 2.1.7 [1.02b,)
joda-time by joda-time 2.1 1.6.2
log4j by log4j 1.2.17 1.2.16 1.2.14
When I try to start my tomcat server in Eclipse, the server won't start (well, it does start, but with lots of Errors) and prints this log: http://pastebin.com/dtA6vFcK
My research on the org.springframework.beans.factory.BeanCreationException suggested that I am using multiple versions of spring. But as you can see in my ivy file and report, I only use 3.2.4.RELEASE. And I don't see how any of those ivy conflicts would harm the startup of my spring application.
Here's a list of the jars in my lib.dir: http://pastebin.com/01E2CQrx
Do you might see any problem...?
Thank you so much... really need your help on this one.
We want to exclude the modules\system\layers\base\javax\servlet\jstl\api\main\jboss-jstl-api_1.2_spec-1.1.2.Final.jar from our web application deployment (WAR file).
Hence we have the following configuration in src\main\webapp\WEB-INF\jboss-deployment-structure.xml:
<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<module name="javax.servlet.jstl.api"/>
</exclusions>
<dependencies>
<module name="deployment.my-dependencies.jar"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
In the Wildfly log I see that my-dependencies.jar is added as a ModuleDependency. But when searching for javax.servlet.jstl.api I only see this:
2015-04-03 15:22:11,971 DEBUG [org.jboss.modules] (ServerService
Thread Pool -- 12) Module javax.servlet.jstl.api:main defined by local
module loader #1f7c9157 (finder: local module finder #2b29f6e7 (roots:
C:\Users\me\Documents\wildfly-8.2.0.Final\modules,C:\Users\me\Documents\wildfly-8.2.0.Final\modules\system\layers\base))
Why isn't the module excluded?
Update: It seems that modules that are part of a user dependency can not be excluded.
It seems like the mechanism doesn't work as described in the Wildfly documentation. I was not able to exclude that module.
Yep. I was trying to upgrade to Spring Framework to v4.3. It has upped some minimum dependency requirements. One such example is Jackson min version required is 2.6+
Wildfly loads jackson that comes packaged (v2.4.1 in Wildfly 8.2.1), and it won't be excluded using jboss-deployment-structure.xml.
I was trying to see if the upgrade did not involve making changes to the installed server which takes this upgrade out of source control.
I am having a call to URLBuilder.build which has this call trace:
Servlet.service() for servlet authv0 threw exception:
java.lang.NoSuchMethodError: org.apache.http.client.utils.URLEncodedUtils.format(Ljava/lang/Iterable;Ljava/nio/charset/Charset;)Ljava/lang/String;
at org.apache.http.client.utils.URIBuilder.encodeQuery(URIBuilder.java:176) [httpclient-4.2.5.jar:4.2.5]
at org.apache.http.client.utils.URIBuilder.buildString(URIBuilder.java:140) [httpclient-4.2.5.jar:4.2.5]
at org.apache.http.client.utils.URIBuilder.build(URIBuilder.java:103) [httpclient-4.2.5.jar:4.2.5]
I see this even has been there since 4.2 and still it gives me a NoSuchMethodError. The jar version that is used is 4.2.5 as you see. Can someone point to what I am missing?
Here is my manifest file from 4.2.5 jar
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: oleg
Build-Jdk: 1.5.0_22
Implementation-Build: tags/4.2.5/httpclient#r1469939; 2013-04-19 18:29
:05+0200
Implementation-Title: HttpComponents HttpClient
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Implementation-Version: 4.2.5
Specification-Title: HttpComponents HttpClient
Specification-Vendor: The Apache Software Foundation
Specification-Version: 4.2.5
X-Compile-Source-JDK: 1.5
X-Compile-Target-JDK: 1.5
url: http://hc.apache.org/httpcomponents-client