Page 1 of 1

How to run oxygen plugin project from Eclipse in DEBUG mode

Posted: Sun Sep 11, 2022 4:43 pm
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

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

Posted: Mon Sep 12, 2022 8:06 am
by Radu
Hi,
Maybe this will help:
https://www.oxygenxml.com/doc/ug-editor ... lugin.html
Regards,
Radu

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

Posted: Sat May 13, 2023 11:29 am
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
is this something am missing here?

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

Posted: Mon May 15, 2023 6:47 am
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
Oxygen has its own internal custom class loader which should load all other libraries and plugin libraries.

Regards,
Radu

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

Posted: Thu Jul 06, 2023 9:49 am
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
would you please suggest how to proceed.

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

Posted: Thu Jul 06, 2023 2:18 pm
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>

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

Posted: Fri Jul 07, 2023 8:48 am
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

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

Posted: Tue Jul 18, 2023 7:07 pm
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

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

Posted: Wed Jul 19, 2023 7:40 am
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