B4J Question JRDC2 - Access through 2 ports (17178 and 17179)

LGS

Member
Licensed User
Longtime User
Hello everyone.
I need to connect to 2 databases, so I need to use 2 ports using JRDC2.
Currently I can run JRDC2 without any problem using port 17178, but not with port 17179.

On the firewall - Inbound Rules
Specific ports(17179,17178)

1678207090842.png


config.properties:
DriverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
JdbcUrl=jdbc:sqlserver://localhost:1433;databaseName=Data;encrypt=false;trustServerCertificate=true
User=usr
Password=123
ServerPort=17179

What did I forget to configure?
Please can someone give me a hint?

I appreciate your help
Luis
 

LGS

Member
Licensed User
Longtime User
The connection runs Locally
http://localhost:17179/test

But not with the public IP
http://xx.xxx.xxx.xx:17179/test
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Out of the box (using jRDC2 code unmodified), jRDC2 needs to be recompiled and redeployed after making changes to config.properties.

1) If you want two ports, change config.propeeties to the first port. Compile. Move resulting *.jar file to different folder and run. Next change config.properties to second port, compile and move resulting *.jar file to another location.

2) Modify jRDC2 to use an external config.properties file. Compile and deploy *.jar file in separate folders to use external config.properties (each having unique port #)
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
But not with the public IP
http://xx.xxx.xxx.xx:17179/tes
Ugh, Ninja'd. Is that the public IP address of your router? Your PC? If router, then you need to enable port forwarding. Note that some ISPs use private IP numbers and port forwarding may not work (if your router sees the public IP address and it's not a private IP address, you should be good to go with port forwarding. Unless you ISP blocks ports...)
 
Upvote 0

LGS

Member
Licensed User
Longtime User
I understand what you indicate.
But currently I am only executing and compiling a single JRDC2 project using port 17179, and the detail is that the connection is not accessible from outside, only locally through that port.
Apart from the fact that I need to use 2 ports, and only using port 17179, I can't connect from outside.
My question is, why can't I use port 17179 externally?
1678211063475.png
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
accessible from outside,
What is outside? Are you trying to connect to the server via local network? WiFi? The Internet? Each of these scenarios can have its own issues / solutions.
 
Upvote 0

LGS

Member
Licensed User
Longtime User
I´m trying to conenect via Internet
Through port 17178 I can connect via the Internet without problem

1678211918166.png


But using port 17179 no
This is the point, why 17178 Yes and 17179 No
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Is the computer that jRDC2 runs on directly connected to the internet? Or is there a router? If there is a router, is it configured to port forward 17179?
 
Upvote 0

LGS

Member
Licensed User
Longtime User
Is the computer that jRDC2 runs on directly connected to the internet? Or is there a router? If there is a router, is it configured to port forward 17179?
The computer that jRDC2 runs on directly connected to the internet
 
Upvote 0

LGS

Member
Licensed User
Longtime User
Aeric, thanks for the info.
I will read it.
However, this inconvenience of not being able to use another port (17179) I would like to solve it as knowledge...
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
In a command prompt type
netstat -a -n -o | find "0.0.0.0:171"

Too see if the port is bound properly
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Run the jrdc2 that's bound to 17179. See if you can access it locally. Check it's logs to make sure it's bound to 0.0.0.0:17179. Check netstat and see it it sees the binding. If you run jrdc2 from the ide, the logging you need to check is in red.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0

OliverA

Expert
Licensed User
Longtime User
If you still don't have access, then you need to enable firewall logging to see if it blocks the call. If the firewall does not block/pass the call, then something strange going on with your ISP.
 
Upvote 0
Top