MyEclipseBlue v10.7 - Breakpoints in EJBs not Working

Posted on 2013-01-29
Last Modified: 2013-02-05
I’ve just finished upgrading from MyEclipseBlue v8.6 to v10.7. My reason for upgrading was that I could not get v8.6 to recognize my breakpoints set in EJBs. I would always get the attached error. So now I’m in the upgraded version, and am still getting the error. Will someone please help me get past this? I absolutely need to be able to set breakpoints in my EJBs! The attachment shows 2 screenshots. The first is the error that I get while the server is starting. The second is the error I get when I’m stepping through the code and it gets to an EJB.

I'm using J2EE 1.4 and WebSphere v6.0.

I have tried unchecking the “Add line number attributes” option in the EJB project Java Compiler settings and also the Window=>Preferences Compiler settings. Then I rebuilt the project. Then I rechecked “Add line number attributes” and rebuilt again. Still the same error. I am running a JDK and I’ve also verified that the org.eclipse.jdt.core.prefs file has the .lineNumber=generate line in it.

I'm using a local WebSphere v6.0 server on my PC. All project building is happening within MyEclipse (I'm not using ANT.)

I have a question on the MyEclipseBlue site but so far no answers. Can someone please help? I'm dead in the water until I get this resolved. I do have v8.6 of MyEclipseBlue still installed on my PC. I can't get the breakpoints to work in either version. Please advise.
Question by:oneDayAtaTime
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
LVL 35

Expert Comment

ID: 38835105
I had the same error once, but despite it the breakpoints did work. What happens if you ignore it? Does the flow stop at the breakpoints or not?

Author Comment

ID: 38835992
No, the flow does not stop because the EJB breakpoints don't work. Breakpoints in the web part of my project work, but not in the EJBs. Would appreciate any advice you have. I've tried everything I can find on the web and am stuck.
LVL 35

Expert Comment

ID: 38838582
Can you try cleaning your project before rebuilding it?
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI


Author Comment

ID: 38839567
I've tried cleaning and rebuilding. That doesn't work. A few interesting things I've learned since yesterday. Breakpoints in the Home_Stub and _Stub files work, and these files are located in the ejbModule alongside each Bean file that DOESN'T recognize breakpoints. I also ran the javap -verbose command on my Bean files and see that they DO contain Line Number tables, so they have their line numbers. It must be that MyEclipseBlue is just not recognizing the line numbers in my Bean files. I wonder if it has something to do with the EJB container? Maybe somehow that is blocking the tool from seeing the breakpoints?

If anyone has any suggestions, I'm all ears. At this point, however, I guess I will resort to using log entries and System.out.println. Ugh.

LVL 12

Expert Comment

by:Sharon Seth
ID: 38843008
Tell me how the apps are deployed . I assume the web app deployment is different from the EJB app deployment . Things to take care of when you want to debug apps on web/app servers:
1. All classes should have line numbers in them . You have confirmed this . But I want you to specifically go to the place where the classes are actually deployed and open a class file and check the line numbers

2. The servers should be running in debug mode . Are you starting the server frm within MyEclipse or from WebSphere startup scripts? If the server is in debug mode , you shld be able to see debug threads in the Debug view.

3. The webapp would have the EJB jars as libs . Open one of those service classes that you want to debug (the class , not the java file) and put a break point in it.

Since the IDE is complaining abt missing line numbers , why don't you build once from the ant build . javac taks should have the flag -g set

This is a common prblm that we come across , and am sure this can be resolved .

Author Comment

ID: 38851341
sharonseth, thank you so much for your comment! If you can help me with this, I'd greatly appreciate it! I have been tasked with modifying this J2EE application, but am very much a beginner with J2EE, struts, mvc, and ejb's. So you may have to talk slowly... Sorry.

I've included an attachment with some details around my deployment and my application. As for your comments above, here are my responses:
1) I believe I did check the class files in the place where the classes are actually deployed. I checked the class files in my workspace. If I go to the actual .ear file where the app is deployed on the server, the EJBs are a .jar file at that point and I can't open them.
2) My server is definitely running in Debug mode. I do see threads in my Debug view, but when stepping through and it hits an EJB, it says "Source not found, line not available", and the thread does NOT show a line number.
3) I d not know how to put a breakpoint in a class file, outside of my IDE.
4) I do not know how to build using Ant. Is Ant part of java? Could you maybe step me through it?

Please advise. I'll try to do what you advise. I really would like to get this working!!!! Thank you!!!
LVL 12

Accepted Solution

Sharon Seth earned 500 total points
ID: 38853856
ok , we still need to see if line numbers are present in the jar . You can use winrar or winzip to extract a jar .

But anyways , let me ask you do something :

1. Also attach scrnshts of the debug threads , showing both apps - the web app and the ejb app

2. Verify this : From package explorer , Right click on chmsEJB project --> Properties --> Java Compiler . Here you would see the options for Classfile generation . Check how these properties for chmsEJB differs from the props for chmsWeb.

3.  Manual build - After enabling line numbers from the step above , select chmsEJB project in package explorer , right click and select build project . Follow the same for chmsWeb . After that , deploy and start the server in debug mode in the same way that you normally do.

Debugging an EJB app sometimes is tricky , but the solution turns out to be a 'how did I miss this?' point

Good Luck
Sharon Seth

Author Comment

ID: 38855360
   I've attached my progress so far. I believe, after unzipping the actual jar file, that I do not have line numbers in it. I'm not sure how it's supposed to look, so have a screenshot. But I do not see a line number table in it.
    Maybe I need to manually compile outside of the IDE, using Ant or something? I tried using javac -g on the .java file in my workspace, but get a bunch of "cannot resolve symbol" errors - I'm guessing because that java file is so closely linked with the others that I need to compile the whole project together.
   I'm going to try to look up Ant and see if I can figure out how to compile with it. Meantime, any suggestions?
LVL 12

Expert Comment

by:Sharon Seth
ID: 38856042
Step 3 in my last thread above is for manual compilation . Try that and see . It would generate line numbers

Author Comment

ID: 38856801
Eureka!!! I don't completely understand it, but I got it to work. I played around with building just the EJB part, as you suggested. I also got to thinking about the .jar file being "zipped", and decided to try unzipping it and then building. I've attached the steps I took. The short version is...I went to the deployed app and created a folder called chmsEJB.jar. Then I unzipped the .jar file there. At this point there were still no line numbers in my EJB class files. Then, through MyEclipseBlue, I cleaned and rebuilt JUST the EJB part of my application. After I did that, poof, line numbers. So apparently it is the fact that my app standard deploy wants to have the EJB module as a .jar file. Once I manually expand it out and recompile just that part, it's ok and it runs fine for development.

I did look at the deployed app on my "real" servers and the EJB is just a .jar file, so when I'm done playing with it I suppose I'll need to recompile with the standard build and let it go back to a .jar.

Thank you, Sharon, for taking the time to walk me though some steps!!! I never could have got it without ya!
LVL 12

Expert Comment

by:Sharon Seth
ID: 38857108
Great !! Glad that it worked out . Some points though:
1. You can use a decompiler to see what's in your class files ,instead of javap . Try JAD as an eclipse plugin for this. DJ is another good standalone decompiler.
2. Workspace in the app server directory - as you said it's unconventional , but if it had not been so , could have provided a cleaner setup to debug

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question