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

I am unable to collect URL for my application pega always showing as /NULL #11224

Open
srinath6132 opened this issue Jul 4, 2024 · 4 comments

Comments

@srinath6132
Copy link

Version 2.5.4

Intalled through Docker

Null

Alwaying showing as NULL data for URL statistics while other inspector, metrc are working fine

Please help on this

@srinath6132
Copy link
Author

Failed to load plugin class com.navercorp.pinpoint.plugin.commons.dbcp.CommonsDbcpPlugin$DatasourceTransformCallback with classLoader com.pega.pegarules.bootstrap.loader.PRAppLoader@27bbe773
java.lang.reflect.InvocationTargetException: null
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at com.navercorp.pinpoint.profiler.instrument.classloading.URLClassLoaderHandler.addPluginURLIfAbsent(URLClassLoaderHandler.java:96) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.instrument.classloading.URLClassLoaderHandler.injectClass(URLClassLoaderHandler.java:63) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.instrument.classloading.JarProfilerPluginClassInjector.injectClass(JarProfilerPluginClassInjector.java:62) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext.injectClass(PluginInstrumentContext.java:158) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.plugin.DynamicTransformCallbackProvider.getTransformCallback(DynamicTransformCallbackProvider.java:49) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.plugin.MatchableClassFileTransformerDelegate.transform(MatchableClassFileTransformerDelegate.java:63) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.transformer.BaseClassFileTransformer.transform(BaseClassFileTransformer.java:56) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.transformer.DefaultClassFileTransformerDispatcher.transform(DefaultClassFileTransformerDispatcher.java:89) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.context.javamodule.ClassFileTransformerModuleHandler.transform(ClassFileTransformerModuleHandler.java:54) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.bootstrap.java9.module.ClassFileTransformerModuleWrap.transform(ClassFileTransformerModuleWrap.java:44) ~[?:2.5.4]
at sun.instrument.TransformerManager.transform(TransformerManager.java:188) ~[?:?]
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563) ~[?:?]
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
at java.lang.ClassLoader.defineClass(ClassLoader.java:1022) ~[?:?]
at com.pega.pegarules.bootstrap.loader.PRAppLoader.findClassInternal(PRAppLoader.java:830) ~[?:?]
at com.pega.pegarules.bootstrap.loader.PRAppLoader.findClass(PRAppLoader.java:373) ~[?:?]
at com.pega.pegarules.bootstrap.loader.PRAppLoader.loadClassInternal(PRAppLoader.java:700) ~[?:?]
at com.pega.pegarules.bootstrap.loader.PRAppLoader.loadClass(PRAppLoader.java:625) ~[?:?]
at com.pega.pegarules.bootstrap.loader.PRAppLoader.loadClass(PRAppLoader.java:550) ~[?:?]
at com.pega.platform.datastore.connection.internal.JndiDataSourceInformationProvider.setAppServerValues(JndiDataSourceInformationProvider.java:45) ~[?:?]
at com.pega.platform.datastore.connection.internal.JndiDataSourceInformationProvider.getInfo(JndiDataSourceInformationProvider.java:36) ~[?:?]
at com.pega.platform.datastore.connection.internal.jdbc.JdbcConnectionManager.getConnectionInfo(JdbcConnectionManager.java:212) ~[?:?]
at com.pega.pegarules.data.internal.store.ConnectionBrokerAdapter.getConnectionInformation(ConnectionBrokerAdapter.java:1504) ~[?:?]
at com.pega.pegarules.data.internal.store.ConnectionBrokerRouter.getConnectionInformation(ConnectionBrokerRouter.java:121) ~[?:?]
at com.pega.pegarules.management.internal.system.operations.jobs.DatabaseManagementJob.getJSONArrayOfDataSources(DatabaseManagementJob.java:69) ~[?:?]
at com.pega.pegarules.management.internal.system.operations.jobs.DatabaseManagementJob.invokeOperation(DatabaseManagementJob.java:49) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at com.pega.pegarules.management.internal.system.operations.jobs.AbstractSystemOperationsJob$SystemOperationsJobRunnable.invokeMethodOnClass(AbstractSystemOperationsJob.java:116) ~[?:?]
at com.pega.pegarules.management.internal.system.operations.jobs.AbstractSystemOperationsJob$SystemOperationsJobRunnable.run(AbstractSystemOperationsJob.java:109) ~[?:?]
at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1381) ~[?:?]
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1124) ~[?:?]
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:931) ~[?:?]
at com.pega.pegarules.management.internal.system.operations.jobs.AbstractSystemOperationsJob.invoke(AbstractSystemOperationsJob.java:91) ~[?:?]
at com.pega.pegarules.management.internal.system.operations.jobs.AbstractSystemOperationsJob.execute(AbstractSystemOperationsJob.java:60) ~[?:?]
at com.pega.pegarules.management.internal.system.operations.jobs.AbstractSystemOperationsJob.execute(AbstractSystemOperationsJob.java:39) ~[?:?]
at com.pega.pegarules.cluster.external.PRPCTask.call(PRPCTask.java:130) ~[?:?]
at com.pega.pegarules.cluster.external.PRPCTask.call(PRPCTask.java:57) ~[?:?]
at com.pega.platform.remoteexecution.internal.RequestProcessor.run(RequestProcessor.java:56) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: java.lang.UnsupportedOperationException: addURL not supported for PRAppLoader
at com.pega.pegarules.bootstrap.loader.PRAppLoader.addURL(PRAppLoader.java:340) ~[?:?]
... 48 more
07-04 15:43:49.049 [ejob-executor-2] WARN n.p.p.i.c.JarProfilerPluginClassInjector -- Failed to load plugin class com.navercorp.pinpoint.plugin.commons.dbcp.CommonsDbcpPlugin$DatasourceTransformCallback with classLoader com.pega.pegarules.bootstrap.loader.PRAppLoader@27bbe773
com.navercorp.pinpoint.exception.PinpointException: Failed to load plugin class com.navercorp.pinpoint.plugin.commons.dbcp.CommonsDbcpPlugin$DatasourceTransformCallback with classLoader com.pega.pegarules.bootstrap.loader.PRAppLoader@27bbe773
at com.navercorp.pinpoint.profiler.instrument.classloading.URLClassLoaderHandler.injectClass(URLClassLoaderHandler.java:68) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.instrument.classloading.JarProfilerPluginClassInjector.injectClass(JarProfilerPluginClassInjector.java:62) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.plugin.PluginInstrumentContext.injectClass(PluginInstrumentContext.java:158) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.plugin.DynamicTransformCallbackProvider.getTransformCallback(DynamicTransformCallbackProvider.java:49) ~[pinpoint-profiler-2.5.4.jar:2.5.4]
at com.navercorp.pinpoint.profiler.plugin.MatchableClassFileTransformerDelegate.transform(MatchableClassFileTransformerDelegate.java:63) ~[pinpoint-profiler-2.5.4.jar:2.5.4]

@emeroad
Copy link
Member

emeroad commented Jul 5, 2024

The problem is caused by not supporting the PEGA framework.
PRAppLoader is not allowing addURL to be called.
Can you check if there is a related option?

It looks like you need to modify the code below.

    // JarProfilerPluginClassInjector.java
    public <T> Class<? extends T> injectClass(ClassLoader classLoader, String className) {
        try {
            if (bootstrapCore.isBootstrapPackage(className)) {
                return bootstrapCore.loadClass(className);
            }
            if (classLoader == null) {
                return bootstrapClassLoaderHandler.injectClass(null, className);
            } else if (classLoader instanceof URLClassLoader) {
                final URLClassLoader urlClassLoader = (URLClassLoader) classLoader;
                return urlClassLoaderHandler.injectClass(urlClassLoader, className);
            } else {
                return plainClassLoaderHandler.injectClass(classLoader, className);
            }
        } catch (Throwable e) {
            // fixed for LinkageError
            logger.warn("Failed to load plugin class {} with classLoader {}", className, classLoader, e);
            throw new PinpointException("Failed to load plugin class "   className   " with classLoader "   classLoader, e);
        }
    }

@srinath6132
Copy link
Author

i have builded this pinpoint-profiler-3.0.1-SNAPSHOT.jar seems new it is newer version can i deploy the same , Also i just modified code, still getting same /NULL values, can you please give some guidlines to get my pegapp url statistics

package com.navercorp.pinpoint.profiler.instrument.classloading;

import com.navercorp.pinpoint.exception.PinpointException;
import com.navercorp.pinpoint.profiler.instrument.InstrumentEngine;
import com.navercorp.pinpoint.profiler.plugin.PluginConfig;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.InputStream;
import java.net.URLClassLoader;
import java.util.Objects;

public class JarProfilerPluginClassInjector implements ClassInjector {
private final Logger logger = LogManager.getLogger(JarProfilerPluginClassInjector.class);

private final BootstrapCore bootstrapCore;
private final ClassInjector bootstrapClassLoaderHandler;
private final ClassInjector urlClassLoaderHandler;
private final ClassInjector plainClassLoaderHandler;
private final ClassInjector pegaClassLoaderHandler;

public JarProfilerPluginClassInjector(PluginConfig pluginConfig, InstrumentEngine instrumentEngine, BootstrapCore bootstrapCore) {
    Objects.requireNonNull(pluginConfig, "pluginConfig");

    this.bootstrapCore = Objects.requireNonNull(bootstrapCore, "bootstrapCore");
    this.bootstrapClassLoaderHandler = new BootstrapClassLoaderHandler(pluginConfig, instrumentEngine);
    this.urlClassLoaderHandler = new URLClassLoaderHandler(pluginConfig);
    this.plainClassLoaderHandler = new PlainClassLoaderHandler(pluginConfig);
    this.pegaClassLoaderHandler = new PegaClassLoaderHandler(pluginConfig); // Initialize Pega-specific handler
}

@Override
@SuppressWarnings("unchecked")
public <T> Class<? extends T> injectClass(ClassLoader classLoader, String className) {
    try {
        if (bootstrapCore.isBootstrapPackage(className)) {
            return bootstrapCore.loadClass(className);
        }
        if (classLoader == null) {
            return bootstrapClassLoaderHandler.injectClass(null, className);
        } else if (classLoader instanceof URLClassLoader) {
            final URLClassLoader urlClassLoader = (URLClassLoader) classLoader;
            return urlClassLoaderHandler.injectClass(urlClassLoader, className);
        } else if (classLoader.getClass().getName().equals("com.pega.pegarules.internal.bootstrap.PRAppLoader")) {
            return pegaClassLoaderHandler.injectClass(classLoader, className);
        } else {
            return plainClassLoaderHandler.injectClass(classLoader, className);
        }
    } catch (Throwable e) {
        logger.warn("Failed to load plugin class {} with classLoader {}", className, classLoader, e);
        throw new PinpointException("Failed to load plugin class "   className   " with classLoader "   classLoader, e);
    }
}

@Override
public InputStream getResourceAsStream(ClassLoader targetClassLoader, String internalName) {
    try {
        if (bootstrapCore.isBootstrapPackageByInternalName(internalName)) {
            return bootstrapCore.openStream(internalName);
        }
        if (targetClassLoader == null) {
            return bootstrapClassLoaderHandler.getResourceAsStream(null, internalName);
        } else if (targetClassLoader instanceof URLClassLoader) {
            final URLClassLoader urlClassLoader = (URLClassLoader) targetClassLoader;
            return urlClassLoaderHandler.getResourceAsStream(urlClassLoader, internalName);
        } else if (targetClassLoader.getClass().getName().equals("com.pega.pegarules.internal.bootstrap.PRAppLoader")) {
            return pegaClassLoaderHandler.getResourceAsStream(targetClassLoader, internalName);
        } else {
            return plainClassLoaderHandler.getResourceAsStream(targetClassLoader, internalName);
        }
    } catch (Throwable e) {
        logger.warn("Failed to load plugin resource as stream {} with classLoader {}", internalName, targetClassLoader, e);
        return null;
    }
}

}

image

@srinath6132
Copy link
Author

HI team,
This Message is for my previous mesage, Could anyone please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants