Page 1 of 1
Debug Oxygen Java Plugin
Posted: Wed Jul 01, 2009 4:30 pm
by Max
Hi,
How to debug Oxygen Java Plugin in Intellij Idea 7.0 ?
The Plugin is made on the basis of Simple Document Framework, from documentation examples.
Best Regards,
Max
Re: Debug Oxygen Java Plugin
Posted: Wed Jul 01, 2009 4:49 pm
by sorin_ristache
Hello,
You don't have to start it as java application from IntelliJ. You can use the Log4j logging library which comes with Oxygen: configure a Log4j appender (with a file called log4j.properties that you place in the [Oxygen-install-folder]/lib folder or in a folder that you know is included in the classpath of your IntelliJ Java program) that sends logging output from your Oxygen Author extension classes to your preferred location (configured in log4j.properties): standard output, a file on disk, a TCP socket, etc.
Or you can add your own logging library to the classpath of the Oxygen document type (Simple Document Framework in your case) together with your Author extension classes and use it in your extension classes.
If you want to debug your Author extension in Oxygen run as a Java application launched from IntelliJ I think you can place breakpoints in IntelliJ inside your extension classes and stop the execution on them. The launch command line should be like the Java command at the end of the script [Oxygen-install-folder]/oxygen.bat.
Regards,
Sorin
Re: Debug Oxygen Java Plugin
Posted: Wed Jul 01, 2009 4:57 pm
by Max
Thanx a lot!
Re: Debug Oxygen Java Plugin
Posted: Fri Jul 03, 2009 4:40 pm
by Max
Hello Sorin.
To debug a program with the help of sockets one needs to point out parametres line:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=3500
We want to debug Author Oxygen XML. Where should we point out these parametres?
Regards,
Max
Re: Debug Oxygen Java Plugin
Posted: Fri Jul 03, 2009 4:52 pm
by sorin_ristache
If you start Author with the script author.bat you should add the parameters in the Java command of the script:
Code: Select all
%OXYGEN_JAVA% -Xss512k -Xmx256m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=3500 -XX:SoftRefLRUPolicyMSPerMB=10 -Dcom.oxygenxml.app.descriptor=ro.sync.exml.AuthorFrameDescriptor ...
If you start it from a Java IDE you should add your -X parameters to the Java command that start the debugging process.
Regards,
Sorin
Re: Debug Oxygen Java Plugin
Posted: Mon Jul 06, 2009 2:50 pm
by Max
Thanks a lot! It works!
Re: Debug Oxygen Java Plugin
Posted: Fri Jan 08, 2010 2:54 pm
by Kasturi999
Hi,
I have the same problem with debugging of oxygen code from eclipse.
Can someone please detail me how to do this?
Thanks
Kasturi
Re: Debug Oxygen Java Plugin
Posted: Fri Jan 08, 2010 4:07 pm
by adrian
Hello Kasturi,
What exactly are you trying to do?
You want to debug the Oxygen Eclipse plugin?
Regards,
Adrian
Re: Debug Oxygen Java Plugin
Posted: Fri Jan 08, 2010 8:17 pm
by Kasturi999
Hi Adrain,
In Oxygen - author mode, there are some operations customized in java for our company.
I would like to debug those java files while navigating in Oxygen as we can do the same in a tomcat application.
IDE is Eclipse.
thanks
Re: Debug Oxygen Java Plugin
Posted: Mon Jan 11, 2010 1:32 pm
by adrian
Hello,
For Eclipse you have to configure a 'Debug configuration' with the main class ro.sync.exml.Oxygen and add -Xmx256m(or more if needed) to VM arguments.
From Classpath remove the <Project Name>(default classpath) and add the oxygen.jar from your Oxygen installation directory(not from the SDK). Only the JRE and oxygen.jar should remain in the classpath.
In the Source section add the sources of your java project.
In Oxygen make sure in the Document Type of your extension the classpath points to the classes/bin directory of your java project.
Let us know if you encounter any difficulties with this configuration.
Regards,
Adrian
Re: Debug Oxygen Java Plugin
Posted: Tue Jan 12, 2010 2:21 pm
by Kasturi999
Hi,
I 've added the "Insert Image Operation" to the menu bar in my Oxygen editor. I am trying to debug the java code for this operation when accessed from Oxygen. I've placed a breakpoint in InsertImageOperation.java at doOperation().
I tried the way you described in the previous post. But the thread gets terminated saying
<terminated>ro.sync.exml.Oxygen at localhost:3547
Thanks
Re: Debug Oxygen Java Plugin
Posted: Tue Jan 12, 2010 2:25 pm
by Kasturi999
Sorry - I got it working now.
It was terminating previously because I 've opened another instance of Oxygen from outside eclipse. Now I've started Oxygen editor from eclipse and it starting working.
Thanks a lot for your help
Re: Debug Oxygen Java Plugin
Posted: Fri Jun 24, 2011 7:34 pm
by xsaero00
Sorry to resurrect the old thread but I am having bit of problems with setting debugging. I don't have Editor, I just have Author. So I used author.jar instead of oxygen.jar. But when I started it, it asked me for a license. The author license I have did not work so I had to get a trial license for Editor. When I finally started it is said XML Editor in the window title. How do I start Author from Eclipse debugging. Is there a different main class I should use?
Re: Debug Oxygen Java Plugin
Posted: Fri Jun 24, 2011 8:09 pm
by adrian
Hello,
If you have Oxygen XML Author, you need to also add to the VM Arguments of the debug configuration this parameter:
Code: Select all
-Dcom.oxygenxml.app.descriptor=ro.sync.exml.AuthorFrameDescriptor
Additionally, on Windows platforms for both Editor and Author it might be a good idea to also add:
Regards,
Adrian
Re: Debug Oxygen Java Plugin
Posted: Fri Jun 24, 2011 11:08 pm
by xsaero00
Thank you. That did the trick.
Re: Debug Oxygen Java Plugin
Posted: Tue Feb 21, 2012 8:54 pm
by TimWallace
I followed all of the above steps and I still get an error indicating that org.apache.log4j.Logger is being searched for. Here is a capture of the error:
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at ro.sync.util.ib.d(Unknown Source)
at ro.sync.util.ib.b(Unknown Source)
at ro.sync.ui.application.b.i.<clinit>(Unknown Source)
at ro.sync.ui.application.u.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at ro.sync.exml.Oxygen.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at ro.sync.util.bc.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 11 more
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at ro.sync.util.ib.d(Unknown Source)
at ro.sync.util.ib.b(Unknown Source)
at ro.sync.ui.application.b.i.<clinit>(Unknown Source)
at ro.sync.ui.application.u.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at ro.sync.exml.Oxygen.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at ro.sync.util.bc.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 11 more
Re: Debug Oxygen Java Plugin
Posted: Tue Feb 21, 2012 9:04 pm
by TimWallace
I got it working. I had to add back in another JAR beyond what was listed.
Re: Debug Oxygen Java Plugin
Posted: Wed Feb 22, 2012 10:22 am
by Radu
Hi Tim,
That's strange.
The oxygen.jar should have been enough, it is the only JAR used in the oxygen.bat to start Oxygen. Oxygen has its own internal class loader which loads all libraries from the OXYGEN_INSTALL_DIR/lib folder and the log4j.jar should have been found there.
Regards,
Radu