Hi! This forum is very helpful to new developers like me. I have a question regarding Servoy plugins. Is there a way to debug plugin source codes line per line in Servoy Developer IDE? How can I set up my environment to do this? Thanks.
You mean the plugin java source code ? You must set up eclipse, checkout projects, run developer from sources, put breakpoint in plugin file ( plugin must be compiled with that info). Of course plugin must be open source.
It seems that this will take a lot of time.
Thanks anyway.
erikd:
It seems that this will take a lot of time.Thanks anyway.
What are you trying to achieve ? If you have some questions about a plugin you can ask on the forum.
Laurian’s suggested approach is the easiest way to debug the internals of plugins.
As for the time it takes to set it up, it’d say the actual work is less than 10 minutes. The whole process might take a lot longer, because it’ll download a lot of stuff. Have a look at the description on the wiki: http://wiki.servoy.com/display/public/DOCS/Setting+up
Do note that this will install all open source Servoy stuff and you’ll be introduced to Java land, but that is what plugins are: they’re Java code.
Paul
Debugging plugins using Eclipse and Java is not for newbies in either programming or Servoy!
One has to be cognizant of various plugin APIs and the architecture required by Servoy.
So although one can set up in 10 minutes one needs a lot of experience prior to be able to do that and understand what to do.
pbakker:
you’ll be introduced to Java land, but that is what plugins are: they’re Java code.
Java land is a nice place though… very open!
I know this post has been here for years, but I still have a few questions about debugging plugins.
I agree with you Patrick, Java land is a nice place.
I was able to Debug Servoy Developer through the link that you posted, but I don’t know how to link the jasper plugin sources? I’d like to debug the jasper plugin source codes when I run our Servoy application. Is this possible?
Sure is. In Eclipse, retrieve the sources from the ServoyForge project SVN repository: svn://svn.servoyforge.net/servoy-jasperreports/
You might have to modify the build.xml ant file to deploy directly the jars to your target Servoy developer when you change something in the sources.
Then put a break point in the sources and run Servoy in debug mode.
Hi Patrick, thanks for the quick response. I have successfully debugged the plugin.
Here are the steps which might help others:
In Eclipse I have Servoy sources in different projects, and “Servoy Jasper Plugin sources” named as “servoy_jasperreports”.
I changed the “install” property of the build.xml of "Servoy Jasper Plugin sources " to “my_workspace/servoy_jasperreports_plugin”. I ran the build and it created the “my_workspace/servoy_jasperreports_plugin” folder, and then imported this folder as a Java project.
In “my_workspace/servoy_jasperreports_plugin” project, I checked out the Jasper Report sources and the Jasper Engine and configured servoy_jasperreports.properties to point the their directories. I also configured the servoy_jasperreports.jar to reference “servoy_jasperreports” workspace as the source code. I changed the plugins property of configure.xml to point to my Servoy Developer’s plugin folder, and ran the configure.xml as an Ant build.
In servoy_jasperreports_plugin project, I placed a breakpoint in line 335 of JasperReportsProvider.java to test the runReport method.
I have Servoy IDE which includes a test solution and calls the plugins.jasperPluginRMI.runReport method.
I ran the “Servoy Launch.launch” file and debugged the test solution.
Debugger should start
Thanks for the tip, Patrick!
Cheers!
Glad it works for you!
Eclipse is a fantastic development environment which allows to debug itself while you are developing, and Servoy is nothing more than a bunch of Eclipse plugins.
ptalbot:
… Servoy is nothing more than a bunch of Eclipse plugins.
… Servoy Developer is nothing more than a bunch of Eclipse plugins.
IT2Be:
Servoy Developer is nothing more than a bunch of Eclipse plugins.
True! Thanks for the precision, Marcel!
Maybe it is too late to respond, but here is my way to debug the plugins using Eclipse. Maybe it will be helpful for someone.
- Import the source code of the plug-in(s) that you want to debug in Eclipse.
2.1 Debug smart client:
Open the console and start servoy with these parameters:
servoy.exe [-console] -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=<y|n>,address=<port_x>
example: servoy.exe -console -vmargs -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
2.2 Debug web client:
Instead of running the web client from Servoy Developer, run just the application server of the developer with debug options:
Open your Servoy\application_server directory. Edit the servoy_server.bat file and add these options as vmargs:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<port_x>.
As an example, this is the command line in my bat file:
%CMD_LINE_START% -Djava.awt.headless=true -Xmx1280m -Xms64m -XX:MaxPermSize=128m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
Run servoy_server.bat
- From Eclipse open ‘Debug Configurations’ and create a new ‘Remote Java Application’. Fill in host: localhost, port: port_x (or from the example above - 8000). For a project select the plug-in that you imported in step 1.
You should be now debugging