Menu

Ubuntu datagramSocket.send() problem

Help
2012-11-07
2013-12-04
  • Gonçalo Azevedo

    hello i am working with your code but now i am in a dead end… until now i have been able to develop an applet base on your source code this applet runs in MacOS and Windows without any problem buy the SO that i want to run it is ubuntu 12.04 and i cannot put it to work because i am getting and error in the datagramSocket.send(packet);

    i have did debug to the code and my datagramPacket looks correct but when i do datagramSocket.send(packet); in class (UdpMessageSender) i get the flowing error…

    Java Plug-in 10.9.2.05
    Using JRE version 1.7.0_09-b05 Java HotSpot(TM) Server VM
    User home directory = /home/softcorporatetvuser
    ----------------------------------------------------
    .......
    java.io.IOException: Invalid argument
        at java.net.PlainDatagramSocketImpl.send(Native Method)
        at java.net.DatagramSocket.send(DatagramSocket.java:676)
        at net.sourceforge.peers.sip.transport.UdpMessageSender.sendBytes(UdpMessageSender.java:70)
        at net.sourceforge.peers.sip.transport.UdpMessageSender.sendMessage(UdpMessageSender.java:57)
        at net.sourceforge.peers.sip.transaction.NonInviteClientTransaction.start(NonInviteClientTransaction.java:121)
        at net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequestEnd(InitialRequestManager.java:195)
        at net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequest(InitialRequestManager.java:166)
        at net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequest(InitialRequestManager.java:139)
        at net.sourceforge.peers.sip.core.useragent.UAC.register(UAC.java:96)
        at net.sourceforge.peers.gui.EventManager.register(EventManager.java:185)
        at net.sourceforge.peers.gui.MainFrame$3.run(MainFrame.java:257)
        at java.lang.Thread.run(Thread.java:722)
    

    this only happens in Ubuntu 12.04 with MacOS or windows i have no problem.
    i am running java version 7 update 9 and this applet runs in firefox 16.0 this versions are the same in Macos…

    i have asked about this in google and i found that can be something about how ubuntu manage the buffer sizes…

    do you have any know about this issue?!??

    can you give me some help?

    Best regards
    Gonçalo Azevedo

     
  • yohannmartineau

    yohannmartineau - 2012-11-07

    hi,

    I think I've already seen this issue, did you install jdk using this technique:

      http://alexander.holbreich.org/2011/11/java-7-on-debian/

    maybe you also have to check your firefox plugins either in ~/.mozilla/… or in standard plugins directory for your system?

     
  • Gonçalo Azevedo

    i installed jdk following this guide http://pplware.sapo.pt/linux/dica-como-instalar-o-java-no-ubuntu-12-04-precise-pangolin/

    about firefox i have installed the plugin java(TM) plug-in 1.7.0_09…

    what do you mean about standard plugins directory for you system?!

    by the way thanks for answer me i really need so help to resolve this issue i am without any clues what i should do/go…

     
  • yohannmartineau

    yohannmartineau - 2012-11-08

    standard plugins directory is a directory where plugins are installed for all users, I mean not in $HOME/.mozilla/…/plugins, something like /usr/lib/mozilla/plugins (debian).

    do you have several jdk installed on your system? Could you try to keep only one if you have several.

    Do you have any root exception that occurs before this exception?

     
  • Gonçalo Azevedo

    i am trying to do in a fresh install of ubuntu 12.04! what java install should i get and what java plugin should i put?!!?

    about the root exception no i am not getting any….

     
  • yohannmartineau

    yohannmartineau - 2012-11-08

    iirc, plugin worked with java sun 6 and 7.

     
  • Gonçalo Azevedo

    what do you mean buy iirc?!?can you be more expecific?

     
  • Gonçalo Azevedo

    I did some test and i found out that the problem only exists under ubuntu….i tried under Fedora 17 an this didn't happen….
    any suggestions!??!

     
  • Oscar Xavier Chavarro

    Same problem is happening on Ubuntu 13.04 64bits, under 3.8.0-32-generic kernel. Tested on OpenJDK 1.7 / 1.6 (Ubuntu version) and HotSpot 1.7 (Oracle version) java virtual machines with no luck.

    The weird thing is that problem happens only when compiling from source code (from october 31 2013 svn sources). When downloading a binary version of peers (0.4.3) and testing from "peers.jar", this doesn't happen.

    Perhaps it is something related with the apache maven based build system, or java version. Perhaps is something about new peers version. Perhaps a java virtual machine misconfiguration on Ubuntu ...

     
    • yohannmartineau

      yohannmartineau - 2013-11-01

      hi,

      I've seen this kind of issue with firewalls blocking packets. I would
      probably take a look at your iptables/firewall/selinux rules.

      Did you build using maven and jdk packages from debian/ubuntu/any
      distribution or using official tar.gz provided by maven.apache.org and
      oracle.com installed in a user directory?

      yohann

      On Fri, Nov 1, 2013 at 5:41 AM, Oscar Xavier Chavarro <jedilink@users.sf.net

      wrote:

      Same problem is happening on Ubuntu 13.04 64bits, under 3.8.0-32-generic
      kernel. Tested on OpenJDK 1.7 / 1.6 (Ubuntu version) and HotSpot 1.7
      (Oracle version) java virtual machines with no luck.

      The weird thing is that problem happens only when compiling from source
      code (from october 31 2013 svn sources). When downloading a binary version
      of peers (0.4.3) and testing from "peers.jar", this doesn't happen.

      Perhaps it is something related with the apache maven based build system,
      or java version. Perhaps is something about new peers version. Perhaps a
      java virtual machine misconfiguration on Ubuntu ...


      Ubuntu datagramSocket.send() problemhttps://sourceforge.net/p/peers/discussion/683024/thread/a700e173/?limit=25#a1d9

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/peers/discussion/683024/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • yohannmartineau

    yohannmartineau - 2013-11-01

    hi,

    I've seen this kind of issue with firewalls blocking packets. I would probably take a look at your iptables/firewall/selinux rules.

    Did you build using maven and jdk packages from debian/ubuntu/any distribution or using official tar.gz provided by maven.apache.org and oracle.com installed in a user directory?

    yohann

     
  • Larry Reeder

    Larry Reeder - 2013-12-03

    I'm also seeing this error with the GUI built from peers-code-https source checked out from SVN. I don't think it's a firewall issue because the GUI built from the peers-0.4.3 source package (using Ant) works, as does the binary download. JDK 1.6 and 1.7 exhibit the same problem. I'm also on Ubuntu 12.04.

    Stacktrace is:

    2013-12-03 10:51:01,201 DEBUG [AWT-EventQueue-0] UdpMessageSender.sendBytes
    2013-12-03 10:51:01,201 DEBUG [AWT-EventQueue-0] UdpMessageSender.sendBytes 585 /domain.example.com:5060
    2013-12-03 10:51:01,201 DEBUG [AWT-EventQueue-0] /127.0.1.1
    2013-12-03 10:51:01,201 ERROR [AWT-EventQueue-0] throwable
    java.lang.Exception: java.io.IOException: Invalid argument
    at net.sourceforge.peers.sip.transport.UdpMessageSender.sendBytes(UdpMessageSender.java:70)
    at net.sourceforge.peers.sip.transport.UdpMessageSender.sendMessage(UdpMessageSender.java:52)
    at net.sourceforge.peers.sip.transaction.InviteClientTransaction.start(InviteClientTransaction.java:129)
    at net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequestEnd(InitialRequestManager.java:198)
    at net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequest(InitialRequestManager.java:179)
    at net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequest(InitialRequestManager.java:152)
    at net.sourceforge.peers.sip.core.useragent.UAC.invite(UAC.java:131)
    at net.sourceforge.peers.gui.EventManager$11.run(EventManager.java:271)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.awt.EventQueue$3.run(EventQueue.java:686)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
    Caused by: java.io.IOException: Invalid argument
    at java.net.PlainDatagramSocketImpl.send(Native Method)
    at java.net.DatagramSocket.send(DatagramSocket.java:676)
    at net.sourceforge.peers.sip.transport.UdpMessageSender.sendBytes(UdpMessageSender.java:68)

    Thanks......... Larry
    ... 21 more

    -Larry

     
    • yohannmartineau

      yohannmartineau - 2013-12-04

      hi,

      I made a diff between 0.4.3 and trunk and in my opinion, the only relevant
      modification is in EventManager. I'm now
      calling userAgent.getUac().invite(...)
      using SwingUtilities.invokeLater(...). Thus, sip code is supposed to be
      invoked by a swing worker thread instead of swing gui events thread. I did
      it because long running tasks like creating a sip session should not be
      used in swing gui events thread, but I may have forgotten a sync issue.

      I think I should take a look at it.

      Thanks for reporting,

      For your information, to perform a diff (acutally using winmerge), I just
      copied code from {peers-gui,peers-lib}/src/main/java to a temporary src dir
      and compared this directory with src from 0.4.3.

      yohann

      On Wed, Dec 4, 2013 at 12:19 AM, Larry Reeder lreeder@users.sf.net wrote:

      I'm also seeing this error with the GUI built from peers-code-https source
      checked out from SVN. I don't think it's a firewall issue because the GUI
      built from the peers-0.4.3 source package (using Ant) works, as does the
      binary download. JDK 1.6 and 1.7 exhibit the same problem. I'm also on
      Ubuntu 12.04.

      Stacktrace is:

      2013-12-03 10:51:01,201 DEBUG [AWT-EventQueue-0]UdpMessageSender.sendBytes
      2013-12-03 10:51:01,201 DEBUG [AWT-EventQueue-0]UdpMessageSender.sendBytes 585 /
      domain.example.com:5060
      2013-12-03 10:51:01,201 DEBUG [AWT-EventQueue-0] /127.0.1.1
      2013-12-03 10:51:01,201 ERROR [AWT-EventQueue-0] throwable
      java.lang.Exception: java.io.IOException: Invalid argument
      at
      net.sourceforge.peers.sip.transport.UdpMessageSender.sendBytes(UdpMessageSender.java:70)
      at
      net.sourceforge.peers.sip.transport.UdpMessageSender.sendMessage(UdpMessageSender.java:52)
      at
      net.sourceforge.peers.sip.transaction.InviteClientTransaction.start(InviteClientTransaction.java:129)
      at
      net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequestEnd(InitialRequestManager.java:198)
      at
      net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequest(InitialRequestManager.java:179)
      at
      net.sourceforge.peers.sip.core.useragent.InitialRequestManager.createInitialRequest(InitialRequestManager.java:152)
      at net.sourceforge.peers.sip.core.useragent.UAC.invite(UAC.java:131)
      at net.sourceforge.peers.gui.EventManager$11.run(EventManager.java:271)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
      at java.awt.EventQueue.access$200(EventQueue.java:103)
      at java.awt.EventQueue$3.run(EventQueue.java:688)
      at java.awt.EventQueue$3.run(EventQueue.java:686)
      at java.security.AccessController.doPrivileged(Native Method)
      at
      java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
      at
      java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
      at
      java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
      at
      java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
      Caused by: java.io.IOException: Invalid argument
      at java.net.PlainDatagramSocketImpl.send(Native Method)
      at java.net.DatagramSocket.send(DatagramSocket.java:676)
      at
      net.sourceforge.peers.sip.transport.UdpMessageSender.sendBytes(UdpMessageSender.java:68)

      Thanks......... Larry
      ... 21 more

      -Larry

      Ubuntu datagramSocket.send() problemhttps://sourceforge.net/p/peers/discussion/683024/thread/a700e173/?limit=25#d140

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/peers/discussion/683024/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • Larry Reeder

        Larry Reeder - 2013-12-04

        I see a lot of diffs between trunk and 0.4.3 in the SIP transport code:

         Trunk                                             0.4.3
        ----------------------------------------          ----------------------------------------    
        Checksum   Size   File                            Checksum   Size   File                   
        3449697817 7784   MessageReceiver.java            1993377528 7742   MessageReceiver.java
        1366924022 3181   MessageSender.java              1048776727 3024   MessageSender.java
        3298173691 977    SipClientTransportUser.java     3298173691 977    SipClientTransportUser.java     
        433803587  2575   SipMessage.java                 433803587  2575   SipMessage.java
        433196909  1707   SipRequest.java                 433196909  1707   SipRequest.java
        929473896  1631   SipResponse.java                929473896  1631   SipResponse.java
        341578914  904    SipServerTransportUser.java     341578914  904    SipServerTransportUser.java      
        2006587208 3527   SipTransportConnection.java     2094069615 3557   SipTransportConnection.java    
        4080060148 17545  TransportManager.java           4014410458 16255  TransportManager.java
        4257531069 2266   UdpMessageReceiver.java         4257531069 2266   UdpMessageReceiver.java    
        604506911  2727   UdpMessageSender.java           3006268825 2261   UdpMessageSender.java
        

        Don't know if they are relevant or not....

        Here's a diff for MessageSender.java (trunk on left, 0.4.3 on right):

        <     Copyright 2007-2013 Yohann Martineau 
        ---
        >     Copyright 2007, 2008, 2009, 2010 Yohann Martineau 
        44,45c44
        <     public MessageSender(int localPort, InetAddress inetAddress,
        <             int port, Config config,
        ---
        >     public MessageSender(InetAddress inetAddress, int port, Config     config,
        48d46
        <         this.localPort = localPort;
        53,54c51
        <         timer = new Timer(getClass().getSimpleName() + " "
        <             + Timer.class.getSimpleName());
        ---
        >         timer = new Timer();
        72,73c69
        <         //buf.append(config.getSipPort());
        <         buf.append(localPort);
        ---
        >         buf.append(config.getSipPort());
        

        Thanks......... Larry

         

Log in to post a comment.