Coder Social home page Coder Social logo

Comments (10)

raphw avatar raphw commented on June 23, 2024 1

That's strange then. I'd activate logging of class loading on the JVM level and see if I can stitch it together based on that.

from byte-buddy.

raphw avatar raphw commented on June 23, 2024

Are you retransforming? If so, a class might be loaded when matching it. What does the log say? Does the missing class show up at all?

from byte-buddy.

fuckeversec avatar fuckeversec commented on June 23, 2024

I didn't retransforming the class.

the matcher code is belong, use nameStartsWith to filter class.

agentBuilder.type(nameStartsWith("com.pay"))
                .transform(new JacksonFieldDesensitizingTransformer())

SendCashReq class has a field recvBankCardNum annotate with Desensitization:

@Desensitization("BANKCARD_MASK")
private String recvBankCardNum;

the issue case log is:
INFO: 2024-02-01 17:33:47.267 [main] JacksonFieldDesensitizingTransformer - [logid:] [clientip:] [localip:] class com.pay.epic.api.model.vo.ActivityBankCardInfoVo rebased

the correct case log is:
INFO: 2024-02-01 22:24:10.984 [main] JacksonFieldDesensitizingTransformer - [logid:] [clientip:] [localip:] class com.pay.epic.service.client.req.SendCashReq rebased
INFO: 2024-02-01 22:24:11.473 [main] JacksonFieldDesensitizingTransformer - [logid:] [clientip:] [localip:] class com.pay.epic.api.model.vo.ActivityBankCardInfoVo rebased

Like the above log shows, the application has two class matched the matcher's rule. SendCashReq class wasn't rebased, That case was occered twice.

from byte-buddy.

raphw avatar raphw commented on June 23, 2024

To me it seems as if SendCashReq is already loaded in that case. Are you logging ignored classes? Any class passed to Byte Buddy would get logged here.

from byte-buddy.

fuckeversec avatar fuckeversec commented on June 23, 2024

I think the class was already loaded too. I didn't log this message. I restart the application and use jvm option to logging loaded class. The SendCashReq class was at very later. What kind of case that make the SendCashReq was loadded at the beginning even before the main class. I install bytebuddy instrument at the main method first line.

from byte-buddy.

raphw avatar raphw commented on June 23, 2024

Do you reference losded classes somewhere? Byte Buddy would not load it itself. Are you running premain? In this case the app should not even come up before installing the sgent.

from byte-buddy.

fuckeversec avatar fuckeversec commented on June 23, 2024

I use net.bytebuddy.agent.ByteBuddyAgent.install(), not running premain. But the install method is at first line in main method. I didn't reference SendCashReq on main classs.

from byte-buddy.

fuckeversec avatar fuckeversec commented on June 23, 2024

Hello, have you reproduced this issue? Have you identified the root cause of the problem?

from byte-buddy.

raphw avatar raphw commented on June 23, 2024

No, I have no opportunity to reproduce this problem. Did you try logging of class loading?

from byte-buddy.

fuckeversec avatar fuckeversec commented on June 23, 2024

I logging of class loading when restart the application in test enviroment, but the error doesn't occur.

from byte-buddy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.