facebook

Servlet debugging – Source not found

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

    My system information is below… I’m attempting to remote debug a servlet running under WAS 5.1.2. I did the following:

      Configured MyEclipse Application Servers Webspehere 5 , used WAS JDK, Debug mode on, etc.
      Launched the WAS Server from the MyEclipse user interface – launch completed without errors
      Configured the server under WAS to enable remote debugging
      Set a breakpoint on a line in a class used by the servlet
      From a web browser, posted to a JSP that used the class where I set the breakpoint

    Results:

      When the line of code was hit, stopped at breakpoint in the Debug perspective
      In the console view, UI displayed the message: Source not found for TestWar.loggerTest(PrintWriter) line: 34

    According to the documentation, the source in my project should be used by default. To ensure this, I did some more reading and double checking and found the refernce in the MyEclipse document related to Remote Debugging. The Source tab under MyEclipse Externally Launched Servers | Websphere had the TestWar source define in the Default area as expected, i.e., \testbedSuite\src\testbed.ear\testbed.war\WEB-INF\classes\com\ford\fc\test and TestWar.java was under that directory. Also included in this list were entries for the previous package directory, i.e., …classes\com, …classes\com\ford, etc.

    I then took a different approach. I stopped WAS using the MyEclipse Server Start/Stop Icon and went through the Debug Icon | Debug … MyEclipse Externally Launched Servers | Websphere 5.1 where host was set to fmc1008h0f521 and Port = 7777. I then received the message error:

      Failed to connect to remote VM. Connection refused.
      java.net.ConnectException: Connection refused: connect
      java.net.PlainSocketImpl.socketConnect(Native Method)
      java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
      java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
      java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
      java.net.Socket.connect(Socket.java:452)
      java.net.Socket.connect(Socket.java:402)
      java.net.Socket.<init>(Socket.java:309)
      java.net.Socket.<init>(Socket.java:124)
      org.eclipse.jdi.internal.connect.SocketTransportImpl.attach(SocketTransportImpl.java:47)
      org.eclipse.jdi.internal.connect.SocketAttachingConnectorImpl.attach(SocketAttachingConnectorImpl.java:103)
      org.eclipse.jdt.internal.launching.SocketAttachConnector.connect(SocketAttachConnector.java:131)
      org.eclipse.jdt.internal.launching.JavaRemoteApplicationLaunchConfigurationDelegate.launch(JavaRemoteApplicationLaunchConfigurationDelegate.java:75)
      org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:569)
      org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:788)
      org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlugin.java:955)
      org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)

    WAS Debugging Service set up:

      JVM Debug Port: 7777
      JVM Debug Arguments: -Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777

    What am I doing incorrectly?

    – System Setup ——————————-
    Operating System and version:
    Eclipse version: 3.0.1
    Eclipse build id: 200409161125
    Fresh Eclipse install (y/n): y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins:
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 8
    MyEclipse version: 3.8.3
    Eclipse JDK version: 1.4.1_06
    Application Server JDK version: Websphere 5.1.2
    Are there any exceptions in the Eclipse log file? no

    If this is a DB related question please answer the following:

    RDBMS vendor and version:
    JDBC driver vendor and version, and access type (thin, type-2, etc):
    Connection URL:
    Eclipse error logs related to com.genuitec.eclipse.sqlexplorer packages

    #224695 Reply

    Riyad Kalla
    Member

    I have asked someone more farmiliar with WS to have a look at this, hang tight.

    #224701 Reply

    Scott Anderson
    Participant

    The connection refused message could be caused by Eclipse’s inability to resolve the server (fmc1008h0f521). Can you try configuring the external launch configuration to use localhost as the host and if that doesn’t work try 127.0.0.1.

    For the source lookup issue in your servlet, there should be a button on the class file editor that the debugger brought up that says “Locate Source” did you try pointing it to the proper source file?

    #224719 Reply

    … try configuring the external launch configuration to use localhost as the host and if that doesn’t work try 127.0.0.1 … I can’t see how this would work, but I did it anyway … same results

    … debugger brought up that says “Locate Source” … in the first scenario, the debugger did not bring up any such dialog …

    Let me back up a bit … I did two things and I don’t want to get off track by trying to shoot two things at the same time … first things first … There appears to be two ways to attach to a remote server for debugging from the MyEclipse Lauch Icon on the tool bar and from the Debug dropdown | Debug… etc.

    1) The first thing I did was set up an Application Server through the Preferences | MyEclipse | Application Server | Websphere 5 | 4 panels … base panel … Websphere Server: Enable on, Websphere Home Directory: C:\IBM\WebSphere\AppServer | Host Name: fmc1008h0f521, Server Name: server1, Is Websphere 5.1?: on … JDK panel Websphere Application Server 5.1 (Location: C:\IBM\WebSphere\AppServer\java) … Launch Panel : Debug mode: on … Paths Panel

    2) Then I started the server from the MyEclipse Launch Icon … Server started OK with no errors

    3) The set the breakpoint, hit the jsp/servlet, debug window came alive, got the can’t find source with no button … stuck

    So before continuing on … is this how to do remote debugging? localhost or 127.0.0.1 should not even come into play … the WAS cell/node is set up to be fmc1008h0f521 … and WAS is definititely posting an even to the UI that causes it to display the “no source” message … I’m just following the instructions in the MyEclipse Application Developer Guide – Using Application Servers as follows…

    7.2 Debugging A Deployed Application
    MyEclipse extends the Eclipse debugger platform to support JSP breakpoints and debug actions. Debugging a deployed J2EE application is similar to debugging a standard Java application. From either the Java or JSP source editor you enter breakpoints in the left margin. During application server execution when execution control encounters a breakpoint the Eclipse Debug Perspective is invoked and debug information displayed.

    Note: the application server connector’s Launch mode must be set to Debug in order for breakpoints to be enabled and execution to halt in a breakpoint context. See the connector’s preferences for more details.

    Only after that didn’t work did I go to the MyEclipse Application Developer Guide – Remote Debugging section and go down that path …

    5. Debugging a Remote Server

    MyEclipse provides a special debug launch configuration, MyEclipse Externally Launched Server, that is designed to attach to remote application servers and support full application debugging. To create a launch configuration for your external server, click on the Debug Launch Configuration toolbar button, as shown in Figure 4….. and configured it as stated above

    From documentation … Once you configured the new launch configuration, you can either close it for use at a later time or select the ‘Debug’ option if your remote server is already running and listening for debug connections. After the application server has been started externally and the debug configuration is launched, a new debug process will be shown in the Debug View, as shown in Figure 8. Please note that the Debug View will not be displayed automatically, so you’ll need to either change your perspective to the Debug Perspective, or open the view manually.

    At this point, debugging your application is the same as it would be if you used one of the built-in MyEclipse server connectors to launch the server locally.

    Since all should work given the first scanario, let’s treat these separately.

    #224723 Reply

    Scott Anderson
    Participant

    So before continuing on … is this how to do remote debugging? localhost or 127.0.0.1 should not even come into play … the WAS cell/node is set up to be fmc1008h0f521 … and WAS is definititely posting an even to the UI that causes it to display the “no source” message … I’m just following the instructions in the MyEclipse Application Developer Guide – Using Application Servers as follows…

    This is exactly how you should be configuring and starting the application server, so let’s continue looking at only this scenario. The only other thing I’d suggest is that you configure WebSphere to send all log output to the MyEclipse Console view by following the steps listed in the tutorial here:
    http://www.myeclipseide.com/Articles/WebSphere5.1LogConfiguration/WAS5.1LogConfiguration.html

    Once that’s done, you’ll be able to see any errors thrown during startup to ensure that it really is coming up cleanly. If it truly is starting cleanly, please note that breakpoints in JSP’s won’t be honored because WebSphere doesn’t implement JSR-045. However, from your description it appears you’re setting a breakpoint in a Java servlet and this should certainly work properly. How did you deploy your application? Was it using one of our deployers or a custom script? Did you deploy in exploded format or packaged?

    Next, there are several discussion threads that run down various problems on WebSphere and what the symptoms and
    resolutions are. Can you give these a look and see if you find them helpful?:
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-4315-highlight-websphere.html
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-4237-highlight-websphere.html
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-1552-highlight-websphere.html
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-3611-highlight-websphere.html
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-833-highlight-websphere.html
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-3251-highlight-websphere.html

    #224760 Reply

    I did not deploy using MyEclipse scripts, I had my own. Deployed as an EAR. I also did not use the MyEclipse J2EE mechanism to set up/build my EAR. We had a project already running under WebLogic and we were porting it to WAS.

    I think I’m going to back up a step and set up/build with the MyEclipse J2EE Web Project/EAR, and use your deployer (already using your launcher). Someone in our evaluation group has done to the existing project for Weblogic and has it working as expected. In retrospect, this might have been better than jumping directly to the end game. NP. I’ll let you know what shakes out.

    Also, thanks for the links to the other view topics, however, I read all these prior to writing this topic.

    Thanks again and I’ll give you an update in a couple of days.

    #226491 Reply

    Well, it’s been more than a couple of days, but … when going through the wizards, everything worked fine … thanks for your replies … I do have another question regarding EJBs imported and used in an Enterprise Application. I’ll open another thread on this.

    #283830 Reply

    ts.boobalan
    Member

    This message has not been recovered.

    #283850 Reply

    Riyad Kalla
    Member

    This message has not been recovered.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Servlet debugging – Source not found

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