Is togglz (https://www.togglz.org/documentation/activation-strategies.html) support spring web-flux ( spring-boot-starter-parent - 2.7.5) ?
I could not find any example
Related
What could be causing this error?
Caused by: jakarta.servlet.UnavailableException: Servlet class org.restlet.ext.servlet.ServerServlet is not a jakarta.servlet.Servlet
at org.eclipse.jetty.servlet.ServletHolder.checkServletType (ServletHolder.java:499)
at org.eclipse.jetty.servlet.ServletHolder.doStart (ServletHolder.java:377)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:96)
at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$2 (ServletHandler.java:699)
at java.util.stream.SortedOps$SizedRefSortingSink.end (SortedOps.java:357)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:474)
at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining (StreamSpliterators.java:312)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining (Streams.java:735)
at java.util.stream.ReferencePipeline$Head.forEach (ReferencePipeline.java:658)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:724)
I'm running the web app from mvn jetty:run plugin
jakarta.servlet.UnavailableException: Servlet class [...] is not a jakarta.servlet.Servlet
The jakarta.servlet.Servlet is part of Servlet API version 5.0 which in turn is part of Jakarta EE version 9. This can thus only mean that the servlet class specified in [...] is NOT compiled against Servlet API version 5.0, but against an older version.
You have 2 options:
Upgrade the servlet class specified in [...] to a Servlet API version 5.0 compatible one.
Or, downgrade the servlet container from Servlet API version 5.0 to a previous version, at least the one matching the target Servlet API version of the servlet class specified in [...].
The technical reason is that during the step from Java/Jakarta EE 8 to Jakarta EE 9 all javax.* packages have been renamed to jakarta.* packages. So there is no backwards compatibility anymore since Jakarta EE 9.
When we translate the above facts to your specific situation, your only option is to downgrade the Jetty servlet container to a Servlet 4.0 compatible version. This is because the 3rd party library "Restlet" has currently no Servlet 5.0 compatible version available at all. According to Jetty's version table, Jetty 11.x is Jakarta EE 9 targeted, so you need Jetty version 10.x or older.
Alternatively, you can drop Restlet altogether and use Jersey instead. It has currently a Jakarta EE 9 compatible version available.
See also:
Jetty versions
Getting java.lang.ClassNotFoundException: jakarta.servlet.Filter on Maven/Jersey web service while running on Tomcat 9
I was trying to run a Maven application inside a Wildfly server
I installed 20.0.1.Final, the last version before Jakarta
I got this error even i have created a shared lib on was 9, this lib contains all the hibernate 5.4.3 dependency including javax.persistence 2.2
Do you really needs JPA 2.2 ?
I was able to deploy my EAR under WAS 9 using hibernate 5.2.17 (starting from 5.3 hibernate is JPA 2.2 compliant)
WAS 9 it seems compatible only with JPA 2.0 and JPA 2.1
I created the shared lib using following lists of jars
E:\hibernate-release-5.2.17.Final\lib\envers\hibernate-envers-5.2.17.Final.jar
E:\hibernate-release-5.2.17.Final\lib\jpa-metamodel-generator\hibernate-jpamodelgen-5.2.17.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\c3p0\c3p0-0.9.5.2.jar
E:\hibernate-release-5.2.17.Final\lib\optional\c3p0\hibernate-c3p0-5.2.17.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\c3p0\mchange-commons-java-0.2.11.jar
E:\hibernate-release-5.2.17.Final\lib\optional\ehcache\ehcache-2.10.3.jar
E:\hibernate-release-5.2.17.Final\lib\optional\ehcache\hibernate-ehcache-5.2.17.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\ehcache\slf4j-api-1.7.7.jar
E:\hibernate-release-5.2.17.Final\lib\optional\infinispan\hibernate-infinispan-5.2.17.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\infinispan\infinispan-commons-8.2.5.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\infinispan\infinispan-core-8.2.5.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\infinispan\jboss-marshalling-osgi-1.4.10.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\infinispan\jgroups-3.6.7.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\proxool\hibernate-proxool-5.2.17.Final.jar
E:\hibernate-release-5.2.17.Final\lib\optional\proxool\proxool-0.8.3.jar
E:\hibernate-release-5.2.17.Final\lib\osgi\byte-buddy-1.6.14.jar
E:\hibernate-release-5.2.17.Final\lib\osgi\hibernate-osgi-5.2.17.Final.jar
E:\hibernate-release-5.2.17.Final\lib\osgi\javax.interceptor-api-1.2.jar
E:\hibernate-release-5.2.17.Final\lib\osgi\org.osgi.compendium-4.3.1.jar
E:\hibernate-release-5.2.17.Final\lib\osgi\org.osgi.core-4.3.1.jar
E:\hibernate-release-5.2.17.Final\lib\required\antlr-2.7.7.jar
E:\hibernate-release-5.2.17.Final\lib\required\classmate-1.3.0.jar
E:\hibernate-release-5.2.17.Final\lib\required\dom4j-1.6.1.jar
E:\hibernate-release-5.2.17.Final\lib\required\hibernate-commons-annotations-5.0.1.Final.jar
E:\hibernate-release-5.2.17.Final\lib\required\hibernate-core-5.2.17.Final.jar
E:\hibernate-release-5.2.17.Final\lib\required\jandex-2.0.3.Final.jar
E:\hibernate-release-5.2.17.Final\lib\required\javassist-3.22.0-GA.jar
E:\hibernate-release-5.2.17.Final\lib\required\jboss-logging-3.3.1.Final.jar
It is important on the Shared Lib def to check "Class Loading - Use an isolated class loader for this shared library"
and on the Applicatiion --> Class Loader --> Class Loader Order --> select Classes Loaded with Local Class Loader First (Parent Last)
I'm looking too to use up-to-date Hibernate 5.4.x (stable) and in the future the 6.x.. but having similar issue
If eventually you was able to use Hibernate 5.4.x.. can you share ?
Regards
I want to convert my spring and hibernate based project into gce project.
but don't know how to convert appengine-web.xml into annotation.
Didn't find any source with annotation based configuration.
i tried to add xml in project but it throws an error:
Unable to stage:
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7 com/mysql/cj/api/CacheAdapter.class
i checked and found similar problem:
how to Fix Class file is Java 8 but max supported is Java 7
but solution over there is not able to solve my issue.
then i changed project configuration into java 7 but problem remains same.
google app engine by default supports java 7. Add <vm>true</vm> into your appengine-web.xml and use flexible environment to work with java 8.
appengine-web.xml
<!-- [START config] -->
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>xxxxxxxxxxxx</application>
<vm>true</vm>
<threadsafe>true</threadsafe>
<use-google-connector-j>true</use-google-connector-j>
<system-properties>
<property name="ae-cloudsql.cloudsql-database-url" value="jdbc:google:mysql://connectionName:instanceName/DBName?user=USER&password=PASSWORD;" />
</system-properties>
</appengine-web-app>
<!-- [END config] -->
I am trying to run a simple spring web application with spring-integration-dsl-groovy, but i am getting an below error
org.springframework.web.util.NestedServletException: Handler
processing failed; nested exception is java.lang.NoClassDefFoundError:
org/springframework/integration/Message
Can anyone help me?
Here is my code
#RestController
class SampleController{
#RequestMapping("/welcome")
String start(){
def builder = new IntegrationBuilder()
def flow = builder.messageFlow{
transform {String payload -> "Welcome $payload - Powered by Groovy !!!"}
handle{ println payload }
}
return flow.sendAndReceive("to Spring MVC ")
}
}
Added all required dependecies, including spring mvc, groovy, spring integration
compile "org.codehaus.groovy:groovy-all:$groovyVersion"
compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion"
compile "org.springframework.integration:spring-integration-dsl-groovy-core:$springInegrationDslGroovyVersion"
spring-integration-dsl-groovy-core 1.0.0 is not compatible with Spring Integration 4.1.4. spring-integration-dsl-groovy-core 1.1.0 is latest version available and its compatible with Spring Integration 4.1.4
whenever I use a c:foreach tag in my jspx files I'm getting below error
Caused by: java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
at javax.servlet.jsp.jstl.core.LoopTagSupport.unExposeVariables(LoopTagSupport.java:587)
at javax.servlet.jsp.jstl.core.LoopTagSupport.doFinally(LoopTagSupport.java:323)
at jsp_servlet._web_45_inf._views.__matchdriverpopup_jspx._jspService(__matchdriverpopup_jspx.java:1160)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:496)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:245)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
How can I solve this? This is only related to c:forEach. All other tags are working fine. I have follwing jar files in APP-INF/lib folder of EAR and tiles-jsp-2.2.0.jar and jstl-1.2.jar in my WEB-INF/lib of WAR file. web.xml version - 2.4
tiles-api-2.2.0
tiles-core-2.2.0
tiles-jsp-2.2.0
tiles-servlet-2.2.0
tiles-template-2.2.0
Please help, Thanks in advance
This exception indicates that the JSTL API is of a newer version than the JSTL impl. And indeed, Weblogic already ships with JSTL bundled. It's apparently of an older version than the one in your webapp. The newer JSTL API is been loaded from your webapp, but the older JSTL impl is been loaded from Weblogic.
Remove the JSTL libraries from your webapp so that the webapp will just use Weblogic's own ones.