Suman Mummaneni

Ranch Hand
+ Follow
since Dec 14, 2004
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Suman Mummaneni


Thank you, Stephan. I got some clarity now. I can remove the Thread completely or Assert when I get an exception.
 

6 years ago

Hello,
I am a bit confused on how to handle InterruptedException when we try to Join a thread to another.
I have a simple Runnable that performs a task that takes some time to complete. I am calling this Runnable from a method using the Thread class. I want the invoking method to wait till the Thread complete.
If an InterruptedException is raised when Thread.join() is called, then I see my beans are not populated completely. Is there any way I can make sure the Thread.run() method completes?




Some links I found on the web but confused  
https://stackoverflow.com/questions/3976344/handling-interruptedexception-in-java



--
Thank you for the help
Suman Mummaneni
6 years ago
Hello All,

Need a quick clarification, can a super class hold a reference to its child class like its going to have Is A and Has A relations. Example below



I saw simillar code in java.util.Calender, Its returning a GregorianCalender a sub class of Calender.
7 years ago
Thanks for your help Campbell.
I have raised a bug for this with IBM JDK internally. They say the Window event for size are not set properly when the font is changed.
This issue is with JDK 6, 7 and 8. They are still working on this issue. Just an update I am using fluxbox as X11 window manager.
Also found that Java 7 and 8 has issue with Font configuration, the standard way does not work on Linux. This bug is reported and not taken care till now, its expected to spill over to JDK 9 releases as well.
FYI bug link.
8 years ago
We are planning to move the application to JNLP based RIA then I think we would need to move it as Java FX app.
I ran the code on several platforms and the re-size happens properly. I only see the issue on Linux specific RHEL 6.0. Ubuntu also worked fine. Not exactly sure what the problem is, we are using IBM JDK 1.8.

8 years ago
The Applet was written very long time ago. I think 20 years back we are now seeing problem with it. With UI and Fonts. The actual application simulates a remote terminal, where you can get a remote session to a machine like Putty.

The canvas is re-sized based on the font size, there is menu that shows the fonts and the sizes. It will resize the canvas based on it. I am creating a new Image using this font and setting it to the canvas.

I think one suggestion is to move to Swing, I am not sure but I can try that and check if it solves my problems.

Here are the results for Java:
bash-4.1# which java
/usr/bin/java

bash-4.1# java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build pxa6480sr1fp10-20150711_01(SR1 FP10))
IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References 20150630_255633 (JIT enabled, AOT enabled)
J9VM - R28_jvm.28_20150630_1742_B255633
JIT  - tr.r14.java_20150625_95081.01
GC   - R28_jvm.28_20150630_1742_B255633_CMPRSS
J9CL - 20150630_255633)
JCL - 20150711_01 based on Oracle jdk8u51-b15

bash-4.1# javac -version
javac 1.8.0-internal
bash-4.1#

8 years ago
Hello,

I have a problem with re-size of the AWT Applet  Frame when Frame.setResizable(false) is set and I want the frame to resize based on the component size that is present in side it. Since its using BorderLayout by default.
I see this problem only on RHEL 6.0 based machine not any other machines with Java 8.
Also please advise me on how to install Java on a RHEL 6 machine manually.

Steps to recreate:
--------------------
Increase the font size to a value >=20 and check if the screen would re-size.
Decrease the font size to it previous value i.e. 12 or 14.
Repeat above steps two are three times you will see the problem.

Here is the code. Please correct me if I missed some thing here. I have removed the Applet and made it as a normal application but I still see the issue.


8 years ago
Thank you all for your response. I have configured the Tomcat server and tried invoking the example applications for Web Sockets. I see all of them are working fine. I think there is some problem with the context path for my application. I need figure this out, as Tim mentioned the WS (Web Service) path differs for each application. I think I need to figure out the exact path that needs to be invoked for my sample Web Socket application.

--
Regards
Suman Mummaneni
8 years ago
Please correct me if I am wrong this is my first websocket application, is the context same as Servlets? Should I modify the xml configuration to make it root? I thought the Annotation will take care of it.
--
Regards
Suman Mummaneni
8 years ago
Hello All,
I need help on WebSockets that I using Tomcat 8.0.32 with WebSocket 1.1. i am not able to get any error on the Server. I am not really sure what is going wrong. Looks like I am missing some think.

Server code
--------------


Client Java Script
--------------------
8 years ago
Never mind guys I got it working. I replaced the with in the server class. After this code change I was able to see the response on the client console.

Look like there is some difference between print() and println() methods. If any info please share
Hi All,
I am just refreshing my Java skills, I got stuck when I was trying to implement a Server Socket and Socket as described in Head First Java. The problem I am facing here is when I send a message from client socket to server it reaches there but when server has to send the same message back to client it fails. But when I stop the server the ClientHandler thread executes and send the message to client socket and I am able to see it on the UI and console. This program is provided as an example in Head First Java, I thought it worked but looks like the server thread is getting stuck, thanks for your help in advance.

Here is the code for client and server and the console output
ChatServer.java


SimpleChatClient.java


Output:

Server Console
suman@suman-pc:~/workspace/ChatServer/bin$ java -classpath . com.chatserver.server.ChatServer
Got a connection
Server-read Hello
^Csuman@suman-pc:~/workspace/ChatServer/bin$ <---------Server program terminated here

Client Console
suman@suman-pc:~/workspace/ChatClient/bin$ java -classpath . com.chatclient.ui.SimpleChatClient
Network Established!
client-read Hello from Server!!!Hello <------------- This was sent after the Server program was terminated and client is still running. Ideally the socket termination error should show up.



Hi Rob and Santosh,
Thanks for clarifying things. Now I really a much better idea of equals(), hashCode() and ==.
15 years ago
Hi Ernest,
Thank you for clarifying my confusion.
Thanks to all for responding to the post
15 years ago
Hi All,
Thanks for the post, plese look at the below code snippet, when you run this the hasCode() will be the same. But the == will fail so what does this eqactly evalutate. I am assuming that == will compare the memory location of the two objects and equals() method will use be compared the object data.


I am assuming that hashCode should be returning the memory loacation of the object is it correct ? Or does hashCode() returns some unique ID



15 years ago