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

[Bug]: unwanted loglines REST client #2682

Open
hansva opened this issue Mar 17, 2023 · 11 comments
Open

[Bug]: unwanted loglines REST client #2682

hansva opened this issue Mar 17, 2023 · 11 comments

Comments

@hansva
Copy link
Contributor

hansva commented Mar 17, 2023

Apache Hop version?

2.4

Java version?

11

Operating system

Windows

What happened?

Migration: https://issues.apache.org/jira/browse/HOP-4643

Regression in version 2.2.0, when REST Client is called, following output is written to stderr regardless logging level

Nov 29, 2022 4:46:47 PM org.glassfish.jersey.message.internal.MessagingBinders$EnabledProvidersBinder bindToBinder
WARNING: A class javax.activation.DataSource for a default provider MessageBodyWriter<javax.activation.DataSource> was not found. The provider is not available.

Issue Priority

Priority: 3

Issue Component

Component: Transforms

@data-vader
Copy link

Hi, as a workaround, is it possible to fix this error by installing the required org.glassfish.message.interal JAR-File?

@mkhludnev
Copy link
Member

found this explanation in another project eclipse-ee4j/jaxb-ri#1222

@mkhludnev
Copy link
Member

Btw, how to tweak logs to suppress a certain logging category?

@hansva
Copy link
Contributor Author

hansva commented May 27, 2023

We have slf4j in the application, by default we add slf4j-nop but you could use slf4j-log4j or another bridge and a configuration file to tweak your own logging

@mkhludnev
Copy link
Member

That Jersey's messages go through JUL. So, I've made a file fixlog.properties

org.glassfish.jersey.message.internal.MessagingBinders.level=SEVERE

then pass it via set "HOP_OPTIONS=-Xmx2048m -Djava.util.logging.config.file=fixlog.properties"
After this hop-run goes without such noise.

@data-vader
Copy link

Thank you @mkhludnev.

Since Java is not my familiar programming language, I have tried to adjust the dependancy in the pom.xml for the rest-transform. So far unfortunately without success, because building/compiling throws an error.

Did i understand you correctly? All I have to do is, to extend the HOP_OPTIONS with in the hop-run.sh with "Djava.util.logging.config.file=fixlog.properties" to avoid the error-messages?

@mkhludnev
Copy link
Member

Hi, @data-vader
Right. Create properties file as described above, and then refer to it via -D note dash matters.
For the reference:
https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogManager.html
https://docs.oracle.com/javase/6/docs/technotes/tools/windows/java.html

@mkhludnev
Copy link
Member

Another approach is to forward JUL to slf4j however it might hurt performance https://www.slf4j.org/api/org/slf4j/bridge/SLF4JBridgeHandler.html

@mkhludnev
Copy link
Member

it seems like it's fixed in jersey eclipse-ee4j/jersey#5165

@mkhludnev
Copy link
Member

Can't we just bump https://github.com/apache/hop/blob/master/engine/pom.xml#L43 to 2.38 ?

@mkhludnev
Copy link
Member

Right. I rebuild master with jersey:2.38 run GUI with HTTPPost transform and got WARN only once.

2023/06/06 18:43:02 - Fake data - products.0 - Finished processing (I=0, O=0, R=10, W=10, U=0, E=0)
Jun 06, 2023 6:43:03 PM org.glassfish.jersey.message.internal.MessagingBinders$EnabledProvidersBinder bindToBinder
WARNING: A class javax.activation.DataSource for a default provider MessageBodyWriter<javax.activation.DataSource> was not found. The provider is not available.
2023/06/06 18:43:05 - Index products.0 - Finished processing (I=0, O=0, R=10, W=10, U=0, E=0)

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

No branches or pull requests

3 participants