Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Debug Code Out of Sync
Debug Code Out of Sync [message #186874] Fri, 05 January 2007 02:42 Go to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
I have a situation where I'm running a web service program. The program
calls a code from a number of other projects that I have. When I step
through the code during debug into another project the cursor is out of
sync with the code that I'm viewing. In my example I the debug cursor may
be about 2 lines above the code in that I'm viewing. I running Java 1.5,
Eclipse 3.2, and Apache Tomcat 5.5.15

Later as I'm running the through the code I will make a call to the same
source that I've been debuging and receive a null pointer error. I belive
this is related to the debug being out of synce.
Re: Debug Code Out of Sync [message #186883 is a reply to message #186874] Fri, 05 January 2007 03:18 Go to previous messageGo to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
I'm even more confused now. I placed a code change in the code that I
know should be excuted, a simple system.out.println. When I'm debugging I
see the new code as I step through but it never execute it. I know that
it must be executing an old version of the code but I don't know why it
isn't updating the new code. Any help would be greatly appreciated.

Thanks,
Ben
Re: Debug Code Out of Sync [message #186891 is a reply to message #186883] Fri, 05 January 2007 03:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

Ben wrote:
> I'm even more confused now. I placed a code change in the code that I
> know should be excuted, a simple system.out.println. When I'm debugging
> I see the new code as I step through but it never execute it. I know
> that it must be executing an old version of the code but I don't know
> why it isn't updating the new code. Any help would be greatly appreciated.
>
> Thanks,
> Ben
>

You mentioned in your original post that you were running a web service
program. Are you deploying the code to the web server in the dependent
plugin after you update the code?
Re: Debug Code Out of Sync [message #186947 is a reply to message #186891] Fri, 05 January 2007 13:13 Go to previous messageGo to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
I haven't deployed the code yet. When I run the web service I run it with
the option selected to run the code from the workspace. I would have
expected it to pick up the code in the workspace which is where my changes
are. It shows that code during the debug step through but it is
definitely picking up an older version. I hope this answers you question.
Please let me know if there is anything else that you can provide to help
me resolve this or if you need anything from me.
Re: Debug Code Out of Sync [message #186955 is a reply to message #186883] Fri, 05 January 2007 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

In article <6e28c87934ed53eccf4ec9df06801323$1@www.eclipse.org>,
bsisson@simventions.com says...
> I'm even more confused now. I placed a code change in the code that I
> know should be excuted, a simple system.out.println. When I'm debugging I
> see the new code as I step through but it never execute it. I know that
> it must be executing an old version of the code but I don't know why it
> isn't updating the new code. Any help would be greatly appreciated.
>
> Thanks,
> Ben

I've run into the same thing, and posted about it a couple of weeks ago.
It appears to be due to the utility project (the one that the web
service is calling) not being updated with the new code, after you make
changes. If you haven't done a "clean" on the project (Project | clean)
and then a restart of the server, do that first; it usually takes care
of it, though not always. Sometimes I've had to delete the .jar of the
utility project, create a .jar manually (export), and copy it into place
in the appropriate location for debugging (usually tmp0/....)

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: Debug Code Out of Sync [message #186978 is a reply to message #186955] Fri, 05 January 2007 13:50 Go to previous messageGo to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
-Sometimes I've had to delete the .jar of the
-utility project, create a .jar manually (export), and copy it into place
-in the appropriate location for debugging (usually tmp0/....)

Not sure that I am following this part of the response. I have tried on a
number of occasions to do a Project->Clean and then run the service only
to have it fail to fix the sync issue. So, my next step would be to try
the second part of your solution. I want to make sure that I clearly
understand what you are stating.

When you talk about deleting the .jar of the utitlity project do you mean
the project that I have created and am calling which is out of sync? If
so, then I'm not sure which jar you want me to delete. I'm trying to run
the web service from the workspace. In that case I would expect it to
pick up the source code and I have created a jar file yet to be deployed.
Then you indicated that I should create a .jar file manually, again I'm
assuming you mean for the referenced project. Typically when I'm readly
to deploy I would do this and place it in the server but I'm not sure
where you are indicating to place it.

I appreciate you help and hope that you can help clearify my questions.

Thanks,
Ben
Re: Debug Code Out of Sync [message #186993 is a reply to message #186978] Fri, 05 January 2007 14:56 Go to previous messageGo to next message
Ben Sisson is currently offline Ben SissonFriend
Messages: 202
Registered: July 2009
Senior Member
Is this the location for the temp jar files that you were talking about?
C:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\ tmp0\webapps\WebServiceName\WEB-INF\lib

I found a conflicting jar file in this location. Most notably an old jar
file that did not update for the changes I made for the utility project
but a jar file that did update for the web service that I was changing. I
am in the process of testing this now to see if this was the couase.

Thanks,
Ben
Re: Debug Code Out of Sync [message #186999 is a reply to message #186978] Fri, 05 January 2007 15:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

In article <ba714fca1401a105733789b4a3f79bb3$1@www.eclipse.org>,
bsisson@simventions.com says...
> -Sometimes I've had to delete the .jar of the
> -utility project, create a .jar manually (export), and copy it into place
> -in the appropriate location for debugging (usually tmp0/....)
>
> Not sure that I am following this part of the response. I have tried on a
> number of occasions to do a Project->Clean and then run the service only
> to have it fail to fix the sync issue. So, my next step would be to try
> the second part of your solution. I want to make sure that I clearly
> understand what you are stating.
>
> When you talk about deleting the .jar of the utitlity project do you mean
> the project that I have created and am calling which is out of sync? If

In my case, it was the .jar of the project that is *being called* by the
web service.


> so, then I'm not sure which jar you want me to delete. I'm trying to run
> the web service from the workspace. In that case I would expect it to
> pick up the source code and I have created a jar file yet to be deployed.

When you run an app through the Eclipse workspace, Eclipse builds a .jar
file behind the scenes, and deploys it to its temporary location where
the built-in servers can find it. In the case of a tomcat server, on my
system it's in:

C:\PROJECTS\workspace3.2.1\.metadata\.plugins
\org.eclipse.wst.server.core\tmp0\webapps\eddSrv\WEB-INF\lib

Where "eddSrv" is the name of my webapp, and the jar file has the same
name as its project in the workspace.


> Then you indicated that I should create a .jar file manually, again I'm
> assuming you mean for the referenced project. Typically when I'm readly

Yes, for the referenced project, the one that your webapp is calling.

> to deploy I would do this and place it in the server but I'm not sure
> where you are indicating to place it.

In the above-listed folder. You will likely see an old one in there,
corresponding to the version of the code that is actaully running (not
the updates you have made since then).


> I appreciate you help and hope that you can help clearify my questions.

Hopefully I did; if not, post back.


If you subscribe to the eclipse.webtools newsgroup, and check threads
titled "Eclipse won't run updated version of a class" and "It's
baaaaack!: Eclipse won't run updated version of a class", you will see
my anguished posts about this issue, and how I eventually worked my way
around it. If I do a project clean every time before starting a debug
session, it seems to work most of the time; sometimes I need to go
through two iterations of clean/start/clean/start before it picks up my
new code. There is without a doubt a bug here, but I can't reliably
reproduce the conditions that start it happening.


--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: Debug Code Out of Sync [message #187007 is a reply to message #186993] Fri, 05 January 2007 15:05 Go to previous message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

In article <9a81e18e7b5291daed9f65e09de5dd3d$1@www.eclipse.org>,
bsisson@simventions.com says...
> Is this the location for the temp jar files that you were talking about?
> C:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\ tmp0\webapps\WebServiceName\WEB-INF\lib

Yes, that's the one.

>
> I found a conflicting jar file in this location. Most notably an old jar
> file that did not update for the changes I made for the utility project
> but a jar file that did update for the web service that I was changing. I
> am in the process of testing this now to see if this was the couase.

You found it a lot quicker than I did the first time!



--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Previous Topic:Can't find org.eclipse.core.resources
Next Topic:Required plugins for Update functionality
Goto Forum:
  


Current Time: Thu Mar 28 21:38:48 GMT 2024

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

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

Back to the top