java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor

已查看 342 次
跳至第一个未读帖子

Hantsy Bai

未读,
2022年1月1日 08:10:002022/1/1
收件人 Codehaus Cargo
Hi,
In these days, I tried to write some testing codes of Spring 6, and used cargo to deploy war to an embedded Jetty server.

My development stack is:

JakartaEE 9.10
Spring 6.0.0-M1
cargo plugin 1.9.9
Java 17

The cargo:run command raised an exception like this.

>2022-01-01 21:00:59.038:WARN :oejw.WebAppContext:Thread-2: Failed startup of context o.e.j.w.WebAppContext@2be49c8c{/demo,file:///D:/hantsylabs/spring6-sandbox/jpa/target/demo/,UNAVAIL
ABLE}{D:\hantsylabs\spring6-sandbox\jpa\target\demo.war}
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
        at org.eclipse.jetty.annotations.AnnotationConfiguration.createAnnotationParser(AnnotationConfiguration.


My  cargo embedded jetty is configured like this, I have tried to add asm as deps, did not work.

<profile>
<id>jetty</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
<version>${cargo-maven3-plugin.version}</version>
<configuration>
<container>
<containerId>jetty11x</containerId>
<type>embedded</type>
</container>
<configuration>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.logging>low</cargo.logging>
</properties>
</configuration>
</configuration>
<dependencies>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.3.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>

The complete configuration is here:

S. Ali Tokmen

未读,
2022年1月1日 08:46:522022/1/1
收件人 codehau...@googlegroups.com

Hi Hantsy

Happy new year!

The embedded containers have many limitations, one being that they only contain the minimal amount of dependencies and hence are unlikely to cope with complex cases without you manually adding these dependencies.

Is there a reason why you don't go for a standalone local configuration? It will be much more stable.

Regards

S. Ali Tokmen
https://ali.tokmen.com/
https://contact.ali.tokmen.com/
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/563d0cc8-a88a-4542-8ac3-c948db7dfb69n%40googlegroups.com.

hantsy bai

未读,
2022年1月2日 03:32:362022/1/2
收件人 codehau...@googlegroups.com
Thanks, switched to use `artifactInstaller` to get a copy of the jetty dist, the error disappeared.

Hantsy Bai

Self-employed consultant, fullstack developer, agile coach

GitHub: https://github.com/hantsy

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

Medium: https://medium.com/@hantsy


You received this message because you are subscribed to a topic in the Google Groups "Codehaus Cargo" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codehaus-cargo/HXOshWQONnY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/7a0927e5-b3b2-994d-16c7-37346d198afc%40alishomepage.com.

S. Ali Tokmen

未读,
2022年1月2日 09:25:102022/1/2
收件人 codehau...@googlegroups.com

Hi Hantsy

Excellent news 😁 The standalone local configuration comes with the advantages around configurability and packagability, while thanks to the artifactInstaller you can choose between versions of Jetty.

Enjoy!

hantsy bai

未读,
2022年1月2日 10:18:562022/1/2
收件人 codehau...@googlegroups.com
Configured another integration test using standalone configuration, https://github.com/hantsy/spring6-sandbox/blob/master/jpa/pom.xml#L476

Hantsy Bai

Self-employed consultant, fullstack developer, agile coach

GitHub: https://github.com/hantsy

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

Medium: https://medium.com/@hantsy

S. Ali Tokmen

未读,
2022年1月2日 11:57:482022/1/2
收件人 codehau...@googlegroups.com

Hi Hantsy

Looks good, though I see the profiles jetty, tomcat and wildfly use the artifactInstaller while the profiles it-jetty, it-tomcat and it-wildfly use an extra step with the maven-dependency-plugin. Is there a reason you chose that approach?

hantsy bai

未读,
2022年1月3日 00:49:422022/1/3
收件人 codehau...@googlegroups.com
No reason, just try different configurations, and use dependency maven plugin to download a copy to simplify configuration when running on a CI server.

Regards,

Hantsy Bai

Self-employed consultant, fullstack developer, agile coach

GitHub: https://github.com/hantsy

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

Medium: https://medium.com/@hantsy

S. Ali Tokmen

未读,
2022年1月3日 11:34:422022/1/3
收件人 codehau...@googlegroups.com

Hi Hantsy

Excellent - Overall, well done!

Regards

回复全部
回复作者
转发
0 个新帖子