Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Webapps not loading after migration from 9.4 to 10.0



Am 27.04.2022 um 18:20 schrieb Joakim Erdfelt:

As for your specific concerns, you are likely not initializing the JSP layer
properly (see first link above to jsp examples), and/or are still using older
Configuration (class/object) techniques (see second link above to cookbook examples).

I've replaced the XML-block concerning the DeploymentManager with the
contents of jetty-deploy.xml and jetty-plus.xml and now I get Webapps
again. Hurray ;-)

But in the process I had to solve a problem where I'm not sure
if it's a PEBKAC or actually a bug in Jetty:

From the plus-xml:

  <Call class="org.eclipse.jetty.webapp.Configurations" name="setServerDefault">
    <Arg><Ref refid="AdminServer" /></Arg>
    <Call name="add">
      <Arg>
        <Array type="String">
          <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
          <Item>org.eclipse.jetty.plus.webapp.PlusConfiguration</Item>
        </Array>
      </Arg>
    </Call>
  </Call>

I've used a different ID, hence the different reference at the beginning.
When I use that in my configuration I get a ClassCastException:

18:17:03.394+0200 [main] WARN   - unable to start HTTP-server with config file etc\admin.xml
java.lang.ClassCastException: class [Ljava.lang.String; cannot be cast to class org.eclipse.jetty.webapp.Configuration ([Ljava.lang.String; is in module java.base of loader 'bootstrap'; org.eclipse.jetty.webapp.Configuration is in unnamed module of loader 'app')
        at org.eclipse.jetty.webapp.Configurations.add(Configurations.java:62)
        ... 17 common frames omitted
Wrapped by: java.lang.reflect.InvocationTargetException: null
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.invokeMethod(XmlConfiguration.java:739)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:965)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:928)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:464)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:931)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:464)
        at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:417)
        at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:319)
        at mypackage.MainServer.startHTTPServers(MainServer.java:503)

I've spent most of the day finding the reason of the problem on my side but
the longer I looked the more it appears to me that XmlConfiguration chooses
the wrong method in Configurations. Instead of add(String[]) it seems to
try to call add(Configuration).

I've solved it by changing the configuration to call the method
XmlConfiguration is using anyway.


Thanks and best regards,

Lothar Kimmeringer


Back to the top