facebook

EJB debugging is possible? [Closed]

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

    brunko007
    Member

    Hi ,
    I’m trying debug session been business method but I got
    message

    Class File Editor
    Source not found

    “There is no source file attached to the class file”

    ???
    CAn I setup somewhere classspath to tell dubuger where is the source file?? or can I just debug only jsp???
    I’m using
    Jboss 3.2.3 ,eclipse 2.1.1,Win 2000

    Thank you

    Bruno

    #203000 Reply

    Riyad Kalla
    Member

    Bruno,
    Are you trying to debug your own EJBs or are you debugging EJBs from a commercial package that you don’t have source to?

    When you get that error “Source not found” you should have a button on that screen to ‘attach source’ to that file… are you not seeing that?

    #203011 Reply

    brunko007
    Member

    Thank you for answer…

    I got button ONLY when it was commercial package…so of course
    I dont have source file…

    when it was my application, button “attached source” didnt show up,
    there was only list of methods…

    Any suggestions?

    Bruno

    #203013 Reply

    support-michael
    Keymaster

    when it was my application, button “attached source” didnt show up, there was only list of methods…
    Any suggestions?

    As I understand it you are hitting a breakpoint and are stepping through your codebase when the “source not found” dialog occurs. What code are you stepping into when the situation occurs? I presume it is a system/appserver jar for which no source exists anywhere in the system. If this is the case then consider stepping over such calls. If you wish to observe the inner working of a system jar then you’ll need to find and attach the source.

    #203018 Reply

    Riyad Kalla
    Member

    Bruno,
    As michael has pointed out, if you want to stop into parts of Tomcat (servlet impl or jsp impl) you will need to install the source along with it and attach it. Eclipse will find all the source for YOUR own source code without a problem (hence no option to ‘attach source’, because it already has it).

    If you are trying to step into a commercial app server like websphere or weblogic, then I don’t think you can as they don’t provide source code to download (That I’m aware of).

    #203020 Reply

    brunko007
    Member

    Hi guys,
    Thanks for replay:-)

    …. you will need to install the source along with it and attach it
    I dont understand clearly “along with it ” …should I put my source in some directory /except of one when I have created it?/

    what I ‘m trying to say …It is my own StockTraderBean source file.

    For EJB I simple created stateless bean in src folder and deployed on the server in exploded structure.

    here is my business method in stock trader bean/stateless-doesnt matter/

    public String BrunoBusinessMethod() throws EJBException {

    //DEBUG POINT
    String InspectVar=”some_value”;
    System.out.print(“Print z Bruno Bussines method “);
    return “return value from Bruno Bussines method” ;

    }
    1.bean is deployed ok
    2.run the client in debug mode
    3.I got: whole gray window with text: 🙄

    Source not found for StockTraderBean.BrunoBusinessMethod() line: 146

    4. two steps with arrow on the next line
    5.got

    Class file editor

    with button attached source but it is class from sun/of course I dont have source/

    class sun.reflect.NativeMethodAccessorImpl extends sun.reflect.MethodAccessorImpl {

    private java.lang.reflect.Method method;

    private sun.reflect.DelegatingMethodAccessorImpl parent;

    ……end so on next methods

    I can send you print screens if you are interested in…in word.doc

    Thank you

    Igor

    #203023 Reply

    Riyad Kalla
    Member

    Ahhh Igor:

    It sounds like where it is stopping has nothing to do with your class (like you said its the Sun packages). Can you reply to this and hit the “Insert” button and fill out your system information? If you are setting a break point in your EJB I believe it should be honored, but it *sounds* like it is instead stopping execution in some internal JDK class instead of your class.

    DO you eventually get to your class if you keep hitting the “Step out of” button (far right on the button bar for debugging) once the debugger stops? It seems eventually it should jump into your class and then open up the file and show you where it stopped.

    I don’t do EJB development so its hard for me to say what the problem might be.

    #203041 Reply

    brunko007
    Member

    Hi guys,thanks for all your replays…

    At the mornning I started the computer and it was working 😯 /debugger /night before I was trying put source file almost *everywhere* and step by step I got it. 😆 ../reset,copy,reset,start app server,shut down app server etc…a lot of experiments but on the end is neccesery only setup classpath…

    setup directory structure was like :
    ***********************************************************
    project/src folder …for *.java files (beans)

    –>structure continued with package folders like-

    src/com/igor/trader/ *Some*Bean.java
    ***********************************************************
    project/class folder for *.class files(beans)

    –>structure continued with package folders like-

    class/com/igor/trader/ *Some*Bean.class
    ************************************************************
    remote client in different project folder let say

    client_project/src/client_test_traderbean.java
    ************************************************************

    all what is neccessery is put project/src to classpath for client so when you run debuger from client thread ,debugger(got SomeBean.class) is looking for source file SomeBean.java which should be in classpath for client thread.
    (right click on the client_project ->properties->java buildpath->libraries->add class folder->click on project structure/where is your bean src/
    and src file finally ,click ok–>you should get project/src folder to client classpath/it’s visible in package explorer/

    (anyway you should have there project /class folder already where your SomeBean.class is…) ,remote client is looking for it)

    Otherways you will get window with message 🙄

    “Source not found” …..what is weird I got it without “attach source” button ….. 👿

    anyway it’s working now so I’m happy….. 😆

    Thanks for replay….

    Igor alias 8) Bruno

    #203042 Reply

    brunko007
    Member

    so it’s closed:-)

    #203047 Reply

    Riyad Kalla
    Member

    Thank you for following up with us, I”m glad its working for you now.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: EJB debugging is possible? [Closed]

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