From users-return-264691-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Wed May 9 21:09:01 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 1F9C1180649 for ; Wed, 9 May 2018 21:09:00 +0200 (CEST) Received: (qmail 85924 invoked by uid 500); 9 May 2018 19:08:59 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 85913 invoked by uid 99); 9 May 2018 19:08:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 May 2018 19:08:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9E78D1807C4 for ; Wed, 9 May 2018 19:08:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.88 X-Spam-Level: * X-Spam-Status: No, score=1.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JbAD6AUrqkgA for ; Wed, 9 May 2018 19:08:56 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id F370E5FB59 for ; Wed, 9 May 2018 19:08:55 +0000 (UTC) Received: by mail-lf0-f46.google.com with SMTP id j193-v6so52522052lfg.6 for ; Wed, 09 May 2018 12:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ALndlSEjwPcJ8Z0Hd4fBqKhnSVc3MfHXRhLP2mQnWbY=; b=vDL/UzO4Ryywl2aDlIL1Dsv006NN5tYTQAUsg+sDyCgpKEMCOgqsdsw0L4A12LTsYC Eavf7fFla4n2U9fynlIkB9fq1+de+1BEg+ui9xQ86EtTnPEPrcKZUMx/v8wr3r4wP6uv t4orHWAW3vDJC4SqHLJxdTXm0aTVsaTHv+9DiZEEtOPGly0UYNpOFjxKOfj0mZbjy/GG UisN5ammhJiOFH9Hyx6prqsuOVabiQGkWW70dIj0i6lKKUUav9Bfbm7Nx2v6xVuTSQp2 Uoone9r+NZ+foySxXHSLlr/OElIK3kWKApLrGNJ7l2+Ql0ZOsCzdKf7DF4vprwnrByEn YHqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ALndlSEjwPcJ8Z0Hd4fBqKhnSVc3MfHXRhLP2mQnWbY=; b=q8USO4/6wBqOLciCptCNG8P9cyFgKnJY3ZXzCzHmdlf/yAqABOZVJlUIYeCd5XLFBm nQRi7qNp3lf/Q8vqg6KXb6DTgFmZzwTbCqwVpUvS+KAySIgYwp5sCTGlmqVsrOlnT/AI qZk0C9y0dwJMBnBCnTFezQEX6/jJbE0gvmPGy5x8gv13/yLtF7qrL1rrjXDEG6c3xUcv LzpUgw/dI3xIBRhAz7iPZODG8uoIPJNs9o2Nmy7Ei0tYbIyYcMfCDHFkgqrZ/dYOogeR ZTEXDBeYsExBEJ1oauD1Dul4x1t1BcGQ+mYKpUwxH/EsdNa4OXSx/7gsZlLuYfGgJ6Qd u1fg== X-Gm-Message-State: ALKqPwdDJ4ko+MTz6U+9gNTmjT7cvIl3uP9t7fJ94UpCRhcqk/Gi6Tng dcxzXHMq17OwqHqeAwr1CX6BKKoB4owaFH3bN2V8DQ== X-Google-Smtp-Source: AB8JxZpAYigTscZVnGMB2KFi3g9D43MzBV/zq/3WPzSrtMA0jvzGMAgo3SqwnPeNAiVYtVZltJ+jQfhozNoQxHh4Bxs= X-Received: by 2002:a19:f4d:: with SMTP id e74-v6mr10992686lfi.39.1525892934941; Wed, 09 May 2018 12:08:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.93.21 with HTTP; Wed, 9 May 2018 12:08:54 -0700 (PDT) In-Reply-To: References: From: Xavier Dupont Date: Wed, 9 May 2018 21:08:54 +0200 Message-ID: Subject: Re: Which maven provided dependencies to target Tomcat ? To: Tomcat Users List Content-Type: multipart/alternative; boundary="0000000000005a4093056bcaa2d8" --0000000000005a4093056bcaa2d8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Luis, I'm sorry to say that if you use javaee-web-api on Tomcat, you will pull, among others, javax.transaction:javax.transaction-api:1.2 which contains, for example, javax.transaction.HeuristicCommitException and if you try to put resp.getWriter.println(HeuristicCommitException.class.getName()); your IDE won't complain but the servlet will throw a ClassNotFound exception at runtime. This assuming javax.transaction.HeuristicCommitException is not brought by some other dependency. You will get the same result with many other dependencies of javaee-web-api= . I actually performed the same experience with all 17 dependencies of javaee-web-api, selecting one arbitrary class and checking if it was found when deployed on tomcat, and I found that only the following should be included in a project which targets tomcat 8.5 / Java EE 7 javax.el javax.el-api 3.0.0 provided javax.servlet javax.servlet-api 3.1.0 provided javax.servlet.jsp javax.servlet.jsp-api 2.3.1 provided javax.websocket javax.websocket-api 1.0 provided javax.annotation javax.annotation-api 1.2 provided Xavier 2018-05-09 18:17 GMT+02:00 Luis Rodr=C3=ADguez Fern=C3=A1ndez : > Hello Xavier, > > Perhaps you can have a look here: > https://wiki.apache.org/tomcat/Specifications. > > Me, I have: > > > javax > javaee-web-api > 7.0 > provided > > > Hope it helps, > > Luis > > > > > > 2018-05-09 16:35 GMT+02:00 Xavier Dupont : > > > Hi guys. > > > > If I want to target the Java EE full profile, I use go here > > https://mvnrepository.com/artifact/javax/javaee-api/8.0 and get the > > following XML snippet. > > > > > > javax > > javaee-api > > 8.0 > > provided > > > > > > If I want to target the Java EE web profile, I use this url instead > > https://mvnrepository.com/artifact/javax/javaee-web-api/8.0 > > > > And if I only need a subset of JSRs included in the javaee web profile, > > they are all nicely included in the list of compile dependencies, this = is > > all very nice. > > > > Since tomcat only supports a subset of the web profile, which > dependencies > > should be added in maven ? > > > > Here's the full list for the Java EE 7 Web profile. > > > > javax.annotation:javax.annotation-api:1.2 > > javax.ejb:javax.ejb-api:3.2 > > javax.el:javax.el-api:3.0.0 > > javax.enterprise:cdi-api:1.1 > > javax.faces:javax.faces-api:2.2 > > javax.inject:javax.inject:1 > > javax.interceptor:javax.interceptor-api:1.2 > > javax.json:javax.json-api:1.0 > > javax.servlet:javax.servlet-api:3.1.0 > > javax.servlet.jsp:javax.servlet.jsp-api:2.3.1 > > javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1 > > javax.transaction:javax.transaction-api:1.2 > > javax.validation:validation-api:1.1.0.Final > > javax.websocket:javax.websocket-api:1.0 > > javax.ws.rs:javax.ws.rs-api:2.0 > > org.eclipse.persistence:javax.persistence:2.1.0 > > org.glassfish:javax.faces:2.2.0 > > > > I ask because I couldn't find the answer on the web, and it seems to me > > that many sources are actually quite wrong and how it should be done. > > I believe this should appear in a section of the tomcat documentation, = at > > least for versions 6, 7, and 8 of Java EE, which Tomcat seems to track. > > > > Xavier. > > > > > > -- > > "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better." > > - Samuel Beckett > --0000000000005a4093056bcaa2d8--