Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 519
  • Last Modified:

MyEclipseBlue v10.7 - Breakpoints in EJBs not Working

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.
MyEclipseBlue-v10-7-EJB-Breakpoi.doc
0
oneDayAtaTime
Asked:
oneDayAtaTime
  • 5
  • 4
  • 2
1 Solution
 
girionisCommented:
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?
0
 
oneDayAtaTimeAuthor Commented:
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.
                         Thanks!
0
 
girionisCommented:
Can you try cleaning your project before rebuilding it?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
oneDayAtaTimeAuthor Commented:
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.

 Thanks!
0
 
Sharon SethCommented:
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 .
0
 
oneDayAtaTimeAuthor Commented:
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!!!
WebSphere-v6-Project-Details.doc
0
 
Sharon SethCommented:
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
0
 
oneDayAtaTimeAuthor Commented:
Sharon,
   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?
   Thanks!!!!
                          Joyce
EJB-Troubleshooting.doc
0
 
Sharon SethCommented:
Step 3 in my last thread above is for manual compilation . Try that and see . It would generate line numbers
0
 
oneDayAtaTimeAuthor Commented:
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!
                                          Joyce
Configure-EJBs-4-Breakpoints.doc
0
 
Sharon SethCommented:
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
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now