Not a valid line number? [message #246109] |
Wed, 25 July 2007 02:58  |
Eclipse User |
|
|
|
Originally posted by: pgodeau_nosp.m_sapex-alma.com
Hello,
My program crashes with an exception, and when I click on the source
name in the stack trace, I get a class file editor with "source not
found", and a message "123 is not a valid line number". However the
sources are attached in the build path, and are available for example if
I Ctrl-click on the class name, and the line number exists in the source
and matches with the exception thrown.
Can you please tell what I missed?
--
Patrick
|
|
|
|
|
Re: Not a valid line number? [message #246443 is a reply to message #246238] |
Tue, 31 July 2007 12:37   |
Eclipse User |
|
|
|
Originally posted by: leichtman.N0SP&Mradpharm.com
I have run into a similar although not identical problem and I wonder if
anyone else has seen the behavior described below with Eclipse 3.3 Europa
and MyEclipse 6.0M1? I'm not convinced that this is a MyEclipse problem. I'm
leaning more toward an Eclipse problem, since it seems to be related to the
class file editor and Eclipse Java debugging.
I created a MyEclipse project with web capabilities and proceeded to create
a working webapp which I deployed to Tomcat 6.0.13 using the MyEclipse
AppServer connector. One of the jar's I'm using has a class that I needed to
rewrite to make the webapp function properly. I did not want to disturb the
class file in the jar, so I simply grabbed the original source and modified
it accordingly by creating an identical package tree under an Eclipse
recognized src folder. I then proceeded to guarantee that the src folder was
before the jar file in the build path. This worked perfectly and I have used
this technique before successfully both in and outside of Eclipse. I
deployed the webapp to Tomcat as context "test". I then placed a breakpoint
in the new class and started up Tomcat. The test context was loaded based
upon console output and when the breakpoint was reached after attempting to
go to the pertinent URI in FireFox, the Eclipse class file editor dutifully
brought up the class file displaying assembler and requesting that a source
file be attached. I then attached the appropriate source file found under
the src directory and package tree. Debugging proceeded normally and I got
the webapp to function as I desired. I stopped debugging and Tomcat and
undeployed the webapp.
Now I wanted to port this webapp to a new version of serveral of the jars.
This new version contains significant changes that require that I alter the
class file yet again to make the webapp functional again. Since I have a
working webapp, I don't want to disturb it in any way, so I created a new
MyEclipse project with web capabilities with a new name. I copied the
contents of the old project excluding the various "." project files. I
changed the deployment context in this new project to test3 (test2 was
abandoned but not discarded). In this new project, I made my changes to the
webapp to make it compliant with the new version of the jars. I then set a
breakpoint in the modified source file, this is a modified copy of the file
found in the previous project. I cleaned this project, deployed to and
started Tomcat. I again attempted to go to the pertinent URI in FireFox and
the debugger stopped at a in the class file editor using the source from the
old project.
Ok, now I stopped everything, removed the source file from its package
directory in the old project, cleaned both projects, redeployed the new
project and started again. As soon as I cleaned the new project, the source
file in the class file editor that I had been debugging reverted back to
assembler. In other words the link to the old source file disappeared which,
of course, is good. Once I started debugging the class file editor brought
the pertinent class file forward and agains requested that I attach the
proper source. I did as before, but this time attached the source from the
new project. This worked correctly and changes to the source were compiled
as expected and synch-on-demand worked as I expected.
Now, if I stopped everything, undeployed the new webapp, moved the old
source file back into the old project, cleaned both projects and redeployed
the old webapp, the old class file remained attached to the new source file.
In order to force the old class file to use the old source, I had to, this
time, remove the new source file from its package directory, move the old
source file back into its package directory, clean both projects and start
again.
It seems that I might have found an unhandled corner case. I can repeat this
back and forth problem consistently. It seems that once a source file is
attached to a class file, no matter what project it is in, at least when
that file is overriding a like file in a jar, Eclipse does not distinguish
which project the source file comes from and leaves it attached until it can
no longer find it.
Can anyone else repeat this behavior?
-=> Gregg <=-
"Patrick Godeau" <pgodeau_nosp@m_sapex-alma.com> wrote in message
news:f89jq4$i2h$1@build.eclipse.org...
> Darin Wright a
|
|
|
|
Powered by
FUDForum. Page generated in 0.02595 seconds