Re: [jetty-users] Webapps not loading after migration from 9.4 to 10.0

2022-04-28 Thread Lothar Kimmeringer




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:

  


  

  org.eclipse.jetty.plus.webapp.EnvConfiguration
  org.eclipse.jetty.plus.webapp.PlusConfiguration

  

  

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
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


Re: [jetty-users] Webapps not loading after migration from 9.4 to 10.0

2022-04-27 Thread Joakim Erdfelt
We maintain an example project of getting Embedded Jetty and JSP working
together at https://github.com/jetty-project/embedded-jetty-jsp

There's Jetty 9, Jetty 10, and Jetty 11 versions (see the branches with the
appropriate names).

Then there's also the general cookbook for Embedded Jetty that might help
you with specific topics as well.

https://github.com/jetty-project/embedded-jetty-cookbook

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).

Joakim Erdfelt / joa...@webtide.com


On Wed, Apr 27, 2022 at 10:16 AM Lothar Kimmeringer 
wrote:

> Hi,
>
> we have an appliation that uses Jetty in an embedded way since "the
> begin of the world" (the configuration files have had a DTD-declaration
> for Jetty 6... ;-)
>
> I'm in the process of migrating from 9.4 to 10.0 and after going the
> simple way by replacing the 9.4-jars with the jars of 10.0 the server
> is starting up, programmatically added servlets are executed but
> WARs loaded by the DeploymentManager lead to errors. I assume that
> this simple approach is the reason. When starting up the following
> messages show up:
>
> Starting HTTP-server 'Main Server'
> 16:36:21.005+0200 [main] INFO  org.eclipse.jetty.server.Server -
> jetty-10.0.9; built: 2022-03-30T16:46:32.527Z; git:
> a9eaf8d5d73369acf610ce88f850c0d56c4b1113; jvm 11.0.14+9-LTS
> 16:36:21.008+0200 [main] INFO  o.e.jetty.server.RequestLogWriter - Opened
> D:\ISDW_4_5\logs\2022_04_27.request.log
> 16:36:21.037+0200 [main] INFO  o.e.j.d.p.ScanningAppProvider - Deployment
> monitor [file:///D:/ISDW_4_5/webapps/]
> 16:36:21.103+0200 [main] INFO  o.e.j.a.AnnotationConfiguration - Error:
> for o.e.j.w.WebAppContext@32f1fafe
> {root,/,file:///D:/ISDW_4_5/webapps/root/,STARTING}{D:\ISDW_4_5\webapps\root}
> 16:36:21.107+0200 [main] INFO  o.e.j.a.AnnotationConfiguration - Error:
> for o.e.j.w.WebAppContext@32f1fafe
> {root,/,file:///D:/ISDW_4_5/webapps/root/,STARTING}{D:\ISDW_4_5\webapps\root}
> 16:36:21.112+0200 [main] INFO  o.e.j.w.StandardDescriptorProcessor - NO
> JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
> 16:36:21.129+0200 [main] WARN  org.eclipse.jetty.servlet.BaseHolder -
> Unable to load class org.eclipse.jetty.servlet.listener.ELContextCleaner
> java.lang.ClassNotFoundException:
> org.eclipse.jetty.servlet.listener.ELContextCleaner
>  at
> org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:531)
> [...]
> 16:36:21.133+0200 [main] WARN  o.eclipse.jetty.webapp.WebAppContext -
> Failed startup of context o.e.j.w.WebAppContext@32f1fafe
> {root,/,file:///D:/ISDW_4_5/webapps/root/,UNAVAILABLE}{D:\ISDW_4_5\webapps\root}
> javax.servlet.UnavailableException: Class loading error for holder
> org.eclipse.jetty.servlet.listener.ELContextCleaner@7061622
> {src=DESCRIPTOR:file:///D:/ISDW_4_5/etc/webdefault.xml}
>  at
> org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:104)
> [...]
> 16:36:21.159+0200 [main] INFO  o.e.jetty.server.AbstractConnector -
> Started ServerConnector@5d152bcd{HTTP/1.1, (http/1.1)}{0.0.0.0:80}
> 16:36:21.183+0200 [main] INFO  org.eclipse.jetty.server.Server - Started
> Main Server @30804ms
>
> I'm wondering about the claim that JettyJspServlet and ELContextCleaner
> can't be
> found. Both are in the classpath and can be found in the class starting
> the server
> (checked with Class.forName).
>
> What's the best way to embed Jetty 10? Resources online I've found only
> cover Jetty up to version 9. The online documentation (Operation
> and Programming don't mention Embedding at all - at least in the TOC).
>
>
> Thanks and best regards,
>
> Lothar Kimmeringer
> ___
> jetty-users mailing list
> jetty-users@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
>
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


[jetty-users] Webapps not loading after migration from 9.4 to 10.0

2022-04-27 Thread Lothar Kimmeringer

Hi,

we have an appliation that uses Jetty in an embedded way since "the
begin of the world" (the configuration files have had a DTD-declaration
for Jetty 6... ;-)

I'm in the process of migrating from 9.4 to 10.0 and after going the
simple way by replacing the 9.4-jars with the jars of 10.0 the server
is starting up, programmatically added servlets are executed but
WARs loaded by the DeploymentManager lead to errors. I assume that
this simple approach is the reason. When starting up the following
messages show up:

Starting HTTP-server 'Main Server'
16:36:21.005+0200 [main] INFO  org.eclipse.jetty.server.Server - jetty-10.0.9; 
built: 2022-03-30T16:46:32.527Z; git: a9eaf8d5d73369acf610ce88f850c0d56c4b1113; 
jvm 11.0.14+9-LTS
16:36:21.008+0200 [main] INFO  o.e.jetty.server.RequestLogWriter - Opened 
D:\ISDW_4_5\logs\2022_04_27.request.log
16:36:21.037+0200 [main] INFO  o.e.j.d.p.ScanningAppProvider - Deployment 
monitor [file:///D:/ISDW_4_5/webapps/]
16:36:21.103+0200 [main] INFO  o.e.j.a.AnnotationConfiguration - Error:  for 
o.e.j.w.WebAppContext@32f1fafe{root,/,file:///D:/ISDW_4_5/webapps/root/,STARTING}{D:\ISDW_4_5\webapps\root}
16:36:21.107+0200 [main] INFO  o.e.j.a.AnnotationConfiguration - Error:  for 
o.e.j.w.WebAppContext@32f1fafe{root,/,file:///D:/ISDW_4_5/webapps/root/,STARTING}{D:\ISDW_4_5\webapps\root}
16:36:21.112+0200 [main] INFO  o.e.j.w.StandardDescriptorProcessor - NO JSP 
Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
16:36:21.129+0200 [main] WARN  org.eclipse.jetty.servlet.BaseHolder - Unable to 
load class org.eclipse.jetty.servlet.listener.ELContextCleaner
java.lang.ClassNotFoundException: 
org.eclipse.jetty.servlet.listener.ELContextCleaner
at 
org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:531)
[...]
16:36:21.133+0200 [main] WARN  o.eclipse.jetty.webapp.WebAppContext - Failed 
startup of context 
o.e.j.w.WebAppContext@32f1fafe{root,/,file:///D:/ISDW_4_5/webapps/root/,UNAVAILABLE}{D:\ISDW_4_5\webapps\root}
javax.servlet.UnavailableException: Class loading error for holder 
org.eclipse.jetty.servlet.listener.ELContextCleaner@7061622{src=DESCRIPTOR:file:///D:/ISDW_4_5/etc/webdefault.xml}
at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:104)
[...]
16:36:21.159+0200 [main] INFO  o.e.jetty.server.AbstractConnector - Started 
ServerConnector@5d152bcd{HTTP/1.1, (http/1.1)}{0.0.0.0:80}
16:36:21.183+0200 [main] INFO  org.eclipse.jetty.server.Server - Started Main 
Server @30804ms

I'm wondering about the claim that JettyJspServlet and ELContextCleaner can't be
found. Both are in the classpath and can be found in the class starting the 
server
(checked with Class.forName).

What's the best way to embed Jetty 10? Resources online I've found only
cover Jetty up to version 9. The online documentation (Operation
and Programming don't mention Embedding at all - at least in the TOC).


Thanks and best regards,

Lothar Kimmeringer
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


Re: [jetty-users] webapps

2019-11-25 Thread Greg Wilkins
The order is determined by the scanner mechanism which has a map iterator.
The order is thus indeterminate.

If an order is needed, then you probably need to replace the deployer with
a fixed XML that adds each of your webapps in order.





On Tue, 26 Nov 2019 at 06:17,  wrote:

> Hi,
>
> is the a way to specify the order in which the applications in webapps
> should be started? Or is there a build in order which i don't know about?
>
> Regards
> walter
> --
> My projects:
>
> Admin Boundaries of the World 
> Missing Boundaries
> 
> Emergency Map 
> Postal Code Map (Germany only) 
> Fools (QA for zipcodes in Germany) 
> Postcode Boundaries of Germany
> 
> OSM Software Watchlist
> 
> ___
> jetty-users mailing list
> jetty-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users



-- 
Greg Wilkins  CTO http://webtide.com
___
jetty-users mailing list
jetty-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

[jetty-users] webapps

2019-11-25 Thread wambacher

Hi,

is the a way to specify the order in which the applications in webapps 
should be started? Or is there a build in order which i don't know about?


Regards
walter

--
My projects:

Admin Boundaries of the World 
Missing Boundaries 


Emergency Map 
Postal Code Map (Germany only) 
Fools (QA for zipcodes in Germany) 
Postcode Boundaries of Germany 
OSM Software Watchlist 

___
jetty-users mailing list
jetty-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users