AppD Archive

How to install appdynamics on jboss 7

CommunityUser
Splunk Employee
Splunk Employee

Hi all,

Is it possible to install appdynamics on jboss 7?

When I'm trying to use the agent as explained in the installation manual, my application crashes: instrumentation classes from the appdymanic jar itself are not visible to jboss application clasloader.

Probably it's something very simple - but I can't access the appdynamic manuals - even after registering, access denied.

Thanks for the help!

Alex

0 Karma
1 Solution

Arun_Dasetty
Super Champion

Hi Alex,

Thanks for writing to appsphere forum, please find the response to your queries inline:

>>>>> Is it possible to install appdynamics on jboss 7?

Answer:  Yes,

>>>>> When I'm trying to use the agent as explained in the installation manual, my application crashes: instrumentation classes from the appdymanic jar itself are not visible to jboss application clasloader.


Answer: The JBoss application server versions 7.x and later uses OSGI architecture. By default, OSGi containers follow a specific model for bootstrap class delegation. Classes that are not specified in the container's CLASSPATH are not delegated to the bootstrap classloader; therefore you must configure the OSGi containers for the App Server Agent classes.

http://litedocs.appdynamics.com/display/ADLite/OSGi+Infrastructure

http://docs.appdynamics.com/display/PRO13S/JBoss+Startup+Settings

Please find the steps to configure agent on jboss server 7.x, listed here for your convenience as you are not able to access docs:

===============================================================================
To add the javaagent command in a Windows environment for JBoss AS 7.x

1. Open the bin\standalone.conf file.

2. Search for the line JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman" and the com.singularity ad org.jboss.logmanager packages to that line as follows:
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,com.singularity,org.jboss.logmanager"

3. Open the bin\standalone.conf.bat file.

4. Search for the following line:
[code}
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman
 

Add the package com.singularity to that line as follows:
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.singularity"

5. Save the file.
6. Open the standalone.bat file.
7. Add the following javaagent argument to the standalone.bat file.
:RESTART
"%JAVA%" -javaagent:<AGENT-DIR>javaagent.jar %JAVA_OPTS% ^
"-Dorg.jboss.boot.log.file=%JBOSS_HOME%\standalone\log\boot.log" ^
"-Dlogging.configuration=file:%JBOSS_HOME%/standalone/configuration/logging.properties" ^
-jar "%JBOSS_HOME%\jboss-modules.jar" ^

8. Save the file.

===============================================================================
To add the javaagent command in a Linux environment for JBoss AS 7.x

1. Open the standalone.conf file.

2. Search for the following line in standalone.conf.
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman"

Add the com.singularity and org.jboss.logmanager packages to that line as follows:
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,com.singularity,org.jboss.logmanager"

For JBoss 7.1.1, add the additional packages as shown here:
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,com.appdynamics,com.appdynamics.,com.singularity,com.singularity.,org.jboss.logmanager"

3. Add the following to the end of the standalone.conf file in the JAVA_OPTION section.
-Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:<JBOSS-DIR>/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar
:<JBOSS-DIR>/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar
:<JBOSS-DIR>/modules/org/jboss/logmanager/log4j/main/log4j-1.2.16.jar

Note: The path for the necessary JAR files may differ for different versions. Provide the correct path of these JAR files for your version. If any of the packages are not available with the JBoss ZIP, download the missing package and add it to the path.

4. In the standalone.sh file, add the following javaagent argument.
export JAVA_OPTS="$JAVA_OPTS -javaagent:/agent_install_dir/javaagent.jar"

above the following section of standalone.sh
...
while true;do
if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "X" ]; then
   # Execute the JVM in the foreground
      eval \"$JAVA\" -D\"[Standalone]\"$JAVA_OPTS \
     \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/boot.log\" \
     \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \
      -jar \"$JBOSS_HOME/jboss-modules.jar\" \
      
===============================================================================

Please let us know how it goes once you configured agent as per above steps, Do write back to us for further assistance

Thanks,

Arun

View solution in original post

0 Karma

Arun_Dasetty
Super Champion

Hi Alex,

Thanks for writing to appsphere forum, please find the response to your queries inline:

>>>>> Is it possible to install appdynamics on jboss 7?

Answer:  Yes,

>>>>> When I'm trying to use the agent as explained in the installation manual, my application crashes: instrumentation classes from the appdymanic jar itself are not visible to jboss application clasloader.


Answer: The JBoss application server versions 7.x and later uses OSGI architecture. By default, OSGi containers follow a specific model for bootstrap class delegation. Classes that are not specified in the container's CLASSPATH are not delegated to the bootstrap classloader; therefore you must configure the OSGi containers for the App Server Agent classes.

http://litedocs.appdynamics.com/display/ADLite/OSGi+Infrastructure

http://docs.appdynamics.com/display/PRO13S/JBoss+Startup+Settings

Please find the steps to configure agent on jboss server 7.x, listed here for your convenience as you are not able to access docs:

===============================================================================
To add the javaagent command in a Windows environment for JBoss AS 7.x

1. Open the bin\standalone.conf file.

2. Search for the line JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman" and the com.singularity ad org.jboss.logmanager packages to that line as follows:
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,com.singularity,org.jboss.logmanager"

3. Open the bin\standalone.conf.bat file.

4. Search for the following line:
[code}
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman
 

Add the package com.singularity to that line as follows:
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.singularity"

5. Save the file.
6. Open the standalone.bat file.
7. Add the following javaagent argument to the standalone.bat file.
:RESTART
"%JAVA%" -javaagent:<AGENT-DIR>javaagent.jar %JAVA_OPTS% ^
"-Dorg.jboss.boot.log.file=%JBOSS_HOME%\standalone\log\boot.log" ^
"-Dlogging.configuration=file:%JBOSS_HOME%/standalone/configuration/logging.properties" ^
-jar "%JBOSS_HOME%\jboss-modules.jar" ^

8. Save the file.

===============================================================================
To add the javaagent command in a Linux environment for JBoss AS 7.x

1. Open the standalone.conf file.

2. Search for the following line in standalone.conf.
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman"

Add the com.singularity and org.jboss.logmanager packages to that line as follows:
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,com.singularity,org.jboss.logmanager"

For JBoss 7.1.1, add the additional packages as shown here:
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,com.appdynamics,com.appdynamics.,com.singularity,com.singularity.,org.jboss.logmanager"

3. Add the following to the end of the standalone.conf file in the JAVA_OPTION section.
-Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xbootclasspath/p:<JBOSS-DIR>/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.2.GA.jar
:<JBOSS-DIR>/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar
:<JBOSS-DIR>/modules/org/jboss/logmanager/log4j/main/log4j-1.2.16.jar

Note: The path for the necessary JAR files may differ for different versions. Provide the correct path of these JAR files for your version. If any of the packages are not available with the JBoss ZIP, download the missing package and add it to the path.

4. In the standalone.sh file, add the following javaagent argument.
export JAVA_OPTS="$JAVA_OPTS -javaagent:/agent_install_dir/javaagent.jar"

above the following section of standalone.sh
...
while true;do
if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "X" ]; then
   # Execute the JVM in the foreground
      eval \"$JAVA\" -D\"[Standalone]\"$JAVA_OPTS \
     \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/boot.log\" \
     \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \
      -jar \"$JBOSS_HOME/jboss-modules.jar\" \
      
===============================================================================

Please let us know how it goes once you configured agent as per above steps, Do write back to us for further assistance

Thanks,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Update:

Thanks, that works with two remarks:

1) org.jboss.logmanager as system pacjage is not necessary

2) -XX:-UserSplitVerifier is required.

Kind regards,

Alex

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

I've discovered the only one necesary think you have to do is to add two below lines into standalone.conf:

JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=org.jboss.byteman,com.singularity"
JAVA_OPTS="$JAVA_OPTS -javaagent:/home/raf/AppServerAgent/javaagent.jar"

for Unix systems

or

set "JAVA_OPTS= -Djboss.modules.system.pkgs=org.jboss.byteman,com.singularity"
set "JAVA_OPTS= -javaagent:/home/raf/AppServerAgent/javaagent.jar"

for Windows

Cheers,

Rafał Ch.

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi,

Thank you for the answer.

Unfortunatelly doesn't work:

--------------------------------------------------------------------

16:48:31,676 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 69) MSC000001: Failed to start service jboss.persistenceunit."pmo-occ-ear.ear/pmo-occ-ejb-0.0.1-SNAPSH
OT.jar#pmo-occ-ejb": org.jboss.msc.service.StartException in service jboss.persistenceunit."pmo-occ-ear.ear/pmo-occ-ejb-0.0.1-SNAPSHOT.jar#pmo-occ-ejb": java.lang.NoClassDefFoundEr
ror: com/singularity/ee/agent/appagent/entrypoint/bciengine/FastMethodInterceptorDelegator
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:100) [jboss-as-jpa-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
        at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA-redhat-2.jar:2.0.0.GA-redhat-2]
Caused by: java.lang.NoClassDefFoundError: com/singularity/ee/agent/appagent/entrypoint/bciengine/FastMethodInterceptorDelegator
        at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java)
        at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:70)
        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:242)
        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:117)
        at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
        at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2279)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2275)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1744)
        at org.hibernate.ejb.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:94)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:197) [jboss-as-jpa-7.1.3.Final-redhat-4.jar:7.1.3
.Final-redhat-4]
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$500(PersistenceUnitServiceImpl.java:57) [jboss-as-jpa-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:96) [jboss-as-jpa-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
        ... 4 more
0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...