Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] java.lang.NoSuchFieldException: serverClasspathPattern

Hm, then I'd need access to the Server object as well.
But I don't get why the method is not found as it's clearly there: https://github.com/eclipse/jetty.project/blob/jetty-10.0.x/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java#L734 

tir. 8. des. 2020 kl. 18:11 skrev Jan Bartel <janb@xxxxxxxxxxx>:
Hi David,

Have you tried using the static methods on WebAppContext:  addSystemClasses(Server server, String... patterns) and addServerClasses(Server server, String... patterns)? I believe the method signature is the same for jetty-9 and jetty-10/11.

cheers
Jan

On Tue, 8 Dec 2020 at 17:33, David Karlsen <davidkarlsen@xxxxxxxxx> wrote:
I have this descriptor:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC
"-//Mort Bay Consulting//DTD Configure//EN"
"http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/finods</Set>
<Set name="parentLoaderPriority">true</Set>
<Get name="serverClasspathPattern">
<Call name="add">
<Arg>-org.eclipse.jetty.server.</Arg>
</Call>
<Call name="add">
<Arg>-org.eclipse.jetty.util.thread.</Arg>
</Call>
</Get>
</Configure>
which works on 9.x, but on 10 I get:

.e.j.w.WebAppContext@1d470d0{ccm-finodsping-dist-5.0.4-SNAPSHOT,/finods,file:///eos/d1/amw-virus-scan-ws/i1/tmp/jetty-0_0_0_0-20261-ccm-finodsping-dist-5_0_4-SNAPSHOT_war-_ccm-finodsping-dist-5_0_4-SNAPSHOT-any-2186630068394942064/webapp/,UNAVAILABLE}{/eos/d1/amw-virus-scan-ws/i1/releases/1.0.15-TEST/webapps/ccm-finodsping-dist-5.0.4-SNAPSHOT.war}
java.lang.NoSuchFieldException: serverClasspathPattern
at java.base/java.lang.Class.getField(Class.java:1999)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.get(XmlConfiguration.java:856)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:456)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:369)
at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:308)
at org.eclipse.jetty.webapp.JettyWebXmlConfiguration.lambda$configure$0(JettyWebXmlConfiguration.java:86)
at org.eclipse.jetty.webapp.WebAppClassLoader.runWithServerClassAcc

It seems in 10.x this is replaced with a serverClassMatcher which is a ClassMatcher.

Is there any way to write a descriptor so that it's compatible with jetty9 and 10 at the same time?
--
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users


--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
Expert assistance from the creators of Jetty and CometD



--

Back to the top