3 Replies Latest reply on Jun 21, 2001 2:03 PM by 3004

    java.net.UnknownHostException

    3004
      Here's the error I am seeing...this is upon trying to register a web provider that my development team has put together.

      Error: An error occurred when attempting to call the providers register function. (WWC-43134)
      An unexpected error occurred: ORA-29532: Java call terminated by uncaught Java exception: java.net.UnknownHostException: portal.somedomain.net(WWC-43000)
      An unexpected error occurred: java.net.UnknownHostException: portal.somedomain.net
      at java.net.InetAddress.getAllByName0(InetAddress.java:599)
      at java.net.InetAddress.getAllByName0(InetAddress.java:544)
      at java.net.InetAddress.getAllByName(InetAddress.java:537)
      at HTTPClient.HTTPConnection$EstablishConnection.run(HTTPConnection.java:3658)
      (WWC-43000)

      We have been able to get it to work on several development systems, where the hostname of the web server and the name served by Apache is the same. The difference now is that the hostname served by Apache is portal.somedomain.net, where the hostname is webapp.somedomain.net (NOTE: actual hostnames and domains have been changed to protect the innocent).
      Portal is working correctly under this configuration...I have setup the JPDK 1.1. and can execute the samples correctly. I have also successfully registered a database provider that uses several custom packages/portlets that are database driven.

      The Oracle Portal Development Kit Troubleshooting FAQ... http://otn.oracle.com/products/iportal/files/pdkdec/articles/troubleshooting.java.html
      ...says to add your IP address and hostname of the webserver to your hosts file and/or to register your server name with DNS. I then checked my web servers local hosts file to double-check that I hadn't forgot to add an entry for the Apache driven hostname (Apache probably wouldn't have started in the first place without it)...same error. I then thought that maybe it HAS to be able to query and resolve DNS, so I setup a DNS server internal to our development network (not fun) with the name/IP of my webserver...same error. Next, I thought that maybe there was a problem with the java side not being able to properly use java.net.InetAddress functions, so I put together a couple of test programs. One implements java.net.InetAddress.getByName...the other implements java.net.InetAddress.getAllByName

      And, after testing the first (uses java.net.InetAddress.getByName)...
      [oracle@webapp troubleshoot]$ java NSLookup portal.somedomain.net
      Host name: portal.somedomain.net
      IP address: 192.168.1.30.
      [oracle@webapp troubleshoot]$

      ...and then testing the second (uses java.net.InetAddress.getAllByName)...
      [oracle@webapp troubleshoot]$ java myportal
      portal.somedomain.net/192.168.1.30
      [oracle@webapp troubleshoot]$

      ...shows that java can call the hostname and subsequently resolve the IP address.
      I was able to successfully register the web_provider if I substitued the IP address for the hostname in the URL on the registration form. ie.: http://portal.somedomain.net/servlets/web --> http://192.168.1.30/servlets/web
      I don't think we want to do this over the long haul, but it might be a workaround in the interim. It bothers me that I can not enter the hostname of the web server and have it register. And when the java exception is thrown, no errors appear in any of the log files, which I have setup to debug status in order to give the maximum amount of information possible. Any information/tips/hints/pointers that anyone can provide would be most appreciated.
      Thanks,
      Mike

      null
        • 1. java.net.UnknownHostException
          3004
          Mike,

          So let me get this straight. Your Portal is on server portal.somedomain.net and your webportlet is on webapp.somedomain.net. You can call this web portlet by the IP address, but not by the hostname webapp.somedomain.net. It seems that you setup a DNS, etc. Have you have checked that on the server portal.somedomain.net, you can ping the full name: webapp.somedomain.net.

          ping -a webapp.somedomain.net

          It should work from remote webserver. We do all our testing here on different machines. Normally the case is that if server/box can see the machine then portal should be able to see it as well.

          You may have already done this, but just want to verify because it normally works okay.

          Please let me know,

          Sue

          null
          • 2. java.net.UnknownHostException
            3004
            Sue,
            Here's my setup...
            The server itself is named webapp.somedomain.net
            I actually want to serve the URL http://portal.somedomain.net from host webapp.somedomain.net
            So, I have implemented the ServerName directive in httpd.conf to be portal.somedomain.net and Apache will start correctly and I can execute JPDK samples from the http://portal.somedomain.net URL. I can even get it to show me information from my custom provider (provider.xml) by pointing my browser to http://portal.somedomain.net/servlets/code/
            It reports back the server_root and timeout values within provider.xml.
            However, when I then enter the above URL in the provider registration page, it throws the error I mentioned in my initial thread. I can do an nslookup from the web server and it gives me...
            [oracle@webapp oracle] nslookup portal.somedomain.net
            Server: spike.1.168.192.IN-ADDR.ARPA
            Address: 192.168.1.40

            Non-authoritative answer:
            Name: portal.somedomain.net
            Address: 192.168.1.30

            spike is the DNS server that I setup for our local subnet.

            The two snippets of java code that I put together were, in effect, testing the nslookup function. In fact, the second one uses the exact java function (java.net.InetAddress.getAllByName) that gives my error!
            I'm even pointing other boxes on our subnet to spike(DNS) for name resolution of my webserver...browsers used on these clients can enter Portal, login, and even view pages.
            The only thing left that I can figure is that maybe my DNS server is not doing reverse DNS lookups properly and maybe that is what it takes to get it to work, or maybe that spike is not setup to be the authoritative DNS server for portal.somedomain.net...I'm not a DNS/BIND expert, in fact, this was my first attempt at setting a DNS server up...maybe my reverse DNS lookups are working. I'm going to get one of my colleaugues who administrates the DNS servers at my company to take a look at my configuration and see what he thinks is going on. I hope this information can clear up any confusion created by my initial post. Please let me know what you think. BTW, I am using Portal v. 3.0.6.6.5 that is provided by Oracle 9iAS for Linux, which I downloaded from Technet.
            Thanks again for your time,
            Mike
            • 3. java.net.UnknownHostException
              3004
              I have a similar problem where I have portal installed on a machine called portal.mgmt, which is on a network that users cannot access. Connection to portal.mgmt can only be made from our local network via a machine called install.mgmt. In a sense I guess it is acting like a reverse proxy or firewall.

              I have run ssodatan on portal providing the install.mgmt URL and can access most of Portal pages navigating to http://install.mgmt/ except any of the servlets. Actually the only servlet I can access is the sample IsItWorking servlet.

              In my java jserv.log file I am getting the following error:

              java.net.SocketException: Connection reset by peer
              at java.net.PlainSocketImpl.socketAvailable(Native Method)

              I can only assume, from reading the Troubleshooting guide as mentioned above, that portal.mgmt is trying to make a separate connection to the install.mgmt box and is failing.

              The network between portal.mgmt and install.mgmt is very restricted as to what can be run and what protocols and ports can be used. Is this restriction causing the problem?

              I see that Jserv uses port 8007, is this port used to communicate between machines?
              Are there any ports that need to be opened?

              I have tried using another machine called ogg as the firewall/access server and get the following error as well.

              java.net.UnknownHostException: ogg
              at java.lang.Throwable.fillInStackTrace(Native Method)

              Any help on this one would be very much appreciated, as I am very stuck at the minute.


              Regards,

              Garry
              null