We deploy the WAR file in Tomcat 5.5, and it works fine if the WEB-INF \ classes contain .classes files, but if we move the .jar file containing this .classes to WEB-INF \ lib, we get an exception from the runtime complaining that java.lang.NoSuchMethodError, but the existing class file in the .jar file contains the class and the method exits!
Any help on this would be appreciated.
This may be due to a class conflict. Make sure there is no previous version of the class (Tomcat public folder, WEB-INF / classes, WEB-INF / lib). If so, you have almost no idea which Tomcat class will be loaded. If he chooses one without a method, the exception you are experiencing will occur.
Since you are getting a NoSuchMethodError, not a ClassNotFoundError, this means that you have an old version of the class somewhere (outside the jar file). You need to find and delete it.
closin , http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html#Class%20Loader%20Definitions
, WEB-INF/classes , WEB-INF/lib. ( ). , . lib, ( , - )
.
, -
- :
JVM( )/WEB -INF/ -/WEB -INF/lib/*.jar -( )
, "Common class loader", common.loader $CATALINA_BASE/conf/catalina.properties. / ;shared.loader = ${catalina.base}/shared/classes, ${catalina.base}/shared/lib/*. jar
, .
Source: https://habr.com/ru/post/1711986/More articles:GAC deployment - c #Hang the process - windowsКак этого избежать? Yslow → "Эта страница имеет 5 внешних таблиц стилей. Попробуйте объединить их в одну". - javascriptAccess to Children SimpleButton - flash-cs4How to get a list of all wcf services running on a machine? - wcfhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1711987/how-to-get-screen-resolution-of-visitor-in-javascript-andor-php&usg=ALkJrhjY7zIwG08RlLuXqBD5v-OlKvjFCwОператоры и аргументы С++ - c++Objective C - Using deleteCharactersInRange for NSMutableStrings - objective-cFirst create a database script and create a database using SQL Server Management Studio, and then create a script - sqlfailed to add a new row using datagridview using c # in winforms - c #All Articles