Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dirigible » Supportability: Remote debugging dirigible code
Supportability: Remote debugging dirigible code [message #1717168] Thu, 10 December 2015 12:08 Go to next message
Georgi Pavlov is currently offline Georgi PavlovFriend
Messages: 39
Registered: October 2014
Member
There are a couple of development and support concerns wrt Dirigible I'd like to clarify.

While a significant part of the Dirigible development can be conveniently supported by in-Eclipse debugging using the generated 'dirigible-local' OSGi Framework launch configuration, there is also a couple of use cases that cannot be implemented using this approach.

More specifically, this is the case when Dirigible is deployed in a web container and you need to debug it remotely e.g. from Eclipse.
This very much affects both supportability but also partially development process too.

Wrt supportability, being able to debug remotely is very important so that issues can be inspected directly in the defective deployments.

Wrt development process, it is the only valid way to debug components that rely on external components and their execution environment.
One such example is the configurable database access in the repository services. To set the scene in brief, suppose that one needs to integrate yet another database and debug end-to-end if it worked out (or why exactly it didn't work) in a real setup with Dirigible deployed in Tomcat with the DB drivers provisioned by Tomcat and exposed as a JNDI-bound DataSource in web.xml. Currently, you can't do this in OSGi-only environment.

You could think that setting up remote debugging is as trivial as with any other web application and mostly it is with a few caveats that can ruin your day.
The two important specific steps that i needed to perform before i had remote debugging working for me were:

1. Build Dirigible with debug info:
	<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
  			               <debug>true</debug>
 			               <debuglevel>lines,vars,source</debuglevel> 
				</configuration>
			</plugin>


2. Clear the work directory in Tomcat (!) , because in my case I had previously deployed Dirigible.
OSGi is using it for its bundles and it will interfere with fresh deployments

Summing up the steps :
1. Build Dirigible with debug info
2. Clear previous deployments if any and make sure the work directory is clear (very important!), and deploy
3. Start Tomcat in debug mode: catalina jpda start
4. In Eclipse, launch a Debug launch configuration with default settings.
Set breakpoints and debug happily.

It would be lovely to have some shortcut for the first two steps (and particularly the second) but I can't figure out anything more suitable than manual work for now.

It would be great if someone could verify the steps independently.

[Updated on: Thu, 10 December 2015 12:13]

Report message to a moderator

Re: Supportability: Remote debugging dirigible code [message #1717387 is a reply to message #1717168] Sat, 12 December 2015 15:56 Go to previous messageGo to next message
Eclipse UserFriend
Hey Georgi,

Thank you!

It is so useful, so that I posted it as a blog at: http://www.dirigible.io/blogs/2015/12/10/blogs_dirigible_remote_debugging.html

I am looking forward for your commit.

Regards,
Nedelcho
Re: Supportability: Remote debugging dirigible code [message #1717533 is a reply to message #1717387] Mon, 14 December 2015 15:32 Go to previous message
Georgi Pavlov is currently offline Georgi PavlovFriend
Messages: 39
Registered: October 2014
Member
Ready to be shipped with v2.2 M2: https://bugs.eclipse.org/bugs/show_bug.cgi?id=484326
Previous Topic:Integration of 3d party libraries
Next Topic:Messaging Service API discussion
Goto Forum:
  


Current Time: Tue Mar 19 08:59:54 GMT 2024

Powered by FUDForum. Page generated in 0.02175 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top