WINDOWS| InetAddress.isReachable(3000) return false when database is up

382 views
Skip to first unread message

Razec

unread,
Jan 27, 2011, 7:17:21 AM1/27/11
to DBJMIN
Hi folks,

Recently introduced DBJMIN for friends. I installed the windows
version(DBJMIN RC05 - dbjmin-win.zip) But when to try connect to a
Oracle 10g doesn't work.

*Problem:*Database is *UP* but InetAddress.isReachable(3000) return
*false*.

I investigated and found an interesting thing, always DBJMIN check if
database isAlive (ret = address.isReachable(3000)) and return true or
false.

Unix Like implementation use ICMP (ping). The windows version use TCP
to port 7 (echo).

"Windows, as strange as it seems, does not officially support an ICMP
"ping" system call. The J2SE 5 implementation hence tries to open a
TCP socket on *port 7* (the echo service) and hopes to get some sort
of reply." - Simone Bordet

There are 2 bugs related: 4727550(Will not fix), 5061568

DBJMIN CODE - Always check it.
Class: */trunk/DB2-JMIN-SWING/src/db2jmin/pojo/util/ReachServer.java *
{{{

InetAddress address = InetAddress.getByName(host);
ret = address.isReachable(3000);

}}}

So is impossible to connect through Windows because DBJMIN always
return false.
I tried to ping and return false too, because is windows problem.
After a time I not found a *good solution* so a made temporary
solution (commited):

[http://code.google.com/p/dbjmin/source/detail?r=136]

When OS name is Windows I can't check isAlive.

DBJMIN it works.

If anyone has another solution I would appreciate it.

Please let me know if you have any questions or concerns

Mir0

unread,
Jan 27, 2011, 7:43:37 AM1/27/11
to dbj...@googlegroups.com
Hi Razec,

Talking about "alive" issues. I can see you are pretty good ;-)
Good shot man. I'll take a look.

Thanks

Miro


--
You received this message because you are subscribed to the Google Groups "DBJMIN" group.
To post to this group, send email to dbj...@googlegroups.com.
To unsubscribe from this group, send email to dbjmin+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dbjmin?hl=en.


JOSE DAMICO

unread,
Jan 30, 2011, 5:14:45 PM1/30/11
to dbj...@googlegroups.com
Thanks a lot Razec. 

2 things about dbjmin 0.5:

1) I am not 100% confident about this release. We should take more time just for tests (and test cases in the wiki section). Seems to me that there are some features that were working in the 0.3 release and is not working anymore.

2) Your findings about InetAddress.isReachable(3000) were quite interesting. I would like to ask to you to generate a new jar file (and publish at downloads section) with your workaround.

Let's keep in touch. And again, thank you for the contribution.

Best Regards,

Jose Damico

2011/1/27 Razec <mra...@gmail.com>

Mario Ponciano

unread,
Feb 3, 2011, 3:06:40 PM2/3/11
to dbj...@googlegroups.com
Hi Team,

I added dbjmin-05_rc3.zip for download. 
Added the issue about InetAddress.isReachable(3000)  http://code.google.com/p/dbjmin/issues/detail?id=3&can=1 and fixed with temporary solution.
I can`t update the url index because not access. Damico, Could you please update the index with  new version RC3?

Important: Generated a new jar from trunk.

Mir0 thank you for helping us.

Regards,

Mario Ponciano - a.k.a: Razec

Mario Ponciano

unread,
Feb 3, 2011, 8:22:59 PM2/3/11
to dbj...@googlegroups.com
Team,

I found an "elegant solution". =)

The previous test we were using to ping the host. But now I'm using ServerSocket and verify the database port (1521) in this case.
If the port is truly connects otherwise not.

I code commited please check: http://code.google.com/p/dbjmin/source/browse/trunk/DB2-JMIN-SWING/src/db2jmin/pojo/util/ReachServer.java?spec=svn138&r=138

I posted about it on the blog: http://razec.wordpress.com/2011/02/04/bug-solucao-inetaddress-isreachable3000/

If you know another "like" implementation, please let me know.

Thanks in advance,


Mario Ponciano - a.k.a: Razec

Reply all
Reply to author
Forward
0 new messages