0

'

package org.remotedebug.demo;

import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class RemoteDebug {

    public static void main(String[] args)
    {
        final JFrame frame = new JFrame("Remote debug demo");
        JPanel panel = new JPanel();
        final JButton btn = new JButton("ON");
        
        btn.setBackground(new Color(50,200,100));
        frame.getContentPane().add(panel);
        panel.add(btn);
        frame.setVisible(true);
        frame.pack();
        btn.addActionListener(new ActionListener() 
        {   
            @Override
            public void actionPerformed(ActionEvent e) 
            {
                if("ON".equals(btn.getText()))
                {
                    btn.setText("OFF");
                    System.out.println("Button state changes from ON to OFF");
                    btn.setBackground(Color.RED);
                }
                else if("OFF".equals(btn.getText()))
                {
                    btn.setText("ON");
                    System.out.println("Button state changes from OFF to ON");
                    btn.setBackground(Color.GREEN);
                }               
            }
        });
    }
}
`

I am testing the simple java program to know the remote debugging process.

When I connect my eclipse with local remote server then eclipse connected and I can debug the java program but when I do the same process with Web-logic server then it does not connect.

LOCAL REMOTE DEBUG - WORKING EXAMPLE

C:\Users\Saud Ahmed\Eclipse Workspace-2\RemoteDebuggingTest\src>javac org/remotedebug/demo/RemoteDebug.java

C:\Users\Saud Ahmed\Eclipse Workspace-2\RemoteDebuggingTest\src>java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6666 org/remotedebug/demo/RemoteDebug

Listening for transport dt_socket at address: 6666

Button state changes from ON to OFF

Button state changes from OFF to ON

Local remote debugging Eclipse connected locally

On Web-logic 12c remote debugging

WEBLOGIC 12c REMOTE DEBUG - NOT-WORKING EXAMPLE

[oracle@xyz101 src]$ javac org/remotedebug/demo/RemoteDebug.java

[oracle@xyz101 src]$ java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6666 org/remotedebug/demo/RemoteDebug

Listening for transport dt_socket at address: 6666

Error: Could not find or load main class org.remotedebug.demo.RemoteDebug

Please guide me what I am doing wrong and why its not connecting?

6
  • What Eclipse version are you using? What Java version are you using? Commented Mar 21, 2024 at 9:35
  • Version: 2022-03 (4.23.0) OS: Windows 11, v.10.0, x86_64 / win32 Java vendor: Eclipse Adoptium Java version: 17.0.2 @Abra Commented Mar 21, 2024 at 9:37
  • Replace org/remotedebug/demo/RemoteDebug (in the "not working" example) with: org.remotedebug.demo.RemoteDebug Commented Mar 21, 2024 at 10:17
  • @Abra I have already checked this. I am getting the same response with periodic format Commented Mar 21, 2024 at 10:19
  • Java will look for class org.remotedebug.demo.RemoteDebug according to the CLASSPATH (or module path). Check whether you are using CLASSPATH or module-path and make sure that the actual path is correct. Commented Mar 21, 2024 at 10:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.