facebook

java debugging problem

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #197586 Reply

    zabo
    Member

    My env is: winXP, jdk1.4.2, eclipse2.1.1 and myeclipse2.5.1

    In one of my projects, debugging java code has become difficult now. Every time I set a breakpoint, when the breakpoint is reached it stops in the good line, but as soos as I step over (F6), it stops in the wrong line (one below the correct line yesterday, two below today). Also I cannot see some local vars I added, it looks as if the code being debuged is not the most current?

    I tried exiting eclipse and restarting, but no luck.

    Also, while debuggin jsp, it stops in the <html:html> line (the breakpoint is lower in the file), if I hit continue it does not stop in the breakpoint.

    I will add as a sidenote that sometimes some files (either .properties and .xml files) are not copied when doing a deploy, modifying and saving the file makes it get copied generally but it is an inconvenience.

    And lastly a feature request, in order to save space I mostly code after doing a ‘Go into’ a project in the exploreer, but the deploy menu for myeclipse is only visible from the root of the project, so I have to go steps higher to get it. Would it be possible to add that menu to the myeclipse menu in the menubar and being active no matter where inside the project you are?

    Maybe I should have separated all that into different posts… sorry.

    thanks,

    #197588 Reply

    support-michael
    Keymaster

    In one of my projects, debugging java code has become difficult now. Every time I set a breakpoint, when the breakpoint is reached it stops in the good line, but as soos as I step over (F6), it stops in the wrong line (one below the correct line yesterday, two below today). Also I cannot see some local vars I added, it looks as if the code being debuged is not the most current?

    As you identify the problem is that the runtime code is out of sync with your source.
    Q1: is this a regular Java project or a MyEclipse project? If a MyEclipse project, is it a web project, EJB project, or EAR project? I’m assuming we are discussing a web project.
    Q2: is the debug session for a project deployed on an appserver? If yes, what appserver and was the project deployed using MyEclipse deployment tools or other mechanism, e.g., Ant script?
    Q3: does the problem occur in other Java files in this project?

    I will add as a sidenote that sometimes some files (either .properties and .xml files) are not copied when doing a deploy, modifying and saving the file makes it get copied generally but it is an inconvenience.

    The MyEclipse deployment logic does not discriminate against such non-Java resources. Therefore you should not have to touch these resources to force their deployment.

    Q4: Where in the project directory structure are these files located?
    Q4a: Are these resource colocated with Java source?

    a feature request, in order to save space I mostly code after doing a ‘Go into’ a project in the exploreer, but the deploy menu for myeclipse is only visible from the root of the project, so I have to go steps higher to get it. Would it be possible to add that menu to the myeclipse menu in the menubar and being active no matter where inside the project you are?

    I have entered your enhancement request into our issues/req’s tracking system.

    Michael
    MyEclipse Support

    #197593 Reply

    Scott Anderson
    Participant

    A few more questions:
    What is the build id of your Eclipse 2.1.1 installation (Help > About Eclipse Platform)?
    Was Eclipse 2.1.1 a clean installation or do you have other plugins installed in it?
    After performing a rebuild all on the workspace, are the problems resolved or do they persist?

    –Scott
    MyEclipse Support

    #197600 Reply

    zabo
    Member

    Hi guys,

    Q1. Yes, a web project
    Q2. Yes, tomcat5.0.4, forgot to add it sorry. It was deployed by myeclipse
    Q3. shit, while trying to verify that it started working fine (including the offending java file…), but I think all the new java files were ignored (not sure though). My machine has been hibernating for a couple of hours, and I have redeployed the webapp, but that I did it yesterday (and more than that) and it did not solve the problem…

    Q4. Just know they werent copied, they are located in src/com/…/apackage/a.properties and src/com/…/bpackage/b.xml (src being the java source for myeclipse)
    Q4a. yes

    Q5. Version: 2.1.1
    Build id: 200306271545
    Q6. I have 3 or 4 more plugins installed

    thanks

    #197602 Reply

    Scott Anderson
    Participant

    After performing a rebuild all on the workspace, are the problems resolved or do they persist?

    Is your web projects build output folder set to WebRoot/WEB-INF/classes?

    What is your preference setting for Window > Preferences > Workbench > Perform build automatically on resource modification? This setting sometimes “turns itself” off.

    –Scott
    MyEclipse Support

    #197609 Reply

    zabo
    Member

    @scott wrote:

    After performing a rebuild all on the workspace, are the problems resolved or do they persist?

    Is your web projects build output folder set to WebRoot/WEB-INF/classes?

    What is your preference setting for Window > Preferences > Workbench > Perform build automatically on resource modification? This setting sometimes “turns itself” off.

    –Scott
    MyEclipse Support

    The old java code being used yes, that seems to be solved.
    The .properties and xml files arent copied yet.

    Yes, build is to webroot/WEB-INF/classes

    Perform build automatically on resource modification is set

    z,

    #197615 Reply

    Scott Anderson
    Participant

    The old java code being used yes, that seems to be solved.

    Then for whatever reason your workspace got into an “unbuilt” state. But, since this is now corrected, we’ll move on.

    The .properties and xml files arent copied yet.
    Yes, build is to webroot/WEB-INF/classes

    Are the xml files and properties copied to the classes directory when you build? Are the class files copied from the classes folder to the corresponding classes folder in the deployment directory? But you’re saying that the xml files are not? If you do a redeploy with the server shutdown is everything copied?

    –Scott
    MyEclipse Support

    #197622 Reply

    zabo
    Member

    @scott wrote:

    The old java code being used yes, that seems to be solved.

    Then for whatever reason your workspace got into an “unbuilt” state. But, since this is now corrected, we’ll move on.

    The .properties and xml files arent copied yet.
    Yes, build is to webroot/WEB-INF/classes

    Are the xml files and properties copied to the classes directory when you build? Are the class files copied from the classes folder to the corresponding classes folder in the deployment directory? But you’re saying that the xml files are not? If you do a redeploy with the server shutdown is everything copied?

    –Scott
    MyEclipse Support

    About the first problem, I had it again, and this time rebuilding all did not solve it.

    Second one:no, this two files are consistently being left out when copying to the deploy dir. All the other stuff is copied fine. I am no longer able to make them being copied by modifying and saving them. The redeploy with the server shutdown does not help either.

    thanks

    #197625 Reply

    Scott Anderson
    Participant

    This is very peculiar.

    Q6. I have 3 or 4 more plugins installed

    It could be some sort of interference problem. Is anything in the .log file (<workspace>/.metadata/.log)? If so, please email to support@…

    Could you install a fresh version of Eclipse 2.1.1, in parallel (I’m not suggesting you replace your current version), and install MyEclipse 2.5.1 on that and see if you can replicate the problem on the new installation?

    –Scott
    MyEclipse Support

    #197628 Reply

    Wayne Kidd
    Member

    I had a problem like this that occurred because I have different versions of source in 2 projects. If I If I close the project that has the out-of-date source, the problem goes away.

    Wayne

    #197907 Reply

    zabo
    Member

    @scott wrote:

    This is very peculiar.

    Q6. I have 3 or 4 more plugins installed

    It could be some sort of interference problem. Is anything in the .log file (<workspace>/.metadata/.log)? If so, please email to support@…

    Could you install a fresh version of Eclipse 2.1.1, in parallel (I’m not suggesting you replace your current version), and install MyEclipse 2.5.1 on that and see if you can replicate the problem on the new installation?

    –Scott
    MyEclipse Support

    Sorry, I have been on vacation 🙂
    I see there are some stack traces in my log, I will send it to support.

    As far as trying a new install I will try if I have some time (not now), but as I told that is happening only in one project, and I am using myeclipse in several.

    regards,

    #197916 Reply

    Scott Anderson
    Participant

    I looked at the log file and only notice one stack that went through our code:

    
    java.net.ConnectException: Connection timed out: connect
    ...
    at com.genuitec.eclipse.j2eedt.core.builder.XMLResourceParser.parse(Unknown Source)
    ...
    

    This is caused by leaving XML validation turned on but not being connected to the network. The parser tried to retrieve the DTD for a deployment descriptor and timed out. The workaround is to turn of XML validation when not connected to the network.

    There are several errors like the following in the file, which is most likely the source of the debuggin anomoly:

    
    com.sun.jdi.InvalidStackFrameException
        at org.eclipse.jdi.internal.MirrorImpl.defaultReplyErrorHandler(MirrorImpl.java:252)
    ...
    

    This is an interaction problem between the Eclipse debugger and the JDK. It doesn’t go through any of our code. There have been reports that there are some debugging issues when using the combination of Eclipse 2.1.1 and JDK 1.4.2. However, some people have reported it works fine for them. It really looks like a JDK interaction problem. To verify this I’d suggest installing JDK 1.4.1 and using it to launch the server to see if it clears up the issue on this one project.

    –Scott
    MyEclipse Support

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: java debugging problem

You must be logged in to post in the forum log in