admin管理员组文章数量:1278881
I am upgrading an old Java 11 webapp to Java 17 and Tomcat 10.
After upgrading all the code, exchanging javax.servlet to jakarta.servlet, and adjusting the code accordingly for some methods, everything compiles, but I cannot deploy the app to Tomcat 10. I get the following error:
SEVERE [Catalina-utility-2] .apache.catalina.core.StandardContext.filterStart Exception starting filter [SecurityFilter]
java.lang.NoClassDefFoundError: javax/servlet/Filter
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
The security filter is defined in web.xml, like this:
<filter>
<filter-name>SecurityFilter</filter-name>
<filter-class>waffle.servlet.NegotiateSecurityFilter</filter-class>
<init-param>
<param-name>waffle.servlet.spi.NegotiateSecurityFilterProvider/protocols</param-name>
<param-value>NTLM</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SecurityFilter</filter-name>
<url-pattern>/servlet/*</url-pattern>
</filter-mapping>
thus depends on waffle. Now, there is no dependency on waffle in the pom.xml directly, but I identified that a dependency (an internal commons-library) had in turn a waffle dependency. I checked that pom, and it referred to waffle 1.5. I changed that into waffle 3.5.0:
<dependency>
<groupId>com.github.waffle</groupId>
<artifactId>waffle-jna</artifactId>
<version>3.5.0</version>
</dependency>
I recompiled a new version of this common-library, I changed the dependency in my webapp to depend on this new version, recompiled the webapp, but I still get exactly the same error.
If I comment the Security Filter in web.xml, the webapp starts, so it's clearly the waffle security filter that causes the error. But what on earth in waffle 3.5.0 could still depend on javax.servlet?
I have tried as much as I can, but am rather unexperienced in these fields, so I am stumped.
I am upgrading an old Java 11 webapp to Java 17 and Tomcat 10.
After upgrading all the code, exchanging javax.servlet to jakarta.servlet, and adjusting the code accordingly for some methods, everything compiles, but I cannot deploy the app to Tomcat 10. I get the following error:
SEVERE [Catalina-utility-2] .apache.catalina.core.StandardContext.filterStart Exception starting filter [SecurityFilter]
java.lang.NoClassDefFoundError: javax/servlet/Filter
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
The security filter is defined in web.xml, like this:
<filter>
<filter-name>SecurityFilter</filter-name>
<filter-class>waffle.servlet.NegotiateSecurityFilter</filter-class>
<init-param>
<param-name>waffle.servlet.spi.NegotiateSecurityFilterProvider/protocols</param-name>
<param-value>NTLM</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SecurityFilter</filter-name>
<url-pattern>/servlet/*</url-pattern>
</filter-mapping>
thus depends on waffle. Now, there is no dependency on waffle in the pom.xml directly, but I identified that a dependency (an internal commons-library) had in turn a waffle dependency. I checked that pom, and it referred to waffle 1.5. I changed that into waffle 3.5.0:
<dependency>
<groupId>com.github.waffle</groupId>
<artifactId>waffle-jna</artifactId>
<version>3.5.0</version>
</dependency>
I recompiled a new version of this common-library, I changed the dependency in my webapp to depend on this new version, recompiled the webapp, but I still get exactly the same error.
If I comment the Security Filter in web.xml, the webapp starts, so it's clearly the waffle security filter that causes the error. But what on earth in waffle 3.5.0 could still depend on javax.servlet?
I have tried as much as I can, but am rather unexperienced in these fields, so I am stumped.
Share Improve this question asked Feb 24 at 13:18 ZimeonZimeon 296 bronze badges1 Answer
Reset to default 1Sometimes, it seems, one needs to spend time to ask the question in order to find the answer themselves...
I tried a final search, and it seems that, even though Waffle 3.5.0 is from very recently, it is not upgraded to work with Java 17. Instead, there is a separate depencency called "waffle-jna-jakarta" that works with jakarta instead.
I guess the regular Waffle for javax.servlet is still updated for posterity.
<dependency>
<groupId>com.github.waffle</groupId>
<artifactId>waffle-jna-jakarta</artifactId>
<version>3.0.0</version>
</dependency>
was the answer.
本文标签:
版权声明:本文标题:maven - Using Waffle 3.5.0 on Tomcat 10.1.31 gives error "java.lang.NoClassDefFoundError: javaxservletFilter" 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741267708a2368792.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论