How to run oxygen plugin project from Eclipse in DEBUG mode

Oxygen general issues.
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

How to run oxygen plugin project from Eclipse in DEBUG mode

Post by vishwavaranasi »

hello team ,

We have oxygen plugin implemented and we want to run oxygen plugin project from Eclipse in DEBUG mode

please point me to the necessary config steps for the same.

Thanks
vishwa
Thanks,
vishwa
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to run oxygen plugin project from Eclipse in DEBUG mode

Post by Radu »

Hi,
Maybe this will help:
https://www.oxygenxml.com/doc/ug-editor ... lugin.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: How to run oxygen plugin project from Eclipse in DEBUG mode

Post by vishwavaranasi »

Hi Radu , I have tried the debug plugin from Eclipse , When i run the Run Configration with VM args , it is trying to open oxygen 24 , but while starting got the below error
image.png
image.png (43.79 KiB) Viewed 1252 times
is this something am missing here?
Thanks,
vishwa
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to run oxygen plugin project from Eclipse in DEBUG mode

Post by Radu »

Hi,

And the same plugin works when running Oxygen directly, without the debugger right?
If you open the "oxygen.bat" from the Oxygen installation folder, it has a very small classpath:

Code: Select all

"%~dp0;%~dp0/classes;%~dp0/lib/oxygen-basic-utilities.jar;%~dp0/lib/oxygen.jar;"
meaning that it adds to the classpath the Oxygen installation folder and two of libraries from the Oxygen "lib" folder.
When you configure the Java Application configuration in Eclipse you should give it also a very limited classpath with two JAR libraries and the Oxygen installation folder.
Something like:
Screenshot 2023-05-15 at 06.47.25.png
Screenshot 2023-05-15 at 06.47.25.png (211.8 KiB) Viewed 1211 times
Oxygen has its own internal custom class loader which should load all other libraries and plugin libraries.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: How to run oxygen plugin project from Eclipse in DEBUG mode

Post by vishwavaranasi »

Hi Radu , we are getting back to work on this to debug plugin from eclipse.
our eclipse showing the classpath TAB as below, we dont see Dependencies TAB as you showed
image.png
image.png (43.62 KiB) Viewed 1085 times
would you please suggest how to proceed.
Thanks,
vishwa
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: How to run oxygen plugin project from Eclipse in DEBUG mode

Post by vishwavaranasi »

sorry , there was some space in the VM args it was showing the error.

the error is not showing now , and the oxygen opened from eclipse but the plugin is not showing in the oxygen.

plugin.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!-- The plugin.dtd file is located in the OXYGEN_INSATALL_DIR/plugins directory -->
<!DOCTYPE plugin SYSTEM "../plugin.dtd">

<plugin
 id="com.oxygenxml.plugin.WorkspaceAccess"
 name="CustomWorkspaceAccess"
 description="Test"
 version="${project.version}"
 vendor="Syncro Soft"
 class="com.oxygenxml.sdksamples.workspace.WorkspaceAccessPlugin"
 classLoaderType="preferReferencedResources"> 

 <runtime>
	<librariesFolder name="lib" />
    <library name="../oxygen-plugin-workspace-access/target/classes" />
	<librariesFolder name="target/lib" />
 </runtime>
 
 <extension type="WorkspaceAccess" 
  class="com.oxygenxml.sdksamples.workspace.CustomWorkspaceAccessPluginExtension"/>
 
  <!--The sample view which will present messages from the sample plugin.-->
  <view id="SampleWorkspaceAccessID" initialSide="WEST" initialRow="0"/>
  <!--The sample toolbar which will present messages from the sample plugin.-->
  <toolbar id="SampleWorkspaceAccessToolbarID" initialSide="NORTH" initialRow="1"/>
</plugin>
Thanks,
vishwa
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to run oxygen plugin project from Eclipse in DEBUG mode

Post by Radu »

Hi,

It's hard to give advice as I do not know how your project structure looks like and how it's referenced from Oxygen.
When you start Oxygen directly (not from Eclipse but using the "oxygen.bat" executable for example), is your plugin loaded?
I assume your "plugin.xml" is inside the "oxygen-plugin-workspace-access" folder, so this library reference:

Code: Select all

<library name="../oxygen-plugin-workspace-access/target/classes" />
could probably be changed to this:

Code: Select all

<library name="target/classes" />
In this readme file:
https://github.com/oxygenxml/sample-plu ... ace-access
there is a suggestion about:
If you want to debug your Java code and do not want to run "mvn install" and to install the plugin in Oxygen all the time, in the "OXYGEN_INSTALL_DIR\plugins" folder you can create a folder with any name (for example "sample") in which you place a file called "plugin.redirect"....
have you added in the Oxygen installation "plugins" folder a subfolder containing a "plugin.redirect" pointing to your plugin development folder?
If you add "System.err" lines in your plugin's code and start Oxygen using the "OXYGEN_INSTALL_DIR/oxygen.bat" script, do you see those system err lines in the console output?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: How to run oxygen plugin project from Eclipse in DEBUG mode

Post by vishwavaranasi »

Hi Radu ,
our plugin is comprised of 3 projects
project 1 - db operations where we have dependency of ojdbc
project 2 - middle layer project ( is dependent on project 1)
project 3 - oxygen plugin project ( is dependent of project 2)

in out myplugin/plugin.xml we have specified as

Code: Select all

<runtime>
	<!-- librariesFolder name="lib" /-->
    <!-- <library name="../target/classes" /> -->
    <library name="C:/path_to_/project1/target/classes"/>
    <library name="C:/path_to_/project2/target/classes"/>
    <library name="C:/path_to_/project3/target/classes"/>
   <librariesFolder name="../target/lib" />
 </runtime>
and the oxygen opened , from one of our custom plugin menu options we trying to DB and getting this error.
Cannot get Connection from Datasource: java.lang.SecurityException: sealing violation: package oracle.jdbc.aq is sealed

would you please help us here.

Thanks,
vishwa
Thanks,
vishwa
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to run oxygen plugin project from Eclipse in DEBUG mode

Post by Radu »

Hi,
This last problem does not seem related to the problem you initially reported on this thread. Maybe in such cases you can start a new discussion post.
You mentioned:
from one of our custom plugin menu options we trying to DB
How exactly are you doing this? Are you calling from your code the Java JDBC APIs?
This particular " sealing violation: package oracle.jdbc.aq is sealed" would mean that there is a JAR library containing the "oracle.jdbc.aq" package and it is sealed:
https://docs.oracle.com/javase/tutorial ... alman.html
And I think you might have another JAR library containing the same package somewhere else on your classpath. And because the first JAR library is sealed, the Java VM throws an error.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply