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

Here's a question that promagent can not work @Controller #8

Open
javazhangyi opened this issue Jul 18, 2019 · 1 comment
Open

Here's a question that promagent can not work @Controller #8

javazhangyi opened this issue Jul 18, 2019 · 1 comment

Comments

@javazhangyi
Copy link

No description provided.

@javazhangyi
Copy link
Author

javazhangyi commented Jul 18, 2019

it's show that “org.springframework.web.util.NestedServletException: Handler dispatch failed“,

i konw that spring classloader can not find class AnnotateInterceptor.class , this is my code

private static AgentBuilder applyHooks(AgentBuilder agentBuilder, SortedSet<HookMetadata> hookMetadata, ClassLoaderCache classLoaderCache) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        return agentBuilder.type(isAnnotatedWith(named("org.springframework.stereotype.Controller")))
                .transform(new AgentBuilder.Transformer() {
                    @Override
                    public DynamicType.Builder<?> transform(DynamicType.Builder<?> builder, TypeDescription typeDescription,
                                                            ClassLoader classLoader, JavaModule javaModule) {
                        return  builder
                                .method(ElementMatchers.any())
                                .intercept(MethodDelegation.to(AnnotateInterceptor.class));
                    }
                });

it's resource E:\Users\zhangyi_m\promagent3\promagent\promagent-framework\promagent-internal\src\main\java\io\promagent\internal\Promagent.java

i can‘t the better way to solve the problem

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

1 participant