Skip to content

Comments

[KARAF-7392] Upgrade to Pax Web 8.0.2#1490

Closed
grgrzybek wants to merge 3 commits intoapache:mainfrom
grgrzybek:KARAF-7392
Closed

[KARAF-7392] Upgrade to Pax Web 8.0.2#1490
grgrzybek wants to merge 3 commits intoapache:mainfrom
grgrzybek:KARAF-7392

Conversation

@grgrzybek
Copy link
Contributor

No description provided.

@jbonofre jbonofre self-requested a review February 11, 2022 12:07
@jbonofre
Copy link
Member

Just tested and all good. If you don't mind, I would:

  1. merge this PR
  2. update the documentation according to the implied changes (especially the command names, etc)
    @grgrzybek is it OK for you ?

@grgrzybek
Copy link
Contributor Author

Great @jbonofre !
I'll definitely write more in official Karaf docs - maybe even next week.

@grgrzybek
Copy link
Contributor Author

I've created https://issues.apache.org/jira/browse/KARAF-7406 to not forget.

@jbonofre
Copy link
Member

@grgrzybek no worries, I'm on it right now as I would like to submit 4.4.0 to vote very soon. I'm on it ;)

@grgrzybek
Copy link
Contributor Author

@jbonofre I've updated this PR to include documentation changes as well.

@jbonofre
Copy link
Member

I gonna merge this PR manually, including 8.0.2 update.

@jbonofre
Copy link
Member

FYI, the ServletExampleTest is failing in itests: the command is always empty (no servlet found). I'm checking why.

@grgrzybek
Copy link
Contributor Author

FYI, the ServletExampleTest is failing in itests: the command is always empty (no servlet found). I'm checking why.

Hmm, when I was pushing the PR it worked. I'll check on Tuesday or Wednesday.

@jbonofre
Copy link
Member

@grgrzybek don't worry, I'm working on it right now ;)

@jbonofre
Copy link
Member

OK, it seems that ServletExampleTest passes with Pax Web 8.0.1 but not with 8.0.2. I'm doing new tests.

@grgrzybek
Copy link
Contributor Author

This is the problem:

Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.tagext.TagVariableInfo not found by org.ops4j.pax.web.pax-web-tomcat-common [97]
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1585) ~[?:?]
	at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79) ~[?:?]
	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1970) ~[?:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
	at java.lang.Class.getDeclaredMethods0(Native Method) ~[?:?]
	at java.lang.Class.privateGetDeclaredMethods(Class.java:3166) ~[?:?]
	at java.lang.Class.getMethodsRecursive(Class.java:3307) ~[?:?]
	at java.lang.Class.getMethod0(Class.java:3293) ~[?:?]
	at java.lang.Class.getMethod(Class.java:2106) ~[?:?]
	at org.apache.tomcat.util.descriptor.tld.TldRuleSet$GenericBooleanRule.<init>(TldRuleSet.java:387) ~[?:?]
	at org.apache.tomcat.util.descriptor.tld.TldRuleSet$GenericBooleanRule.<init>(TldRuleSet.java:382) ~[?:?]
	at org.apache.tomcat.util.descriptor.tld.TldRuleSet.addRuleInstances(TldRuleSet.java:96) ~[?:?]
	at org.apache.tomcat.util.digester.Digester.addRuleSet(Digester.java:1612) ~[?:?]
	at org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(DigesterFactory.java:171) ~[?:?]
	at org.apache.tomcat.util.descriptor.tld.TldParser.<init>(TldParser.java:49) ~[?:?]
	at org.apache.tomcat.util.descriptor.tld.TldParser.<init>(TldParser.java:44) ~[?:?]
	at org.apache.jasper.servlet.TldScanner.<init>(TldScanner.java:84) ~[?:?]
	at org.ops4j.pax.web.jsp.PaxWebTldScanner.<init>(PaxWebTldScanner.java:53) ~[?:?]
	at org.ops4j.pax.web.jsp.JasperInitializer.newTldScanner(JasperInitializer.java:205) ~[?:?]
	at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:81) ~[?:?]
	at org.ops4j.pax.web.jsp.JasperInitializer.onStartup(JasperInitializer.java:141) ~[?:?]
	at org.ops4j.pax.web.service.spi.servlet.SCIWrapper.onStartup(SCIWrapper.java:43) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletContextHandler.lambda$startContext$1(PaxWebServletContextHandler.java:211) ~[?:?]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletContextHandler.startContext(PaxWebServletContextHandler.java:205) ~[?:?]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:916) ~[?:?]
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.PaxWebServletContextHandler.doStart(PaxWebServletContextHandler.java:261) ~[?:?]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.ensureServletContextStarted(JettyServerWrapper.java:2255) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper.visitTransactionStateChange(JettyServerWrapper.java:725) ~[?:?]
	at org.ops4j.pax.web.service.spi.task.TransactionStateChange.accept(TransactionStateChange.java:35) ~[?:?]
	at org.ops4j.pax.web.service.spi.task.Batch.accept(Batch.java:430) ~[?:?]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerController.sendBatch(JettyServerController.java:168) ~[?:?]
	at org.ops4j.pax.web.service.internal.HttpServiceEnabled$WebAppWebContainer.lambda$sendBatch$0(HttpServiceEnabled.java:2472) ~[?:?]
	at org.ops4j.pax.web.service.spi.model.ServerModel.lambda$run$2(ServerModel.java:534) ~[?:?]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) ~[?:?]
	... 6 more

In 8.0.2 I've moved some classes around (to support web-fragment.xml parsing for HTTP Context Processing). Let me check what's wrong - as all Pax Web itests work fine.

@grgrzybek
Copy link
Contributor Author

grgrzybek commented Apr 17, 2022

The problem is that there's one bundle - pax-web-tomcat-common that packages some basic Tomcat stuff - including Digester and web.xml/web-fragment.xml parsers.
In Pax Web 8.0.1, this bundle was only installed with pax-web-jsp feature and now it's installed together with pax-web-runtime (so we can alter the contexts using web-fragment.xml - see ops4j/org.ops4j.pax.web/issues/1656).

In ServletExampleTest, features are installed with org.apache.karaf.itests.KarafTestSupport#NO_AUTO_REFRESH flag, so there's no chance that pax-web-tomcat-common is rewired to include packages from pax-web-jsp (these are optional).

pax-web-jsp is installed anyway (part of war feature), so it's SCI (JasperInitializer) is invoked, including TLD parser configuration.

@grgrzybek
Copy link
Contributor Author

Test works with

diff --git a/itests/test/src/test/java/org/apache/karaf/itests/examples/ServletExampleTest.java b/itests/test/src/test/java/org/apache/karaf/itests/examples/ServletExampleTest.java
index 2631394e79..19bc4e514d 100644
--- a/itests/test/src/test/java/org/apache/karaf/itests/examples/ServletExampleTest.java
+++ b/itests/test/src/test/java/org/apache/karaf/itests/examples/ServletExampleTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.karaf.itests.examples;
 
+import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.itests.BaseTest;
 import org.junit.Assert;
 import org.junit.Test;
@@ -34,6 +35,7 @@ import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.net.HttpURLConnection;
 import java.net.URL;
+import java.util.EnumSet;
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerMethod.class)
@@ -44,6 +46,8 @@ public class ServletExampleTest extends BaseTest {
         installAndAssertFeature("http");
         installAndAssertFeature("http-whiteboard");
         installAndAssertFeature("pax-web-karaf");
+        featureService.installFeature("pax-web-jsp", EnumSet.noneOf(FeaturesService.Option.class));
+        assertFeatureInstalled("pax-web-jsp");
     }
 
     private void verify() throws Exception {
diff --git a/pom.xml b/pom.xml
index 34ec74a408..021c23283e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -309,7 +309,7 @@
         <pax.base.version>1.5.1</pax.base.version>
         <pax.swissbox.version>1.8.5</pax.swissbox.version>
         <pax.url.version>2.6.10</pax.url.version>
-        <pax.web.version>8.0.1</pax.web.version>
+        <pax.web.version>8.0.2</pax.web.version>
         <pax.tinybundle.version>3.0.0</pax.tinybundle.version>
         <pax.jdbc.version>1.5.3</pax.jdbc.version>
         <pax.jms.version>1.1.0</pax.jms.version>

@jbonofre jbonofre changed the title [KARAF-7392] Upgrade to Pax Web 8.0.1 - all integration tests work fine [KARAF-7392] Upgrade to Pax Web 8.0.2 Apr 18, 2022
@asfgit asfgit closed this in a357238 Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants