Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm doing some Java ME Development in my brand-new Ubuntu laptop, coming from a now replaced Windows Vista one.

What I'm trying to do is run a Mobile Simulator that acts as an HTTP Server -receives connections to port 80- and run another one that acts as a client, executing both at the same time. In Windows Vista, this works without problem, when I port mi code Windows 7 I need to turn firewall down to make that happen.

However, now in my Ubuntu laptop i'm not able to get that working. I'm been reading some posts that Unix systems doesn't need a Firewall because several ports are blocked by default, so my question is how can I open this ports to continue development. I'll be making also SMS requests and Bluetooth ones, so I'd like that any request from localhost to localhost is not blocked.

Sytem: Dell Inspiron running Ubuntu 11.1 64 Bits. Development is made in Netbeans using JDK 1.7 32bits

Update:

As requested, here's the Stack Trace:

java.io.IOException: ServerSocket Open
    at com.sun.midp.io.j2me.serversocket.Socket.open(Socket.java:69)
    at com.sun.midp.io.j2me.socket.Protocol.openPrim(Protocol.java:128)
    at javax.microedition.io.Connector.openPrim(Connector.java:329)
    at javax.microedition.io.Connector.open(Connector.java:222)
    at javax.microedition.io.Connector.open(Connector.java:198)
    at javax.microedition.io.Connector.open(Connector.java:180)
    at pe.edu.pucp.teleprocesamiento.server.http.HttpConnectionProcessor.run(HttpConnectionProcessor.java:43)

And also iptables -L -nv output:

Chain INPUT (policy ACCEPT 35777 packets, 34M bytes)
 pkts bytes target     prot opt in     out     source               destination         
35779   34M ufw-before-logging-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
35779   34M ufw-before-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
35777   34M ufw-after-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
35777   34M ufw-after-logging-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
35777   34M ufw-reject-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
35777   34M ufw-track-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ufw-before-logging-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 ufw-before-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 ufw-after-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 ufw-after-logging-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 ufw-reject-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy ACCEPT 31810 packets, 3935K bytes)
 pkts bytes target     prot opt in     out     source               destination         
31812 3935K ufw-before-logging-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
31812 3935K ufw-before-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
31812 3935K ufw-after-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
31812 3935K ufw-after-logging-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
31812 3935K ufw-reject-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
31812 3935K ufw-track-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-after-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-after-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-after-logging-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-after-logging-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-after-logging-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-after-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-logging-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-logging-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-logging-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-reject-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-reject-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-reject-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-track-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-track-output (1 references)
 pkts bytes target     prot opt in     out     source               destination  
share|improve this question
    
Do you get any error message? Also post the output of sudo iptables -L -nv. –  Eric Carvalho May 11 '13 at 15:51
    
I added the information to the post –  Carlos Gavidia May 11 '13 at 16:12
    
Are you running this as an unpriviledged user? Usually only root can open ports <= 1024. –  Eric Carvalho May 11 '13 at 16:23
    
I'm running the simulator from Netbeans, which I open from Dash; so I don't think I'm using root. Is there a way to run Netbeans as root? –  Carlos Gavidia May 11 '13 at 16:26
    
Change the HTTP port from 80 to 8000 and it worked! Now I'm having a problems with SMS :( –  Carlos Gavidia May 11 '13 at 16:32

1 Answer 1

up vote 1 down vote accepted

Change the port to something higher than 1024. Only root can open ports <= 1024.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.