What is the meaning of $$$view in java log file?

后端 未结 1 1961
耶瑟儿~
耶瑟儿~ 2021-01-26 01:45

I got an exception with a stack trace containing the following line

my.company.Service$$$view26.myMethod(Unknown Source)

Can anybody help me to u

相关标签:
1条回答
  • 2021-01-26 02:34

    A dollar sign ($, one or multiple) means that it is a generated class.

    CDI (Weld 1.x in case of EAP 6.4 you are using) is one of the 'frameworks' which uses this pattern. It creates proxies based on your classes in order to allow for interception decoration and bean injection. All generated classes will have the same package name and class name and will be appended by the magical dollar affixes. My guess is that you came across it with some CDI functionality.

    Also some of the JBoss logging frameworks (probably used in either Weld or other EAP part) allowed to create an automated logger classes based on annotations. The creation of these loggers was also based on adding the $ affix to class name.

    It is a common practice and allows to 'easily' (not really easy though) identify generated classes. Although I cannot dig up any official requirement that generated classes should have this.

    0 讨论(0)
提交回复
热议问题