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

Check presence of JDK Class before instanciating JdkProvider #1129

Closed

Conversation

fabienbancharel
Copy link

Security needed, as Under Weblogic 10.3 Oracle Jdk 6, ClassNotFoundException is thrown only when current() is called, not at instanciation.

Security needed, as Under Weblogic 10.3 Oracle Jdk 6, ClassNotFoundException is thrown only when current() is called, not at instanciation.
@ryantenney
Copy link
Contributor

It appears there are one or more non-breaking spaces in the file:
[ERROR] /home/travis/build/dropwizard/metrics/metrics-core/src/main/java/com/codahale/metrics/ThreadLocalRandomProxy.java:[38,1] illegal character: '\u00a0'

@fabienbancharel
Copy link
Author

fabienbancharel commented May 11, 2017

I used the Github online editor, and copy / pasting in Notepad++, I don't see any special character.
I will try a full clone on my laptop.

Edit : Travis is ok now. Using the online editor maybe not a good idea.

@ryantenney ryantenney requested a review from arteam May 12, 2017 16:01
@ryantenney
Copy link
Contributor

Need to pull into 3.2 branch as well.

@fabienbancharel
Copy link
Author

I made a PR for 3.2-development branch : #1131

@arteam
Copy link
Member

arteam commented Jun 1, 2017

Sorry it took so long to review. Thank you for testing the library under Weblogic! It's great to hear from users from different environments. Regarding the fix, I think a better approach would be to do the same as for LongAdderProxy and call jdkProvider.current(), this should trigger the class loading even in secure environments. We also could catch Throwable instead of NoClassDefFoundError to be more robust and not leave the INSTANCE variable as null.

@fabienbancharel
Copy link
Author

I had not looked at LongAdderProxy (since no problem with it), but yes, it would be consistent to use the same code. So, will you fix ThreadLocalRandom (at least in 3.1-maintenance), or do you expect me to commit it ? Thanks.

@arteam
Copy link
Member

arteam commented Jun 2, 2017

Great! I will then prepare a pull request for the 3.1 branch and make a release!

@arteam
Copy link
Member

arteam commented Jun 2, 2017

Closed via #1136

@arteam arteam closed this Jun 2, 2017
@arteam
Copy link
Member

arteam commented Jun 2, 2017

I have released Metrics 3.1.5. It should be available in the Maven Central repository in a couple of hours.

@fabienbancharel
Copy link
Author

OK, 3.1.5 is validated on Weblogic 10.3. Thanks !

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

Successfully merging this pull request may close these issues.

None yet

3 participants