Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Debugging a java app's plugin(Debugging a plugin (serviceloader) from a java app, getting paths right)
Debugging a java app's plugin [message #715261] Sat, 13 August 2011 00:39 Go to next message
b4dc0d3r is currently offline b4dc0d3rFriend
Messages: 2
Registered: August 2011
Junior Member
I have an App, and the source code layout is not really up to me. The folders are all in the same main directory. App, Plugin1, Plugin2, Plugin3, etc. By "Plugin", I mean the main app JAR uses ServiceLoader to load the plugin JAR.

When I Debug the plugin, it starts the main app class okay. But the app cannot find my plugin that I'm debugging. It also cannot find its resources (PNG files). I set the working directory to be the program's home folder (c:\program files\app). I also tried copying all of the folders to the app's source code location, which is where I initially loaded the main app (next paragraph). I copied the folders everywhere I could think of, but debugging still never finds them, any of them.

I had lots of problems with the main app classes, Eclipse claimed just about everything "Cannot be resolved to a type". I did a million things to try to fix that. So I can't be really specific on what I did. Basically, it used to point to the build folder (the .class files), the files were loaded but it couldn't resolve anything. Now I point to the main app JAR in the program files directory, as a reference, but it can still load the main app source code somehow.

So, what is your recommendation for a setup, to debug (Step through the code) a plugin for an application? Everything I've found says to just set the working directory and it works, and sample code to prove it. I tried to figure out what it was trying to open, but FileMon for Vista only says to use Process Monitor, which doesn't tell me when a file open fails, only when it works. So I'm stuck not knowing where Eclipse/Java is trying to load things, and if someone suggests a way to rearrange the code, I'll give it a try. Sad

Eclipse 20110615-0604
Ant (Eclipse - create project from Ant project)
Windows Vista

---- edit ---

Process monitor says it's looking in these folders. It never looked relative to the working directory for these files. What cna I change so it looks where I think it should look? (relative to the app being debugged)

c:\plugin\
c:\app\
plugin-path\build\
app\bin\

The working directory is c:\program files\app\

[Updated on: Sat, 13 August 2011 01:07]

Report message to a moderator

Re: Debugging a java app's plugin [message #722197 is a reply to message #715261] Mon, 05 September 2011 03:05 Go to previous messageGo to next message
b4dc0d3r is currently offline b4dc0d3rFriend
Messages: 2
Registered: August 2011
Junior Member
OK, I'm really frustrated now. I can't tell where the app is loading - even process monitor doesn't see the attempt to load resource files. Eclipse output shows "Could not find file.... .png" and process monitor shows no attempt to read any .png file (case insensitive search).

There is a 'run configuration' and a 'debug configuration'. I got them running, and there was a bug in my code (typo). I tried to re-build, Eclipse wouldn't do anything. I used ant to re-build the JAR, and copy it where I thought it would look 3 locations. There is also the Build Path which contains things like the working directory, which seems to be workspace-wide. I do not understand what these are or when they take effect, because changing them seems to change nothing, and then at random it works, or doesn't work.

When I debugged, it could no longer find the resources - plugins, PNG files, etc. I only rebuilt the plugin. I didn't change anything else. I don't know where to look.

I just want to debug java. If I should use something other than Eclipse because I'm an idiot, please point me to something else.

Version: Indigo Release
Build id: 20110615-0604

Also, when I hit F11 to debug, it asks me which configuration - the window is blank. But I can right-click and select debug configuration, and it starts. Why is the configuration window blank?

My month-long experience with Eclipse has been terrible so far. If it works once, I'd like to be able to rebuild my code and have it still work... can anyone help a n00b?
Re: Debugging a java app's plugin [message #723041 is a reply to message #722197] Wed, 07 September 2011 13:51 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Without knowing some more details about your projects' structure, it's
hard to speculate about what's going on. If you can describe how you
have your project(s) configured in terms of build path and dependencies,
it would help.



On 9/4/11 11:05 PM, b4dc0d3r wrote:
> OK, I'm really frustrated now. I can't tell where the app is loading -
> even process monitor doesn't see the attempt to load resource files.
> Eclipse output shows "Could not find file.... .png" and process monitor
> shows no attempt to read any .png file (case insensitive search).
>
> There is a 'run configuration' and a 'debug configuration'. I got them
> running, and there was a bug in my code (typo). I tried to re-build,
> Eclipse wouldn't do anything. I used ant to re-build the JAR, and copy
> it where I thought it would look 3 locations. There is also the Build
> Path which contains things like the working directory, which seems to be
> workspace-wide. I do not understand what these are or when they take
> effect, because changing them seems to change nothing, and then at
> random it works, or doesn't work.
>
> When I debugged, it could no longer find the resources - plugins, PNG
> files, etc. I only rebuilt the plugin. I didn't change anything else. I
> don't know where to look.
>
> I just want to debug java. If I should use something other than Eclipse
> because I'm an idiot, please point me to something else.
>
> Version: Indigo Release
> Build id: 20110615-0604
>
> Also, when I hit F11 to debug, it asks me which configuration - the
> window is blank. But I can right-click and select debug configuration,
> and it starts. Why is the configuration window blank?
>
> My month-long experience with Eclipse has been terrible so far. If it
> works once, I'd like to be able to rebuild my code and have it still
> work... can anyone help a n00b?
Previous Topic:Total beginner Java Eclipse tutorials on Eclipse.org
Next Topic:project.xml written over in conf\Catalina\localhost
Goto Forum:
  


Current Time: Thu Apr 25 11:01:15 GMT 2024

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

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

Back to the top