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

Jboss fix jsr77 #1549

Merged
merged 2 commits into from Oct 17, 2023
Merged

Jboss fix jsr77 #1549

merged 2 commits into from Oct 17, 2023

Conversation

obenkenobi
Copy link
Contributor

@obenkenobi obenkenobi commented Oct 13, 2023

Overview

Adds a new system property called com.newrelic.jboss.jsr77.fix. Setting the system property to true fixes an issue where customers using JBoss EAP/Wildfly and cannot startup their application if the J2EE Management API (i.e. JSR-77) is used. For example:

-Dcom.newrelic.jboss.jsr77.fix=true

This works by preventing the agent from labeling package javax.management as a system package in JBoss/Wildfly servers.
As a consequence, if you set that system property to true and are using JBoss EAP 7.4 or Wildfly 23-26, you will need to add additional configuration for the JBoss module io.undertow.servlet so the agent fully instruments your application. In particular you will need to edit the XML file modules/system/layers/base/io/undertow/servlet/main/module.xml.

Within the XML file, inside the body of <dependencies> add the XML element: <module name="java.management"/>.

Here is an example XML snippet for JBoss EAP 7.4:

<module name="io.undertow.servlet" xmlns="urn:jboss:module:1.9">
    <resources>
        <resource-root path="undertow-servlet-2.2.5.Final-redhat-00001.jar"/>
    </resources>

    <dependencies>
        <module name="javax.annotation.api"/>
        <module name="sun.jdk"/>
        <module name="javax.servlet.api"/>
        <module name="javax.servlet.jsp.api"/>
        <module name="javax.servlet.jstl.api"/>
        <module name="org.jboss.logging"/>
        <module name="io.undertow.core"/>
        <module name="org.jboss.xnio"/>
        <module name="jdk.unsupported"/>
        <module name="java.management"/>
    </dependencies>
</module>

Related Github Issue

#1524

Testing

The agent includes a suite of tests which should be used to
verify your changes don't break existing functionality. These tests will run with
Github Actions when a pull request is made. More details on running the tests locally can be found
here,

Checks

  • Your contributions are backwards compatible with relevant frameworks and APIs.
  • Your code does not contain any breaking changes. Otherwise please describe.
  • Your code does not introduce any new dependencies. Otherwise please describe.

@codecov-commenter
Copy link

Codecov Report

Merging #1549 (eb27b15) into main (ed52520) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #1549      +/-   ##
============================================
+ Coverage     70.61%   70.62%   +0.01%     
- Complexity     9780     9782       +2     
============================================
  Files           816      816              
  Lines         39419    39423       +4     
  Branches       5978     5979       +1     
============================================
+ Hits          27837    27844       +7     
+ Misses         8882     8880       -2     
+ Partials       2700     2699       -1     
Files Coverage Δ
...ain/java/com/newrelic/agent/config/JbossUtils.java 53.84% <100.00%> (+8.39%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@obenkenobi obenkenobi merged commit cad7865 into main Oct 17, 2023
103 checks passed
@obenkenobi obenkenobi deleted the jboss-fix-jsr77 branch May 2, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants