Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Unknown source in stack trace(I need to see the line number)
icon5.gif  Unknown source in stack trace [message #499826] Tue, 24 November 2009 09:59 Go to next message
Alexandra Niculai is currently offline Alexandra NiculaiFriend
Messages: 84
Registered: July 2009
Member
Hi

I have a java project that uses swt. Whenever an exception is thrown I can see the line number for my code. The problem is that for the source inside the swt.jar, I can't see the exact line where the exception ocurrs, even if I did attach the source and I can look at the source code of swt. I always get something like this on the stack trace:
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)


I have checked all the boxes in Windows/Preferences/Java/Compiler Classfile Generation, but that didn't solve my problem.
Could anyone please help me? Thank you.

Greetings
Alexandra.
Re: Unknown source in stack trace [message #500223 is a reply to message #499826] Wed, 25 November 2009 12:48 Go to previous messageGo to next message
Svilen Genchev is currently offline Svilen GenchevFriend
Messages: 8
Registered: November 2009
Junior Member
This could be possibly related to the SWT using OS hooks, i.e., it could be that this is some native event generated by the OS and since this is not Java you cannot see it.
Re: Unknown source in stack trace [message #500237 is a reply to message #500223] Wed, 25 November 2009 13:22 Go to previous messageGo to next message
Alexandra Niculai is currently offline Alexandra NiculaiFriend
Messages: 84
Registered: July 2009
Member
Now that you say that, I tested it on an ArrayList, giving it something outside bounds. And here is what is says:
java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.get(Unknown Source)
at somepackage.MyDialog.testMethod(MyDialog.java:208)


It actually doesn't matter where the code is, as long as it's not in the source files.
I know that if I'd compile the classes myself, I should use javac -g option, but I don't know how to set that in Eclipse.
Re: Unknown source in stack trace [message #500254 is a reply to message #500237] Wed, 25 November 2009 14:04 Go to previous messageGo to next message
Svilen Genchev is currently offline Svilen GenchevFriend
Messages: 8
Registered: November 2009
Junior Member
Yes, you would definitely need debugging information. But I don't remember explicitly switching ON this in Eclipse ever(javac options if you are using the default java compiler), i.e., if you haven't switched it off yourself then it should be fine.

Sounds like configuration problem of sorts...
As last resort you may try downloading already bundled for you Eclipse,
http://www.eclipse.org/downloads/, "Eclipse for RCP/Plug-in Developers (183 MB)" sounds about right.
Re: Unknown source in stack trace [message #500262 is a reply to message #500254] Wed, 25 November 2009 14:18 Go to previous messageGo to next message
Alexandra Niculai is currently offline Alexandra NiculaiFriend
Messages: 84
Registered: July 2009
Member
I didn't switch it off, still the only line numbers are for the code I wrote.
Re: Unknown source in stack trace [message #500268 is a reply to message #500262] Wed, 25 November 2009 14:31 Go to previous messageGo to next message
Svilen Genchev is currently offline Svilen GenchevFriend
Messages: 8
Registered: November 2009
Junior Member
Then you have swt.jar built with no debugging information?
Re: Unknown source in stack trace [message #500280 is a reply to message #500268] Wed, 25 November 2009 14:53 Go to previous messageGo to next message
Alexandra Niculai is currently offline Alexandra NiculaiFriend
Messages: 84
Registered: July 2009
Member
I think you are right, I have switched the swt.jar reference to the one in the Eclipse plug-ins and now I can see the line number there. Very Happy
I still can't see a thing for ArrayList, but it's really great that I can now see the information for the classes in the swt package.
Thank you so much!
Re: Unknown source in stack trace [message #500294 is a reply to message #500280] Wed, 25 November 2009 15:34 Go to previous messageGo to next message
Svilen Genchev is currently offline Svilen GenchevFriend
Messages: 8
Registered: November 2009
Junior Member
Glad I could help.
Not seeing source of Java API classes usually means that you are not referring to JDK, but JRE in Eclipse.
For example I am with JDK 6 Update 10 and if I have a look at the home directory (in my case C:\Program Files\Java\jdk1.6.0_10) I have a src.zip which contains all java files making the Java API. I guess Eclipse figures out this itself when you define new Eclipse JRE and point it to your JDK home directory .
icon10.gif  Re: Unknown source in stack trace [message #500319 is a reply to message #500294] Wed, 25 November 2009 16:12 Go to previous message
Alexandra Niculai is currently offline Alexandra NiculaiFriend
Messages: 84
Registered: July 2009
Member
Very Happy You're right again. All problems solved. I set an alternate JRE(C:\Program Files\Java\jdk1.6.0_17) in Eclipse and chose it in my project and now I can see line numbers for everything.
Thank you!
Previous Topic:Create auto-completion using file
Next Topic:Can markers have attributes not registered using org.eclipse.core.resources.markers?
Goto Forum:
  


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

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

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

Back to the top