Lock up problem in a simple chat app

Hello,
I have a problem with my application locking up. I know that's a
very general problem but let me elaborate.
I have a standard cllient server setup with server part having
3 functions: login,logout and say. When i start my first client
everything is just fine (as long as the client is alone).Pretty much
as soon as i start another client (on another machine) i start having
problems. The clients can exchange about 2-3 lines and then they both
lock up.
Below is the line from the server:
user.receiveChat("server","you were logged in successfully!",Color.red);
user class is a subclass of UnicastRemoteObject and it implements
a subclass of remote interface. Its the same story for the server.
Both of the above objects are fields in 2 other Classes (MessageServer
and MessageClient respectively).
The above line results in the user object executing
the following function on its client object:
<code>
public void receiveChat(String name, String message,Color c) throws java.rmi.RemoteException
synchronized(client)
client.receiveChat(name,message,c);
Thread.currentThread().yield();
</code>
then the client executes this :
public void receiveChat(String name,String message,Color c)
synchronized(doc)
try
// System.out.println(message);
StyleConstants.setForeground(attributes, c);
StyleConstants.setBold(attributes,true);
doc.insertString(doc.getLength(),name+": ",attributes);
StyleConstants.setBold(attributes,false);
doc.insertString(doc.getLength(),message+"\n", attributes);
catch(BadLocationException e)
System.out.println(e.toString());
pane.getVerticalScrollBar().setValue(pane.getVerticalScrollBar().getMaximum()+10);
Thread.currentThread().yield();
And that's that.
It seems like this started happening when i replaced my plain old
textarea with the JTextPane for the color support.
Any ideas or suggestions are welcome.
thanks!

as a follow up:
i took out JTextPane and put JTextArea back in and it works like a charm. Anyone have any idea how i could get my colored lines without the
lock ups??

Similar Messages

  • Developing Simple Chat App in ADF

    I have JDev 11.1.2.1.0.
    Can anyone provide any references to develop a simple chat app?
    I want it for:
    Two PCs connected together over a LAN.

    Hi,
    You would probably use Active Data Service, see here for an example of a simple Google Talk client: http://www.oracle.com/technetwork/articles/jellema-googletalk-094343.html
    Documentation: http://docs.oracle.com/cd/E24382_01/web.1112/e16182/adv_ads.htm#BEIDHJFD
    Regards,
    Joonas

  • Servlet chat app with ajax

    Hi
    First of all I don't have much experience on servlets.
    This is what I'm trying to accomplish, a simple chat app on the website.
    I know a little bit of java networking, so my idea was to write a server on the side and connect it with the servlet so I can manage incoming messages and broadcast them to other users.
    What is the cleanest and best way to achieve this? Is my idea wrong?
    Thanks in advance.

    Chat apps don't really lean themselves towards http technology.
    That is because HTTP is a request/response model. - a PULL , not a PUSH.
    With messaging, when you receive a message from someone, you want to send it out to all the interested parties. Unfortunately you don't know who or where they are, so you have to wait until one of them comes to you and asks "are there any messages for me?"
    You might want to check out pushlets as a way of using HTTP technology in a push manner, but for the most part I would say you are dealing with innapropriate technology. An applet/activex control would be more in line with this.
    Just my 2 cents,
    evnafets

  • Nokia chat app error. temporary service problem. ...

    nokia chat app error.  temporary service problem. (Code 403)  what can i do?

    Hi CLONEDmack
    The following problems can cause a connection error:
    Loss of network coverage
    Network congestion
    Invalid or missing SIM card
    Incorrect access point name (APN) settings
    Incorrect date or time on your mobile device
    If my post helped you, please don't forget to click on the "White Star" and if it resolved your issue click on "Accept as Solution"

  • HT4528 i am having problems since downloading ios8.  app freezing, display orientation locking up, calls coming into multiple phones associated with same apple id.  Anyone else having these issues?  i did not download the update

    i am having problems since downloading ios8.  app freezing, display orientation locking up, calls coming into multiple phones associated with same apple id.  Anyone else having these issues?  i did not download the update

    No.  But thank for asking.

  • Chat app. Problem

    do 0 hi frndss..
    M using my nokia e5 from last 15 days.
    But its inbuilt chat app. Shows an temp. Error(3)
    while sign in..
    Plz. Help. And plz tell me the location where the access points
    of service provider's are storrd.
    B'coz i wanna delete unused apn's.
    Thinks it's happns due to conflicts of same apn's

    Nokia's chat application is buggy, most time it doesn't work properly. U better install any third party chat application like Nimbuzz or Fring.
    Access points are stored in Tools > Settings > Connections > Access Points > destination (internet/mms/wap)

  • Need Help with Simple Chat Program

    Hello Guys,
    I'm fairly new to Java and I have a quick question regarding a simple chat program in java. My problem is that I have a simple chat program that runs from its own JFrame etc. Most of you are probably familiar with the code below, i got it from one of my java books. In any case, what I'm attempting to do is integrate this chat pane into a gui that i have created. I attempted to call an instace of the Client class from my gui program so that I can use the textfield and textarea contained in my app, but it will not allow me to do it. Would I need to integrate this code into the code for my Gui class. I have a simple program that contains chat and a game. The code for the Client is listed below.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    public class Client
    extends JPanel {
    public static void main(String[] args) throws IOException {
    String name = args[0];
    String host = args[1];
    int port = Integer.parseInt(args[2]);
    final Socket s = new Socket(host, port);
    final Client c = new Client(name, s);
    JFrame f = new JFrame("Client : " + name);
    f.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    c.shutDown();
    System.exit(0);
    f.setSize(300, 300);
    f.setLocation(100, 100);
    f.setContentPane(c);
    f.setVisible(true);
    private String mName;
    private JTextArea mOutputArea;
    private JTextField mInputField;
    private PrintWriter mOut;
    public Client(final String name, Socket s)
    throws IOException {
    mName = name;
    createUI();
    wireNetwork(s);
    wireEvents();
    public void shutDown() {
    mOut.println("");
    mOut.close();
    protected void createUI() {
    setLayout(new BorderLayout());
    mOutputArea = new JTextArea();
    mOutputArea.setLineWrap(true);
    mOutputArea.setEditable(false);
    add(new JScrollPane(mOutputArea), BorderLayout.CENTER);
    mInputField = new JTextField(20);
    JPanel controls = new JPanel();
    controls.add(mInputField);
    add(controls, BorderLayout.SOUTH);
    mInputField.requestFocus();
    protected void wireNetwork(Socket s) throws IOException {
    mOut = new PrintWriter(s.getOutputStream(), true);
    final String eol = System.getProperty("line.separator");
    new Listener(s.getInputStream()) {
    public void processLine(String line) {
    mOutputArea.append(line + eol);
    mOutputArea.setCaretPosition(
    mOutputArea.getDocument().getLength());
    protected void wireEvents() {
    mInputField.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    String line = mInputField.getText();
    if (line.length() == 0) return;
    mOut.println(mName + " : " + line);
    mInputField.setText("");

    Thanks for ur help!i have moved BufferedReader outside the loop. I dont think i am getting exception as i can c the output once.What i am trying to do is repeat the process which i m getting once.What my method does is first one sends the packet to multicasting group (UDP) and other method receives the packets and prints.

  • Rotate the front camera in Android for video chat app

    Hi,
      I developing a video chat app on Android with Adobe AIR 3.6 beta.
    I currently using the Camera, Microsphone and Video classes. I panning to use StageVideo next
    I understand fully that Adobe has stated that when using the Camera do it in Landscape mode.
    Problem is my compnay wants it in Portrait mode only and is not interested in landscape video chatting app at all!
    I can do this in native Java code with 6 lines of code by rotateing the camera,
    but it seems impossible on Adobe Air mobile.
    What I tried
    a) Rotate the display object contain the video which has my camera attached
    Result: It works! It only solves half my problem as the video is still being transmitted  in landscape mode
    b) Using Matrix and transform
    Result. Does not work correctly and does not help as the video is still being transmitted in landscape mode
    What I am considering
    a) Build an ActionScript Extension that calls native java code that rotates the camera
    Boy is this really nessscary?
    b) Create another Netstream and copy the video stream contains the landscape vidoe feed into an bytearray and then
    transpose the array and feed it into a newly created Portrit video feed!
    Is this evan technically possible?
    I understand peope will say that just accept landscape but that not an option right now
    Any hep is greatly appreciated. I cannot be the first engineer that wants a Portriat locked video chatting appp on Android using Adobe AIR

    I ran into this very same problem building a video conf app that could rotate in any direction on the device.
    I ended up doing what you tried for A, but took it a little further. I injected information into the stream I was sending so I would know what to do on the other side.... information including not only the oriention of the video, but orientation of the device as well as the Microphone activity level. (because i needed to know everyones mic levels on all devices).
    Yes this is a workaround but at least it's a solution.
    something like this....
    netsream.send("onActivity", {micActivity:this._microphone.activityLevel});

  • CC aplications go to white screen and lock up the computer when switching between apps

    We have been successfully using CC for several months, then about 30 days ago suddenly when we tried to switch apps between dreamweaver, and Photoshop the computer went to a White screen and froze.  This problem is completely repeatable, and we are at a complete loss to correct the problem.  Any ideas? It doesnt do this when you switch withing Bridge and Photoshop, but with anythign else,,,,,,,,,,,,,,, CRASH!!

    I am unable to get into the chat.  I tried explorer and chrome and neither will allow us to access the chat.  It continues to go around and around.
    De: John T Smith 
    Enviado el: Thursday, November 20, 2014 8:41 PM
    Para: Beatriz Neto
    Asunto:  CC aplications go to white screen and lock up the computer when switching between apps
    CC aplications go to white screen and lock up the computer when switching between apps
    created by John T Smith <https://forums.adobe.com/people/JohnTSmith>  in Adobe Creative Cloud - View the full discussion <https://forums.adobe.com/message/6949285#6949285>

  • My problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for example i have gone into options and set sav

    ''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/986549 /questions/986549]''
    my problem is very simple......firefox wont allow me save my downloads to any other location than my c drive....for example i have gone into options and set save downloads to my e drive....but still firefox keeps saving them to my c drive....i have 4 internal hard drives in my rig....and have tried saving downloads to them all.......why this is happening i cant understand....i have tried lots of suggestions....and have re-installed firefox multiple times

    hello, there's a general regression in firefox 27 that won't allow files to download directly into a root drive. please try to create a subfolder (like ''E:\Downloads'') and set this as default location for downloads...
    also see [https://bugzilla.mozilla.org/show_bug.cgi?id=958899 bug #958899].

  • Looking for a chat app to use offline in the same network

    Hi
    I want an offline app for my customers to download and use in our wireless network.
    This app shouldn't go online.
    Simply customers device will choose a nickname.
    With this nickname he/she will be chatting with people in same network.
    Preferably it will be a simple chatroom for everyone.
    There are so many chat apps. All talking to world. I want it just inside the hotel complex.
    Probably there should be a server side of this app (guessing)
    All your help is much appreciated.
    You might just let me know a paid, chat server, customisable, running on both android or ios.
    Probably a browser adress will be given to customers, than they log in and chat from there?

    Flex has a history manager (Flex 2) and deep linking feature
    (Flex 3).
    For more information see
    http://labs.adobe.com/wiki/index.php/Flex_3:Feature_Introductions:_Deep_Linking
    and
    http://livedocs.adobe.com/flex/3/html/deep_linking_1.html
    Peter

  • I am feeling so ripped off right now. I have wanted a Mac for years and believed the hype about it's stability and I have had more trouble with this Imac 2011 than I have ever had with a pc. It locks up with several software products from APP store.

    I am feeling so ripped off right now. I have wanted a Mac for years and believed the hype about it's stability and I have had more trouble with this Imac 2011 than I have ever had with a pc. It locks up with several software products from APP store. I have already had to have a technician to look at it and really couldn't figure out what the deal was.  I was told that the APP store software should give me no problems but the truth is that it locks up on the software. This machine is only 4 weeks old and I am using 37 g on a 1 T hard drive. There is no reason for it to be locking up. Also, when I try to use the help program, it always tells me that I am not connected to the internet even though I have used both the mail program and the browser with no problem just before that. I successfully used the help program on my pc lots of times. I did not need a $2000. plus machine to just get email. I just wanted to unload on somebody that might understand my pain and after checking out this site...I think there is a few of you out there.

    I was told that the APP store software should give me no problems but the truth is that it locks up on the software.
    The apps downloaded from the Mac App Store are written by third party developers, not Apple. If you have problems  with those apps you need to visit the support area for their websites. Launch the App Store, locate the app name. You should see a support link.
    when I try to use the help program, it always tells me that I am not connected to the internet even though I have used both the mail program and the browser with no problem just before that
    Go to ~/Library/Preferences. Move the com.apple.helpviewer.plist file from the Preferences folder to the Trash. Restart your Mac, try the Help menu.
    If you need help finding that file, hold down the Finder icon in the Dock then click: New Finder Window. From the menu bar top of your screen click: Go > Go to Folder. Type this in exactly as you see it here:   ~/Library/Preferences/com.apple.helpviewer.plist    That will take you right to that file.
    (.plist) files stores information about a particular app or in this case, the Help viewer. Often times deleting the .plist file resolves the issue.
    It's fine to "unload"... we understand that you expect your iMac to be stable but there are times when things go awry. That's why we have these forums so that you can you get help.
    You may want to read up on how to repair the disk if necessary or reintsall Lion >  OS X Lion: About Lion Recovery
    Apple - Find Out How - Mac Basics
    How to "switch" from PC to Mac >  Apple - Support - Switch 101
    I'm sorry you feel, "ripped off", but you are using the world's most advanced operating system and it may take some time to adjust to a new OS.   http://developer.apple.com/technologies/mac/

  • Can't get simple Struts app to work when using DCs

    Hello,
    I need to use Struts to develop web apps. I took a simple example app of 3 screens and was able to get it working fine in local development.
    Then I tried to do same thing using DCs in a Track. The first page of the app is a jsp called login.jsp. That file has the following two lines at the beginning:
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    This works fine in local development. However in the DC I get the following error when I try to run login.jsp:
    Application error occurs during processing the request.
      Internal error while parsing JSP page C:/usr/sap/J2E/JC00/j2ee/cluster/server0/apps/com.firstenergycorp/pilot_webapp~strutsear/servlet_jsp/struts/root/login.jsp.
      Details:   com.sap.engine.services.servlets_jsp.lib.jspparser.exceptions.JspParseException: Tag library descriptor cannot be found for uri:{1}.  The ID of this error is
    Exception id: [000F1FCC15FA00450000000F00000CA4000400A8BC089FE5].
    The struts-html.tld and struts-bean.tld are both in the WEB-INF folder of my Web Module DC.
    So why am I getting this error?
    Thanks in advance for any help.
    David.

    David,
    we are using Struts in our application without any problems. But we don't deploy via JDI but build the ear-files in Netweaver Studio and deploy with SDM.
    I guess the tag libs are not added properly to the war file of your productive environment. Can you check whether they contain the files in the correct path ?
    And you shouldn't mix Tag Libs and struts.jar of different versions (e.g 1.0 + 1.2). That will result in the very same error message.
    Regards, Astrid
    Regards, Astrid

  • Trying to discard an app into TRASH and I receive a message that "app cannot be removed because it is locked."  How can I unlock an app???

    Trying to discard an app into TRASH and I receive a message that "app cannot be removed because it is locked."  How can I unlock an app???

    Something may have corrupted your User account permissions. Whatever it was that did that is likely to do it again, and will require further investigation.
    To reset your User account permissions perform the following. It may not fix the problem but it will not make it any worse:
    Boot OS X Recovery by holding ⌘ and r (two fingers) while you start your Mac.
    When the Mac OS X Utilities screen appears, select Utilities > Terminal.
    In the Terminal window type resetpassword and press Enter. A window will open behind Terminal that looks like this:
    Do not enter a new password.
    Select your startup volume at the top. From the dropdown below it, select the user account with the problem.
    At the bottom of the window, you will see Reset Home Directory Permissions and ACLs.
    Click the Reset button.
    Quit Reset Password
    Quit Terminal
    Quit OS X Utilities and restart your Mac.
    Back up your system before doing anything else because disk corruption is another possibility that has to be considered.

  • [Request] Impomezia simple chat

    IMPOMEZIA Simple Chat — is a simple cross-platform client-server chat for local networks and the Internet with the possibility of individual settings for a specific network, with open source code, written in Qt/C++.
    Homepage:  http://impomezia.com
    qt-apps page: http://qt-apps.org/content/show.php/IMP … ent=138608
    Source for download: http://schat.googlecode.com/files/schat … 38.tar.bz2

    It is already here http://aur.archlinux.org/packages.php?ID=41181 my bad...
    Maybe if someone want to make -svn version

Maybe you are looking for

  • No Scaling When I Try to Print an Email

    I'm running OS X 10.9.5 on my computer. Trying to print an email from the Mail App (the one that comes with OS X). All configurations for printing are on scale to fit size on A4. Yet, no emails scale and they end up being 3 pages long, having halv of

  • Services tab in Service Purchase Order for Limit SC is not filled in

    Hello All As per the standard behaviour if a Free text SC is created for Services , the PO is created with one line item having description as " service item " and under the Services tab we can see the line items. But when we create a SC from Limit f

  • How can I get back images that keynote just decided to lose?

    I Was working on a presentation for 2 hours and all of a sudden the pictures disappeared! If they don't come back I can't risk doing that again, it could be the new surface pro instead!

  • Older Software Request...DESPERATE!

    Here is the short story: Got an old Macbook Pro with really old CS2 Illustrator/Photoshop. Upgraded iPhone/iTunes. When I went to sync, computer says needs new itunes which will not download on my old system software. So I can upgrade my computer to

  • Texts(iMessages) not syncing between iPhone and iPad. How can it be fixed?

    After installing IOS .7.2 update for version 7.0 My texts no longer sync. Happens to sent  and received. I have texts on iPad thatt didn't arrive on my iPhone and vise versa. Internet all good on both. My texts usually come in at the same time to iPh