- This topic has 1 reply, 2 voices, and was last updated 20 years ago by
Scott Anderson.
-
AuthorPosts
-
vincentyeungMemberHello Experts,
I am a newbie to EJB and so I am trying to learn by following the instructions given in tutorials. I am current working on the following simple EJB tutorial that I found in your recommened web site:
http://www.laliluna.de/simple-xdoclet-ejb-tutorial.html
Basically I could follow all the steps and completed the tutorial successfully. However, when I was trying to set break points in the Entity Bean in this example, those breakpoints could NOT be reached.I am not sure but I guess this is because the tutorial is using a separated java project to create the test client (at last page of the tutorial) and so the breakpoints in Entity Bean cannot be reached as they belong to 2 separated projects. Am I right?
For example, the following is the code fragment of the test client in this tutorial:
….
Object object = context.lookup(SimpleHome.JNDI_NAME);
SimpleHome simpleHome = (SimpleHome) PortableRemoteObject.narrow(object,
SimpleHome.class);
Simple simple = simpleHome.create(); <– *** cannot run to breakpoint at the bean’s home interface when calling to this statement ***
simple.setName(“Gunter”);
System.out.println(simple.getId());
System.out.println(simple.getName());
….Could you please tell me how I can solve this problem? How can I make this tutorial test program run to the breakpoints in EJBs?
Please help.Many thanks.
Vincent
Scott AndersonParticipantVincent,
Could you please tell me how I can solve this problem?
Basically, don’t try to step into the entity bean. Simply set the breakpoint directly in it and then let the application “run” to it. The problem is that when bean interface methods are invoked, they run through multiple levels of remote proxy classes, generated and maintained by the server, that you don’t see and don’t have source code for. Think of it as a magic black box you can see into. The only way through that box is by simply allowing the debugger to run to a breakpoint on the other side of it. So, set the breakpoint inside one of the methods you wrote in your EJB, and the debugger should stop there just fine. Just don’t try to step “into the box”. 🙂
-
AuthorPosts