Hello everyone,

I tried to pass my web application (eclipse project) from maven 7 to maven 9 version(9.3.7.v20160115).

I changed the necessary settings in the various files, but when starting jetty with the eclipse jetty-maven-plugin launching the command jetty:run I got the error when loading the WebAppContext file specified in jetty-env.xml:

the error message is
-------------------------------

|java.lang.IllegalArgumentException: Object of class 'org.eclipse.jetty.maven.plugin.JettyWebAppContext' is not of type 'org.eclipse.jetty.webapp.WebAppContext'. Object Class and type Class are from different loaders. in file:/xx/WebApp/src/main/webapp/WEB-INF/jetty-env.xml at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:295) at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:245) at org.eclipse.jetty.plus.webapp.EnvConfiguration.configure(EnvConfiguration.java:116)|

-------------------------------

Following the instructions for configuring JNDI connections with jetty i specified jetty-env.xml as follow:

|<Configureid='wac'class="org.eclipse.jetty.webapp.WebAppContext"><Newid="resInspector"class="org.eclipse.jetty.plus.jndi.Resource"><Arg><Refrefid="wac"/></Arg><Arg>jdbc/xxx</Arg><Arg><Newclass="org.apache.commons.dbcp.BasicDataSource"><Setname="driverClassName">org.postgresql.Driver</Set><Setname="url">jdbc:postgresql://xx:5432/xx</Set><Setname="username">xx</Set><Setname="password">xx</Set><Setname="maxActive">100</Set><Setname="maxIdle">30</Set><Setname="maxWait">-1</Set><Setname="defaultAutoCommit">false</Set></New></Arg></New></Configure>|


any idea what is set wrong?

In the source code I see in line 292 of the class org.eclipse.jetty.xml.XmlConfiguration in subclass JettyXmlConfiguration the condition that an IllegalArgumentException is thrown, when the condition oClass != null && !oClass.isInstance(obj) is fulfilled.
There are compared the two classes
org.eclipse.jetty.maven.plugin.JettyWebAppContext and org.eclipse.jetty.webapp.WebAppContext. The former being a subclass of the second one.

thanks for your suggestions

Markus
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to