Remote Debugging with eclipse and WebLogic 12c

28 Views Asked by At

'

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?

0

There are 0 best solutions below