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
Unable to install the patch in MacOs #13
Comments
Did you accidentally delete The commands work for me on macos 11, and they should be the same for your version. |
You are right looks like i accidently deleted the file , i just cloned the repo again and ran the command the command worked |
I am getting a different error though when i run the command sudo java Log4jHotPatch : Error: A JNI error has occurred, please check your installation and try again |
Make sure you use the same version of |
Correction: it seems you built the patch with java 11 (classfile version 55), and are applying the changes to a running Java 8 process (classfile version 52). You can try running all the steps in the README, following the directions for Java 8. Thanks @alvdavi for notifying me of this. |
I was able to fix the issue but ran into a different one in jenkins, i am running a jenkins instance and when i try executing against the process i am getting the below error also i have mentioned the process info below. Is this expected ..? com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/.java_pid66686: target process 66686 doesn't respond within 10500ms or HotSpot VM not loaded Process Info pavankumar 66686 0.0 1.4 56299296 953424 ?? S 10:40AM 0:28.25 /usr/local/opt/openjdk@11/bin/java -Dmail.smtp.starttls.enable=true -jar /usr/local/opt/jenkins-lts/libexec/jenkins.war --httpListenAddress=127.0.0.1 --httpPort=8080 |
Can you try running as root? Looks like the same issue in the README Known Issues |
Trying now |
Same error. Also the documentation looks to be updated , do you want me to try the new instructions..? |
You can try the new instructions, but I don't suspect it will make a difference. You can make sure your jenkins is running on jdk11, and is the same version that you built the patch with. Also, try running the patch with the same user that is running jenkins. We have not done any testing on mac, I'll see if I can reproduce this issue. |
I can successfully run the patch on my Mac machine. Still not sure what is the problem on your side. Can you share the exact command you are running? And make sure you provide the correct PID? Can you also create a simple java process that just calls |
sure i will give it a try and let you know |
Its working now with the gradle build. |
Thanks for the help @caojoshua |
Environment:
macOs Monterey 12.1
java -version
openjdk version "11.0.9.1" 2020-11-04 LTS
OpenJDK Runtime Environment Corretto-11.0.9.12.1 (build 11.0.9.1+12-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.9.12.1 (build 11.0.9.1+12-LTS, mixed mode)
I tried to run the below command :
jar -cfm Log4jHotPatch.jar Manifest.mf *.class
Got the error below:
java.io.FileNotFoundException: Manifest.mf (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.(FileInputStream.java:157)
at java.base/java.io.FileInputStream.(FileInputStream.java:112)
at jdk.jartool/sun.tools.jar.Main.run(Main.java:267)
at jdk.jartool/sun.tools.jar.Main.main(Main.java:1681)
Am i missing something.
The text was updated successfully, but these errors were encountered: