← 输入框|github.com|刷新
Skip to content

Does Jython 2.7.4 Use Package Scanning In Log4j2? #377

Open

Description

@tbpassin

I use jython in a Tomcat servlet webapp. I upgraded from Jython 2.7.2 to 2.7.4 to make sure that the webapp still works, which it does. But I now get a warning message in Tomcat's log file that says that package scanning is deprecated:

main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release

My own code does not use scanning. Jython does use log4j2 for "internal" logging. Does jython 2.7.4 configure log4j2 to use package scanning? If so, can it be changed not to use it?

I was unable to find, in the jython.jar file, how logging is configured. I assume that happens during the ant build task.

[Later] I see that the log4j2 classes are all in the netty jar. Does Jython actually use netty's logging? If so, what gets logged?

Activity

  1. jeff5 commented on Apr 22, 2025

    @jeff5
    Member

    It doesn't consciously use log4j, only j.u.l. Netty logs things extensively, so I'm not surprised there may be references in there.

    However, it does scan packages to build a database that makes Java packages look like Python packages. This is so that java.util.List, for example, can be found by attribute access. I think it scans all the JARs it can find.

    I don't understand the connection between the two questions.

  2. tbpassin commented on Apr 22, 2025

    @tbpassin
    Author

    I had only found a reference to Log4j2 potentially scanning packages. The deprecation message I got in a Tomcat log warned that scanning packages to "locate plugins" would be removed in some future version. My concern is that my Jython servlet webapp might stop working in that future version.

    OTOH, the deprecation message sounds closely related to Tomcat operations, not the Jython-based servlet webapp. So I will have to learn more.

    BTW, my application uses java servlets that instantiate Jython classes as POJOs that do most of the work. This approach works really well and is much easier to write and develop than using all java would be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions