Installation JBoss / WildFly

This page provides information on how inspectIT can be used with the JBoss application server.

If you use Docker, see here.

JBoss 6 & 7

 With the JBoss version 6 and above there is the problem with the logging when an agent that uses the java.util.logging is started with the JBoss. Please relate to JBoss 6.x, JBoss 7.xJBoss 8.x or WildFly 8.x.x - 10.x.x pages for information on how to overcome this problem when starting JBoss / WildFly with inspectIT Agent.

Instrumentation

There are two possibilities how to set-up and use inspectIT with the JBoss application server. The first solution is to start the JBoss application server stand-alone with a start-up script. The second one is to integrate inspectIT in the start-up process, integrated in the eclipse development environment.

Stand-alone solution

JBoss provides the file run.sh in the /bin directory to set the environment for starting up JBoss. inspectIT can be easily integrated within this file. A best practice is to define variables holding the references to the inspectIT installation and configuration folders.

set INSPECTIT_AGENT_HOME="[path-to-inspectit-agent]"
export INSPECTIT_AGENT_HOME

set INSPECTIT_JAVA_OPTS="-Xbootclasspath/p:${INSPECTIT_AGENT_HOME}/inspectit-agent.jar -javaagent:${INSPECTIT_AGENT_HOME}/inspectit-agent.jar -Dinspectit.repository=[REPOSIOTRY_IP]:[REPOSITORY_PORT] -Dinspectit.agent.name=[AGENT_DISPLAY_NAME]"
export INSPECTIT_JAVA_OPTS

# integrate inspectit java options with the java options of JBoss
set JAVA_OPTS="${INSPECTIT_JAVA_OPTS} ${JAVA_OPTS}"

Eclipse

To integrate inspectIT into the startup-process of the JBoss Applicationserver you have to edit the launch configuration of the JBoss application server. Please ensure that you have installed the JBoss server tools which you can find in the specific repository.

Open the "servers" view in eclipse and double-click on the JBoss application server instance. The server configuration overview is being displayed.

Click on "open launch configuration" and add the following line before the existing content in the "VM arguments" Textbox:

"-javaagent:[path-to-inspectit-agent]" "-Dinspectit.repository=[REPOSIOTRY_IP]:[REPOSITORY_PORT]" "-Dinspectit.agent.name=[AGENT_DISPLAY_NAME]"

Finally it should look similar to the following configuration:

NoClassDefFoundError

Only for versions up to 1.6.8

Special OSGi configuration does not have to be performed if you are using inspectIT version 1.6.9 or later.

If you are experiencing the java.lang.NoClassDefFoundError when inspectIT is attached to your application, you need to alter the  JBOSS_MODULES_SYSTEM_PKGS configuration property. This should only happen if you deactivate the class loading delegation option in the Environment configuration. Note that inspectIT version 1.6.8 has a known bug ( INSPECTIT-2119 - Getting issue details... STATUS ) so it's needed to alter the property anyway.

 

apigateway_1           | 17:36:38,629 ERROR [io.undertow.request] (default task-6) UT005023: Exception handling request to /index: javax.servlet.ServletException: java.lang.NoClassDefFoundError: rocks/inspectit/agent/java/Agent
apigateway_1           |        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
apigateway_1           |        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
apigateway_1           |        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)
apigateway_1           |        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
apigateway_1           |        at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:66)
apigateway_1           |        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
apigateway_1           |        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
apigateway_1           |        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
apigateway_1           |        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
apigateway_1           |        at io.undertow.jsp.JspFileHandler.handleRequest(JspFileHandler.java:32)
apigateway_1           |        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
apigateway_1           |        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
apigateway_1           |        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apigateway_1           |        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
apigateway_1           |        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
apigateway_1           |        at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)
apigateway_1           |        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apigateway_1           |        at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)
apigateway_1           |        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
apigateway_1           |        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
apigateway_1           |        at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)
apigateway_1           |        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
apigateway_1           |        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)
apigateway_1           |        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
apigateway_1           |        at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
apigateway_1           |        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apigateway_1           |        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
apigateway_1           |        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apigateway_1           |        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
apigateway_1           |        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)
apigateway_1           |        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)
apigateway_1           |        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)
apigateway_1           |        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)
apigateway_1           |        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)
apigateway_1           |        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)
apigateway_1           |        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
apigateway_1           |        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
apigateway_1           |        at java.lang.Thread.run(Thread.java:745)
apigateway_1           | Caused by: java.lang.NoClassDefFoundError: rocks/inspectit/agent/java/Agent
apigateway_1           |        at org.apache.jasper.servlet.JasperLoader.loadClass(Unknown Source)
apigateway_1           |        at org.wildfly.extension.undertow.deployment.UndertowJSPInstanceManager.newInstance(UndertowJSPInstanceManager.java:59)
apigateway_1           |        at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:143)
apigateway_1           |        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:321)
apigateway_1           |        at org.apache.jasper.servlet.JspServlet

Only needed thing is to edit the run.conf or standalone.conf file (depending on how you are starting). At the beginning of the file append the rocks.inspectit to the following line:

 

JBOSS_MODULES_SYSTEM_PKGS="org.jboss.logmanager,rocks.inspectit"