Monday, December 02, 2013

My Tech Experiences: Remote debugging Applet with Eclipse

My Tech Experiences: Remote debugging Applet with Eclipse: Assignment:

Configure Eclipse for remote debugging an applet. The applet will be running on an internet browser. When a breakpoint is reached, Eclipse should suspend allowing the code to be debugged.
 

Solutions:
Java provides a protocol to achieve this. You can look for JDWP in Java documentation for more information. This protocol allows debugging even a simple class. It works with a server-client mechanism. Either eclipse or the browser can be set as server.

Steps:

1.        First, I need to configure the server. I will use eclipse as server, and the applet will be the client.

From the eclipse menu choose the option: Remote Java Application.
I used the following values:

Connection Type: Socket Listen
       Port: 9100  - You can use any value, just make sure the port is not busy. 2.       
Now, I need to configure the client. Since I am using the browser, I will set the values to the JRE the browser uses.


Go to: Control Panel -> Java -> (Go to Java Tab) -> Java Runtime Environment.

And add the following line to the Runtime Parameters:

-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=9100

The port must match the one you configured in eclipse and the option server must be set to 'n'.  You also need to make sure to add the parameters to the correct JRE.
* Like I said, you can debug even a single class. To debug a standalone class or jar use the line like this:
java –jar -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=9100 <class or jar>

 3.        Add some breakpoint to your code. Run the applet from your browser and the breakpoint should be hit.





Tips:


This is a very simple task. However, it does not always work as expected (what software does?) I hope this tips can help you to save some time.

1.      If it does not work try again with a different version of Java. The newest versions seem to have some security features that block the remote debugging. I was able to make it work with JRE. 1.7.0_17.

2.      Verify that your JRE is receiving the values. You can see them in the console.    3.     For some weird reason, sometimes the values seem no to be passed. Try setting them using JRE_Instalation/bin/javacpl.exe window.

4.      Signing the JAR does not seem to be necessary.

5.      You can specify the JRE to use in the applet tag to be sure that you are using the correct JRE. Add the following line to your applet tag.
      <param name="java_version" value="1.7.0_17"/>
6.   The jar does not need to be deployed on a server in order to debug it. For this test I created an applet and put it in a jar. Then I created a simple html file with the applet tag. I open my html in a browser, and it worked fine.

Thursday, May 03, 2012

Edit Webpages

Just paste this in your browser and edit something to play with your friends javascript:document.body.contentEditable='true';document.designMode='on'; void 0

Wednesday, May 06, 2009

Temper

“U cannot control what happens to u, but u can control ur attitude towards it. And in that you’ll be mastering change rather than allowing it to master u.”

There once was a little boy who had a bad temper. His Father gave him a bag of nails and told him that every time he lost his temper, he must hammer a nail into the back of the fence. The first day the boy had driven 37 nails into the fence Over the next few weeks, as he learned to control his anger, the number of nails hammered daily gradually dwindled down. He discovered it was easier to hold his temper than to drive those nails into the fence. Finally the day came when the boy didn't lose his temper at all. He told his father about it and the father suggested that the boy now pull out one nail for each day that he was able to hold his temper. The days passed and the young boy was finally able to tell his father that all the nails were gone. The father took his son by the hand and led him to the fence He said, 'You have done well, my son, but look at the holes in the fence. The fence will never be the same. When you say things in anger, they leave a scar just like this one. You can put a knife in a man and draw it out. It won't matter how many times you say I'm sorry, the wound is still there. ' A verbal wound is as bad as a physical one.

Tuesday, April 21, 2009

எங்கோ எதிலோ எப்போதோ பார்த்தது..

Uncertainty is inevitable, but worrying is optional.

Your today is the tomorrow that you worried about yesterday

Experience is a hard teacher. She gives the test first and the lessons afterwards.

Good judgment comes from experience, and experience comes from bad judgment.

Always count your blessing, not what you are missing.

There are no unanswered prayers. At times the answer is NO.

I don't know the key to success, but the key to failure is trying to please everybody.

Friday, April 17, 2009

I Liked these

நாம் ஒருவருக்கொருவர் ஒரு ரூபாய் கொடுத்தால், நம் இருவரிடமும் ஒரு ரூபாய் தான் இருக்கும்.
நாம் ஒருவருக்கொருவர் ஒரு நல்ல எண்ணத்தை பகிர்ந்தால், நம் இருவரிடமும் இரு நல்ல எண்ணங்கள் இருக்கும்
----------------
நான் மாறும்போது தானும் மாறியும், நான் தலையசைக்கும் போது தானும் தலையசைக்கும்
நண்பன் எனக்குத் தேவையில்லை. அதற்கு என் நிழலே போதும்
----------------

ரோஜா கூட்டத்தில் இருந்துக்கொண்டு ஒரு ரோஜாவை மட்டும் ரசிக்கும் செயல் தான்
'காதல்'
ஆக, சைட் அடிப்போம், சந்தோசமா இருப்போம்

எல்லாம் ஏதோ Blog ல படிச்சது தான்.. ;-)

Monday, March 16, 2009

விளம்பரங்கள்