Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jakarta ee 8 integration #900

Merged
merged 57 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c5596cf
impelementation jakarta jax-rs (#896)
tbradellis Jun 28, 2022
58e4439
actually add changes (#898)
tbradellis Jun 29, 2022
1190dee
fixed compile deps (#899)
tbradellis Jun 29, 2022
6996802
back jax-rs for jak ee8
tbradellis Jun 29, 2022
357481b
Merge pull request #901 from newrelic/fix-jax-rs-again
tbradellis Jun 29, 2022
3cea953
more errors in changes (#902)
tbradellis Jun 29, 2022
43e5c15
Fix jax rs again (#903)
tbradellis Jun 30, 2022
6c85afb
Update dependency for cxf-2.7
jasonjkeller Jun 30, 2022
3826422
Merge pull request #904 from newrelic/cxf-jakarta-ee-8
jasonjkeller Jun 30, 2022
baf89ef
use existing dep for j-client (#905)
tbradellis Jun 30, 2022
9af22ec
Update servlet instrumentation dependency and verifier
jasonjkeller Jul 6, 2022
1de6f3c
Merge pull request #908 from newrelic/servlet-jakarta-8
jasonjkeller Jul 6, 2022
de79d73
Update servlet dependency and verifier
jasonjkeller Jul 6, 2022
35e8279
Merge pull request #909 from newrelic/servlet-user
jasonjkeller Jul 6, 2022
fa8da02
Update dependency and verifier for jsp-2.4
jasonjkeller Jul 7, 2022
80042b1
Merge pull request #910 from newrelic/jsp-jakarta-8
jasonjkeller Jul 7, 2022
aa81351
Update dependency and verifier for ejb-3.0
jasonjkeller Jul 7, 2022
ef25cd7
Merge pull request #911 from newrelic/ejb-jakarta
jasonjkeller Jul 7, 2022
1a1be1e
jersey build wth jakartajar (#912)
tbradellis Jul 7, 2022
9762700
Revert "jersey build wth jakartajar (#912)" (#913)
tbradellis Jul 7, 2022
b51c456
Update jms dependency and verifier
jasonjkeller Jul 8, 2022
de9d928
Merge pull request #914 from newrelic/jms-jakarta
jasonjkeller Jul 8, 2022
bab3121
Update wildfly CAT dependency
jasonjkeller Jul 8, 2022
514f459
Merge pull request #915 from newrelic/wildfly-cat-jakarta
jasonjkeller Jul 8, 2022
92ea610
Update wildfly-port dependencies
jasonjkeller Jul 8, 2022
bb3f0af
Merge pull request #916 from newrelic/wildfly-port-jakarta
jasonjkeller Jul 8, 2022
0aa4de3
Update wildfly-8 dependencies
jasonjkeller Jul 8, 2022
8da96dd
Merge pull request #917 from newrelic/wildfly-8-jakarta
jasonjkeller Jul 8, 2022
953358a
Update tomcat-request-listener dependencies
jasonjkeller Jul 8, 2022
e6cb2bd
Merge pull request #918 from newrelic/tomcat-request-listener-jakarta
jasonjkeller Jul 8, 2022
4a3ad50
Update tomcat-8.5.2 dependencies
jasonjkeller Jul 9, 2022
d30232e
Merge pull request #919 from newrelic/tomcat-8.5.2-jakarta
jasonjkeller Jul 9, 2022
e4e74bb
Update glassfish dependecies and verifier
jasonjkeller Jul 11, 2022
4fc7295
Merge pull request #922 from newrelic/glassfish-jakarta
jasonjkeller Jul 11, 2022
0173a0d
Update jboss dependencies and verifier
jasonjkeller Jul 11, 2022
e08af1e
Merge pull request #923 from newrelic/jboss-jakarta
jasonjkeller Jul 11, 2022
4f8fa44
revert jetty version change (#924)
tbradellis Jul 11, 2022
596a034
Fix jersey (#925)
tbradellis Jul 11, 2022
ce7e665
add hk2 inject dependency (#926)
tbradellis Jul 12, 2022
f3bffb2
jakarta.xml (#927)
tbradellis Jul 12, 2022
7eb4d2d
Update spring-jms dependencies and verifier
jasonjkeller Jul 12, 2022
191d1c6
Merge pull request #928 from newrelic/spring-jms-jakarta
jasonjkeller Jul 12, 2022
e8e21e3
Update spring-ws dependencies and verifier
jasonjkeller Jul 12, 2022
c761de7
Merge pull request #929 from newrelic/spring-ws-jakarta
jasonjkeller Jul 12, 2022
8e7f437
Merge branch 'main' into jakarta-ee-8-integration
meiao Jul 13, 2022
7d3f9f0
Merge pull request #930 from newrelic/merging-main-to-jakarta-8
jasonjkeller Jul 13, 2022
d538347
Update jetty-servlet-9 dependencies and verifier
jasonjkeller Jul 13, 2022
0caea81
Merge pull request #932 from newrelic/jetty-servlet-9-jakarta
jasonjkeller Jul 13, 2022
7806c26
Jetty 10 instrumentation support updated (#936)
tbradellis Jul 15, 2022
fd5e02e
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into j…
jasonjkeller Jul 18, 2022
5a8bb77
Add comment to jetty-servlet isntrumentation
jasonjkeller Jul 18, 2022
d837986
Update was liberty dependency
jasonjkeller Jul 18, 2022
8f3bcff
Merge pull request #940 from newrelic/webshpere-jakarta
jasonjkeller Jul 18, 2022
17a2e85
update settings.gradle
tbradellis Jul 18, 2022
7f79c38
Fixes for jetty-10 instrumentation
jasonjkeller Jul 21, 2022
d7f1922
Merge pull request #943 from newrelic/jetty-10-fix
jasonjkeller Jul 21, 2022
0364791
Add copyright header
jasonjkeller Jul 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions functional_test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ dependencies {
testImplementation("com.sun.jersey:jersey-core:1.9.1")
testImplementation("javax.xml:jaxrpc-api:1.1")

// Removed from the JDK starting in Java 11
testImplementation("javax.xml.bind:jaxb-api:2.3.0")
testImplementation("jakarta.xml.ws:jakarta.xml.ws-api:2.3.3")

testImplementation("org.apache.derby:derby:10.10.1.1")
testImplementation("org.apache.struts:struts-core:1.3.5")
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/akka-http-2.11_2.4.5/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
testImplementation(project(":instrumentation:akka-2.2")) { transitive = false }
testImplementation(project(":instrumentation:scala-2.9.3")) { transitive = false }
testImplementation("com.jayway.restassured:rest-assured:2.7.0")
testImplementation("javax.xml.bind:jaxb-api:2.3.0")
testImplementation("jakarta.xml.ws:jakarta.xml.ws-api:2.3.3")
}

verifyInstrumentation {
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/akka-http-2.13_10.1.8/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {
testImplementation(project(":instrumentation:akka-2.2")) { transitive = false }
testImplementation(project(":instrumentation:scala-2.13.0")) { transitive = false }
testImplementation("com.jayway.restassured:rest-assured:2.7.0")
testImplementation("javax.xml.bind:jaxb-api:2.3.0")
testImplementation("jakarta.xml.ws:jakarta.xml.ws-api:2.3.3")
}

verifyInstrumentation {
Expand Down
5 changes: 2 additions & 3 deletions instrumentation/cxf-2.7/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
dependencies {
implementation(project(":agent-bridge"))

implementation("org.apache.cxf:cxf-api:2.7.11")
implementation("org.apache.cxf:cxf-rt-bindings-soap:2.7.11")
implementation("org.apache.cxf:cxf-rt-bindings-soap:3.5.3")
}

jar {
manifest { attributes 'Implementation-Title': 'com.newrelic.instrumentation.cxf-2.7' }
}

verifyInstrumentation {
passes 'org.apache.cxf:cxf-rt-bindings-soap:[2.1.3,)'
passesOnly 'org.apache.cxf:cxf-rt-bindings-soap:[2.1.3,)'
}

site {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import com.newrelic.api.agent.weaver.Weaver;
import com.nr.agent.instrumentation.cxf27.CxfSoapUtils;
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.interceptor.Fault;

@Weave
public class SoapOutInterceptor {
Expand Down
5 changes: 3 additions & 2 deletions instrumentation/ejb-3.0/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

dependencies {
implementation(project(":agent-bridge"))
implementation("javax:javaee-api:6.0")
implementation("jakarta.platform:jakarta.jakartaee-api:8.0.0")
}

jar {
Expand All @@ -11,9 +11,10 @@ jar {
verifyInstrumentation {
excludeRegex '.*-RC[0-9]+$'
passesOnly 'javax:javaee-api:[6.0,)'
passesOnly 'jakarta.platform:jakarta.jakartaee-api:[8.0.0,9.0.0)'
}

site {
title 'EJB'
type 'Framework'
}
}
14 changes: 11 additions & 3 deletions instrumentation/glassfish-3/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies {
implementation(project(":agent-bridge"))

implementation("javax.servlet:javax.servlet-api:3.0.1")
implementation("org.glassfish.main.web:web-core:3.1.2")
implementation("org.eclipse.persistence:javax.persistence:2.0.5")
implementation("jakarta.servlet:jakarta.servlet-api:4.0.4")
implementation("org.glassfish.main.web:web-core:5.1.0")
implementation("org.eclipse.persistence:javax.persistence:2.2.1")
}

jar {
Expand All @@ -23,6 +23,14 @@ verifyInstrumentation {
passes 'org.glassfish.main.web:web-core:5.0'
passes 'org.glassfish.main.web:web-core:5.0.1'
passes 'org.glassfish.main.web:web-core:5.1.0'
fails 'org.glassfish.main.web:web-core:6.0.0'
fails 'org.glassfish.main.web:web-core:6.1.0'
fails 'org.glassfish.main.web:web-core:6.2.0'
fails 'org.glassfish.main.web:web-core:6.2.1'
fails 'org.glassfish.main.web:web-core:6.2.2'
fails 'org.glassfish.main.web:web-core:6.2.3'
fails 'org.glassfish.main.web:web-core:6.2.4'
fails 'org.glassfish.main.web:web-core:6.2.5'
}

site {
Expand Down
9 changes: 5 additions & 4 deletions instrumentation/jax-rs-1.0/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
dependencies {
implementation(project(":agent-bridge"))
implementation("javax.ws.rs:javax.ws.rs-api:2.1")
implementation("jakarta.ws.rs:jakarta.ws.rs-api:2.1.6")
implementation ("org.glassfish.jersey.inject:jersey-hk2:2.28")

testImplementation("org.glassfish.jersey.containers:jersey-container-servlet:2.16")
testImplementation("org.glassfish.jersey.test-framework:jersey-test-framework-core:2.16")
testImplementation("org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.16")
testImplementation("org.glassfish.jersey.containers:jersey-container-servlet:2.28")
testImplementation("org.glassfish.jersey.test-framework:jersey-test-framework-core:2.28")
testImplementation("org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.28")
testImplementation(project(":instrumentation:jersey-2"))
}

Expand Down
7 changes: 3 additions & 4 deletions instrumentation/jboss-7/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ repositories {

dependencies {
implementation(project(":agent-bridge"))

implementation("org.jboss.web:jbossweb:7.0.0.Final")
implementation("javax.servlet:javax.servlet-api:3.0.1")
implementation("org.jboss.web:jbossweb:7.5.10.Final")
implementation("jakarta.servlet:jakarta.servlet-api:4.0.4")
}

jar {
Expand All @@ -18,7 +17,7 @@ jar {

verifyInstrumentation {
passes('org.jboss.web:jbossweb:[7.0,)') {
compile("javax.servlet:javax.servlet-api:3.0.1")
compile("jakarta.servlet:jakarta.servlet-api:4.0.4")
}
excludeRegex(".*(Alpha|Beta|CR).*")
exclude("org.jboss.web:jbossweb:7.5.6.Final") // this appears to be a bad release that was excluded from multiple repos
Expand Down
16 changes: 10 additions & 6 deletions instrumentation/jersey-2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
dependencies {
implementation(project(":agent-bridge"))
implementation(project(":newrelic-api"))
implementation("org.glassfish.jersey.core:jersey-server:2.0-m13-3")
implementation("org.glassfish.jersey.core:jersey-server:2.28")

testImplementation("com.jayway.restassured:rest-assured:2.7.0")
testImplementation("org.eclipse.jetty:jetty-server:9.4.6.v20170531")
testImplementation("org.eclipse.jetty:jetty-servlet:9.4.6.v20170531")
testImplementation("org.glassfish.jersey.core:jersey-server:2.25.1")
testImplementation("org.glassfish.jersey.containers:jersey-container-servlet-core:2.25.1")
testImplementation("org.glassfish.jersey.containers:jersey-container-jetty-http:2.25.1")
testImplementation("org.glassfish.jersey.containers:jersey-container-servlet:2.25.1")
testImplementation("javax.xml.bind:jaxb-api:2.3.0")
testImplementation("org.glassfish.jersey.core:jersey-server:2.28")
testImplementation("org.glassfish.jersey.containers:jersey-container-servlet-core:2.28")
testImplementation("org.glassfish.jersey.containers:jersey-container-jetty-http:2.28")
testImplementation("org.glassfish.jersey.containers:jersey-container-servlet:2.28")
testImplementation('org.glassfish.jersey.inject:jersey-hk2:2.28')
testImplementation("jakarta.xml.bind:jakarta.xml.bind-api:2.3.3")

}

jar {
manifest { attributes 'Implementation-Title': 'com.newrelic.instrumentation.jersey-2' }
}

// org.glassfish.jersey.core 2.28 version starts pulling in jakarata jar named dependencies.
// Version 3.0.0-M1 starts pulling in jakarata with renamed jar and packages
verifyInstrumentation {
passesOnly 'org.glassfish.jersey.core:jersey-server:[2.0,3.0.0-M1)'
exclude 'org.glassfish.jersey.core:jersey-server:[2.0-m05-2,2.0)'
Expand Down
8 changes: 5 additions & 3 deletions instrumentation/jersey-client-2.26/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
dependencies {
implementation(project(":agent-bridge"))
implementation(project(":newrelic-api"))
implementation("org.glassfish.jersey.core:jersey-client:2.26")
testImplementation("org.glassfish.jersey.inject:jersey-hk2:2.26")
testImplementation("org.glassfish.jersey.core:jersey-common:2.26")
implementation("org.glassfish.jersey.core:jersey-client:2.28")

testImplementation("org.glassfish.jersey.inject:jersey-hk2:2.28")
testImplementation("org.glassfish.jersey.core:jersey-common:2.28")

}

jar {
Expand Down
31 changes: 31 additions & 0 deletions instrumentation/jetty-10/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

dependencies {
implementation(project(":agent-bridge"))

implementation("org.eclipse.jetty:jetty-server:10.0.11")
}

jar {
manifest { attributes 'Implementation-Title': 'com.newrelic.instrumentation.jetty-10' }
}

verifyInstrumentation {
passesOnly 'org.eclipse.jetty:jetty-server:[10.0.0-alpha1,11.0.0-alpha0)'
}

site {
title 'Jetty'
type 'Appserver'
}

// Jetty Server 10 is only compatible with Java 11+
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}

compileJava {
options.fork = true
options.bootstrapClasspath = null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
*
* * Copyright 2022 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package com.nr.agent.instrumentation.jetty10;

import com.newrelic.agent.bridge.AgentBridge;
import org.eclipse.jetty.server.HttpChannelState;

import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener;
import java.io.IOException;

public final class AsyncListenerFactory {

/*
* The public enum Action was added in 9.1 and does not exist in 9.0.*. So declaring a variable of this type is
* sufficient to prevent this instrumentation module from loading in 9.0.*.
*/
public static HttpChannelState.Action isPostJetty90 = null;

private AsyncListenerFactory() {
}

private static final AsyncListener ASYNC_LISTENER = new AsyncListener() {

@Override
public void onComplete(AsyncEvent asyncEvent) throws IOException {
AgentBridge.asyncApi.completeAsync(asyncEvent.getAsyncContext());
}

@Override
public void onTimeout(AsyncEvent asyncEvent) throws IOException {
// do nothing
}

@Override
public void onError(AsyncEvent asyncEvent) throws IOException {
AgentBridge.asyncApi.errorAsync(asyncEvent.getAsyncContext(), asyncEvent.getThrowable());
}

@Override
public void onStartAsync(AsyncEvent asyncEvent) throws IOException {
// do nothing
}

};

public static AsyncListener getAsyncListener() {
return ASYNC_LISTENER;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
*
* * Copyright 2022 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package com.nr.agent.instrumentation.jetty10;

import com.newrelic.api.agent.ExtendedRequest;
import com.newrelic.api.agent.HeaderType;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;

public class JettyRequest extends ExtendedRequest {
private final HttpServletRequest request;

public JettyRequest(HttpServletRequest request) {
super();
this.request = request;
}

@Override
public String getRequestURI() {
return request.getRequestURI();
}

@Override
public String getHeader(String name) {
return request.getHeader(name);
}

@Override
public String getRemoteUser() {
return request.getRemoteUser();
}

@Override
public Enumeration getParameterNames() {
return request.getParameterNames();
}

@Override
public String[] getParameterValues(String name) {
return request.getParameterValues(name);
}

@Override
public Object getAttribute(String name) {
return request.getAttribute(name);
}

@Override
public String getCookieValue(String name) {
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {
return cookie.getValue();
}
}
}
return null;
}

@Override
public HeaderType getHeaderType() {
return HeaderType.HTTP;
}

@Override
public String getMethod() {
return request.getMethod();
}

@Override
public List<String> getHeaders(String name) {
Enumeration headers = request.getHeaders(name);
if (headers == null) {
return Collections.emptyList();
}
return Collections.list(headers);
}
}
Loading