Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Not a valid line number?
Not a valid line number? [message #246109] Wed, 25 July 2007 06:58 Go to next message
Eclipse UserFriend
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 #246147 is a reply to message #246109] Wed, 25 July 2007 14:16 Go to previous messageGo to next message
Darin Wright is currently offline Darin WrightFriend
Messages: 454
Registered: July 2009
Senior Member
What version of Eclipse are you using? There was a bug with source lookup
from stack traces in 3.2 (and was fixed in 3.2.2 -
https://bugs.eclipse.org/bugs/show_bug.cgi?id=166113).


Darin Wright

"Patrick Godeau" <pgodeau_nosp@m_sapex-alma.com> wrote in message
news:f86sbb$u1q$1@build.eclipse.org...
> 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 #246238 is a reply to message #246147] Thu, 26 July 2007 07:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pgodeau_nosp.m_sapex-alma.com

Darin Wright a écrit :
> What version of Eclipse are you using? There was a bug with source lookup
> from stack traces in 3.2 (and was fixed in 3.2.2 -
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=166113).

Well, the About window shows version 3.2.0, however if I click on
Feature Details it shows version 3.2.1 for Eclipse Project SDK. Strange...

I'll try to upgrade to 3.2.2 to see if it works better.

--
Patrick
Re: Not a valid line number? [message #246443 is a reply to message #246238] Tue, 31 July 2007 16:37 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Not a valid line number? [message #1292219 is a reply to message #246109] Fri, 11 April 2014 16:28 Go to previous message
yang jinhua is currently offline yang jinhuaFriend
Messages: 2
Registered: April 2014
Junior Member
Hi, have you solve this problem? I have met a same problem with you , if you know how to solve it ,can you tell me ? thank you very much!
Previous Topic:Java Template Doesn't Work With an Indented Brace
Next Topic:Java Compiler Compliance Level not working
Goto Forum:
  


Current Time: Sat Jul 27 01:49:59 GMT 2024

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

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

Back to the top