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

patcher fails with could not find or load main class on Mac for Eclipse plugin #5

Closed
mysticforester opened this issue Dec 21, 2021 · 5 comments

Comments

@mysticforester
Copy link

mysticforester commented Dec 21, 2021

Eclipse Eclipse IDE for Java Developers (includes Incubating components)
Version: 2021-12 (4.22.0)
Build id: 20211202-1639
OS: Mac OS X, v.10.16, x86_64 / cocoa
Java vendor: Oracle Corporation
Java runtime version: 14.0.2+12-46
Java version: 14.0.2

Using this plugin folder location: /Users/<user>/.p2/pool/plugins/com.oxygenxml.editor_24.0.0.v2021121518
where <user> is my user ID
Selected 'u' for update

The patcher exited with this error:

Error: Could not find or load main class com.oxygenxml.patcher.log4j.Patcher
Caused by: java.lang.ClassNotFoundException: com.oxygenxml.patcher.log4j.Patcher
Leaving..

Note: The patcher worked great for the full Oxygen Editor software. Thank you!

@dan-caprioara
Copy link
Contributor

It looks like it cannot find the classes from the target/classes subfolder.
The patcher should be started by running the "patch.sh" file in the "oxygen-log4j-patcher" directory.
For example:

cd /Users/<user>/oxygen-log4j-patcher 
sh patch 

Have you started it from another working directory?

@mysticforester
Copy link
Author

Hi @dan-caprioara , no, I started it from the containing directory. Here is the full session:

oxygen-log4j-patcher-main % sudo sh patch.sh
Password:
This script upgrades the log4j library to version 2.16 in an Oxygen XML application.
It works for Oxygen standalone distributions and Eclipse plugin distributions.

Please enter the full path to the Oxygen installation folder.

For the Oxygen Standalone installations:
Example, linux: /home/user/Oxygen XML Editor
Example, mac: /Applications/Oxygen XML Editor

For the Oxygen Plugin for Eclipse installatons:
If you installed it using an Update Site method use one of the:
- com.oxygenxml.editor
- com.oxygenxml.author
- com.oxygenxml.developer
subfolders from the Eclipse plugins folder.
Example, linux: /home/user/eclipse/plugins/com.oxygenxml.editor_...
Example, mac: /Users/user/Eclipse.app/Contents/Eclipse/plugins/com.oxygenxml.editor...

If you installed using a dropins method use one of the
- com.oxygenxml.editor
- com.oxygenxml.author
- com.oxygenxml.developer
subfolders from the Eclipse dropins folder.
Example, linux: /home/user/eclipse/dropins/com.oxygenxml.editor_...
Example, mac: /Users/user/Eclipse.app/Contents/Eclipse/dropins/com.oxygenxml.editor...

For the Oxygen XML Web Author installations:
Hint: you may locate the installation directory by looking into Administration Page (e.g.: https://www.[YOUR-WEB-AUTHOR-HOSTNAME]/oxygen-xml-web-author/app/admin.html) at General section.
In case of All Platforms installation, the directory where the archive was extracted. It should contain the tomcat directory inside.
In case of Web Application Archive installation, the directory must be the root directory of your servlet container (e.g. Tomcat).
In case of Linux and Mac installations, the installation directory. It should contain the tomcat directory inside.
Example: /usr/local/oxygen-xml-web-author
.
Enter path:
/Users/<user>/.p2/pool/plugins/com.oxygenxml.editor_24.0.0.v2021121518

Using java executable: java

Please confirm that you want to apply the patch over the folder:
/Users/<user>/.p2/pool/plugins/com.oxygenxml.editor_24.0.0.v2021121518

Type yes or no:
yes

Please choose what type of patch do you want to apply:

Type u - for upgrading the log4j library
Type r - for keeping the current log4j library, but removing the vulnerable JNDI classes from it.
u

Make sure the Oxygen application or server is closed before proceeding.
Type ENTER when ready...
ENTER
Error: Could not find or load main class com.oxygenxml.patcher.log4j.Patcher
Caused by: java.lang.ClassNotFoundException: com.oxygenxml.patcher.log4j.Patcher
Leaving..
oxygen-log4j-patcher-main % 

@ctalau
Copy link
Collaborator

ctalau commented Dec 24, 2021

We could not reproduce the problem. Here are several things to do to troubleshoot this issue:

  1. Download again the patcher and give it another try. We made some small changes in the past few days.
  2. Run ls -R in the oxygen-log4j-patcher-main directory? I want to make sure that the content of the archive is correct.

@mysticforester
Copy link
Author

mysticforester commented Dec 28, 2021

Thanks for the follow up @ctalau . The latest patcher worked successfully for me. While the latest updates might have fixed it, I think the issue was actually due to my specifying the wrong path to the "installation folder":

I used this path in the unsuccessful first attempt:
/Users/<user>/.p2/pool/plugins/com.oxygenxml.editor_24.0.0.v2021121518

I used this path in the successful second attempt:
/Users/<user>/eclipse/java-2020-03/Eclipse.app/Contents/Eclipse/../../../../../.p2/pool/plugins/com.oxygenxml.editor_24.0.0.v2021121518

I determined the second path from the details found at: Eclipse > About Eclipse > Installation Details > Configuration

@ctalau
Copy link
Collaborator

ctalau commented Dec 29, 2021

I am glad it worked.

@ctalau ctalau closed this as completed Dec 29, 2021
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

No branches or pull requests

3 participants