Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Tried to run Jetty Maven plugin in external mode, failed.

See video for resolution of same error.

https://youtu.be/HpWnnG0XDpk
5:00 


It may be you just need to make an addition  to specify 
<scope>provided</scope>



On Sun, 4 Apr 2021, 05:56 hantsy bai, <hantsy@xxxxxxxxx> wrote:
I have tried to run my weld 4/mojarra 3/ jersey using jetty maven plugin, it failed in the default deployMode(embed).

I changed to use `External` today, still failed, due to the classloader issues from different classes.

My Jetty Maven plugin configuration.
<profile>
<id>jetty</id>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<deployMode>EXTERNAL</deployMode>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webApp>
<contextPath>/${project.artifactId}</contextPath>
</webApp>
<jettyHome>${env.JETTY_HOME}</jettyHome>
<modules>jdni,jsp,servlet,glasssfis-jstl,websocket-jakarta,cdi-decorate</modules>
</configuration>
<dependencies>

</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<!-- <dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-cdi</artifactId>
<version>${jetty.version}</version>
</dependency>-->
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>${jakarta.servlet.jsp.jstl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.json</artifactId>
<version>${jakarta.json.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
<version>${jakarta.el.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>

And when I ran the application:

mvn clean package jetty:run-war -Pjetty

And the got the following error.

2021-04-04 12:35:44.000:WARN :oejw.WebAppContext:main: Failed startup of context o.e.j.m.p.MavenWebAppContext@a82c5f1{/jakartaee9-servlet-starter-boilerplate,[file:///D:/hantsylabs/jak
artaee9-servlet-starter-boilerplate/target/jakartaee9-servlet-starter-boilerplate/, jar:file:///D:/hantsylabs/jakartaee9-servlet-starter-boilerplate/target/jakartaee9-servlet-starter-b
oilerplate/WEB-INF/lib/jakarta.faces-3.0.0.jar!/META-INF/resources],UNAVAILABLE}{D:\hantsylabs\jakartaee9-servlet-starter-boilerplate\target\jakartaee9-servlet-starter-boilerplate.war}

java.lang.LinkageError: loader constraint violation: when resolving interface method 'void jakarta.servlet.jsp.JspApplicationContext.addELResolver(jakarta.el.ELResolver)' the class loa
der org.eclipse.jetty.webapp.WebAppClassLoader @68dc098b of the current class, org/jboss/weld/environment/servlet/WeldServletLifecycle, and the class loader org.eclipse.jetty.start.Cla
sspath$Loader @3043fe0e for the method's defining class, jakarta/servlet/jsp/JspApplicationContext, have different Class objects for the type jakarta/el/ELResolver used in the signatur
e (org.jboss.weld.environment.servlet.WeldServletLifecycle is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @68dc098b, parent loader org.eclipse.jetty.start.Cl
asspath$Loader @3043fe0e; jakarta.servlet.jsp.JspApplicationContext is in unnamed module of loader org.eclipse.jetty.start.Classpath$Loader @3043fe0e, parent loader 'app')
        at org.jboss.weld.environment.servlet.WeldServletLifecycle.initialize(WeldServletLifecycle.java:221)
        at org.jboss.weld.environment.servlet.EnhancedListener.onStartup(EnhancedListener.java:62)
        at org.eclipse.jetty.servlet.ServletContainerInitializerHolder.doStart(ServletContainerInitializerHolder.java:148)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
        at org.eclipse.jetty.servlet.ServletContextHandler$ServletContainerInitializerStarter.doStart(ServletContextHandler.java:1660)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:369)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1304)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:880)
        at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:306)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:532)
        at org.eclipse.jetty.maven.plugin.MavenWebAppContext.doStart(MavenWebAppContext.java:294)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:40)
        at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:183)
        at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:516)
        at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:151)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:169)
        at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:439)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:57)
        at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:756)
        at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:722)
        at org.eclipse.jetty.util.Scanner.scan(Scanner.java:629)
        at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:517)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
        at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:141)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:605)
        at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:246)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
        at org.eclipse.jetty.server.Server.start(Server.java:469)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:89)
        at org.eclipse.jetty.server.Server.doStart(Server.java:414)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
        at org.eclipse.jetty.xml.XmlConfiguration.lambda$main$4(XmlConfiguration.java:1855)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1798)
        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.start.Main.invokeMain(Main.java:226)
        at org.eclipse.jetty.start.Main.start(Main.java:502)
        at org.eclipse.jetty.start.Main.main(Main.java:73)
2021-04-04 12:35:44.035:INFO :oejs.AbstractConnector:main: Started ServerConnector@1b15f922{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2021-04-04 12:35:44.067:INFO :oejs.Server:main: Started Server@3feb2dda{STARTING}[11.0.2,sto=5000] @7608ms


Hantsy Bai

Self-employed consultant, fullstack developer, agile coach

GitHub: https://github.com/hantsy

Twitter: https://twitter.com/@hantsy

Medium: https://medium.com/@hantsy
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top