Giter Site home page Giter Site logo

Comments (11)

gregw avatar gregw commented on May 27, 2024

@janbartel what did we do to fix this?

from docker-jetty.

janbartel avatar janbartel commented on May 27, 2024

@gregw in jetty-9.4 we have the mail.mod module, which puts javax.mail.glassfish-1.4.1.v201005082020.jar onto the container classpath. That jar contains both the javax.mail apis and the impl. This is tested and working in jdk-11 and beyond.

For jetty-10.0 we have removed the mail.mod module altogether. If users wish to use a javax.mail service the they need to provide their own jar/s, preferably by making their own mail mod file.

See also jetty issue eclipse/jetty.project#2960.

from docker-jetty.

bcmedeiros avatar bcmedeiros commented on May 27, 2024

Any chances of having some Jetty 10 preview images? I really don't have a workaround without a baseline Docker image that supports Java 11 and doesn't break email.

from docker-jetty.

bcmedeiros avatar bcmedeiros commented on May 27, 2024

Workaround for now:

FROM jetty:9.4-jre11
...
# workaround for https://github.com/appropriate/docker-jetty/issues/108
USER root
RUN rm -rf /usr/local/jetty/lib/mail
USER jetty

from docker-jetty.

gregw avatar gregw commented on May 27, 2024

@brunojcm we should be doing an jetty-10-alpha1 release next week, so I'll try to get a docker image going as well.... feel free to hassle me if I forget!

from docker-jetty.

bcmedeiros avatar bcmedeiros commented on May 27, 2024

@gregw, thanks for the update! Let me know if you need some help testing.

from docker-jetty.

vmassol avatar vmassol commented on May 27, 2024

@gregw in jetty-9.4 we have the mail.mod module, which puts javax.mail.glassfish-1.4.1.v201005082020.jar onto the container classpath. That jar contains both the javax.mail apis and the impl. This is tested and working in jdk-11 and beyond.

@janbartel Hi. You seem to be saying that Jetty 9.4 fixes the problem on JDK11+. However on the XWiki project we're using the Jetty docker image 9 tag (which corresponds to 9.4.27 as of today). Yet we still have the issue, see eclipse/jetty.project#2960 (comment)

11:16:11.618 [tc-okhttp-stream-1150574999] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: Caused by: java.lang.NoClassDefFoundError: javax/activation/DataSource
11:16:11.618 [tc-okhttp-stream-1150574999] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: 	at com.xpn.xwiki.plugin.mailsender.MailSenderPlugin.createMimeMessage(MailSenderPlugin.java:229)
...
Caused by: java.lang.ClassNotFoundException: javax.activation.DataSource
11:16:11.634 [tc-okhttp-stream-1150574999] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
11:16:11.634 [tc-okhttp-stream-1150574999] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
11:16:11.634 [tc-okhttp-stream-1150574999] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
11:16:11.635 [tc-okhttp-stream-1150574999] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: 	... 113 common frames omitted

Note that we bundle jakarta.activation-1.2.1.jar in XWiki's WEB-INF/lib directory.

So, is Jetty 9.4 supposed to fix the problem? If so I wonder why it's not working for us. Any idea?

Thanks!

from docker-jetty.

vmassol avatar vmassol commented on May 27, 2024

Found a solution thanks to a message from @janbartel :)

I've put the following in our jetty-web.xml:

  <Call name="prependSystemClass">
    <Arg>-javax.mail.</Arg>
  </Call>
  <Call name="prependServerClass">
    <Arg>javax.mail.</Arg>
  </Call>

And it worked :)

from docker-jetty.

joakime avatar joakime commented on May 27, 2024

@vmassol that's old school syntax (and deprecated)

Use ...

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Get name="systemClasspathPattern">
    <Call name="add"><Arg>-javax.mail.</Arg></Call>
  </Get>
  <Get name="serverClasspathPattern">
    <Call name="add"><Arg>javax.mail.</Arg></Call>
  </Get>

from docker-jetty.

vmassol avatar vmassol commented on May 27, 2024

@joakime Thanks a lot! I was too happy to have found a working workaround that I didn't notice it ;)

from docker-jetty.

joakime avatar joakime commented on May 27, 2024

This issue has been moved to the new Official Eclipse Jetty Docker repository.

See eclipse/jetty.docker#10

from docker-jetty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.