Tuesday, June 5, 2012

JDeveloper 11g Cannot Establish App Server Connection

Very often I see people bump into this error and thought I should make some notes here which might help someone in need.

First of all, I would like to make some inferences from the JDeveloper documentation;

"By default, JDeveloper uses the proxy settings from the default browser on the same machine, adding localhost and 127.0.0.1 to the list of proxy exceptions. If you have problems making connections from JDeveloper, for example, connecting to an application server or a SOAP server that is on the same machine as JDeveloper, you may need to change the proxy server settings you use."

Pre-Requisite:
While trying to establish a connection to the App server from JDeveloper, ensure that the following settings are correct;

1. Weblogic Hostname : resolves to the actual IP address of the server
2. Port: 7001 (default admin server port) or as per your admin port configuration during install. Remember you should only use the admin server port of your WebLogic server here even if you have an architecture where you front end the app server with a HTTP server like OHS
3. Domain: Use the domain name that was created during the WLS configuration

Check 1: Check whether the proxy settings are disabled in JDeveloper. Go to Tools -> Preferences -> Web Browser & Proxy section and ensure that no HTTP proxy server is setup. If already configured, uncheck the check box and click OK

Check 2: Test whether the port 7001 on the WLS host is accessible from the machine where JDeveloper is installed. You can test this with a simple telnet command;

telnet hostname 7001

If this test doesn't succeed then there can be two possible reasons;

1. There can be a network firewall or firewall enabled on the server which blocks this admin port from being accessed from a client machine. If this is the case, then ask your network administrator to open the port. This can be done by adding the port to the ip6tables on the linux server or similar.

2. Do a netstat on the linux server where WebLogic is installed to find out whether the port is open and is available (LISTEN mode). Ensure that your admin server is running when you run this command

eg., netstat -apn | grep 7001

This will show up the ip addresses from which the host can accept requests. Some common causes that I have identified is that the /etc/hosts file contains the ip - hostname mapping as follows;

127.0.0.1          hostname1

When the WebLogic server starts up, it will start all services properly but a closer look at the netstat command reveals that the host accepts connections only from within the server (127.0.0.1). This means that the port is virtually blocked for any requests coming from outside the machine/host itself. To resolve this issue, change the /etc/hosts file entry as follows;

<ip address of host >       hostname1

Now, stop all services and restart the services. This enables all WebLogic ports and accessible from outside the server.

20 comments:

  1. I tried all above & connectivity is fine (netstat & telnet are working as expected), but not able to create connection (0 of 0 tests successful.) Do you have any idea about how this process works, I mean, is jdev call any service/mbean in weblogic server?? I just want to check that service/mbean is enabled/up or not?
    You help is really appreciated. Thanks.

    ReplyDelete
    Replies
    1. Just FYI.., My Issue is resolved, after all investigation, I found that issue with Windows access issue, write access is missing for my user some folders.
      If I login as Admin and run Jdev as admin, I am able to connect to App server.

      Delete
    2. Glad that you got it working. But I am curious to know how access issue could cause that problem. Only thing that could cause such issue is proxy as far as my experience goes. Let me know.

      Delete
    3. Hi Sathya,

      Jdev is installed by admin user, with admin privilages. I think I do not have privilage on some folders.
      If I run Jdev as adminitrator(Right Click -> Run as Admin) I am able to connect to server. If I run in normal mode it is not working.
      I did not dig deeper on issue. If I get some time I will check and update you.

      Delete
    4. Thanks, "Run As Administrator" seems to be the trick.

      Delete
    5. Run as administrator did the trick for me as well. This was frustrating from last 3 weeks but now it's resolved. Thanks Sathya and Jagadeesh.

      Delete
    6. Thank you so much for this suggestion "Run As Administrator". It really helped. I was trying it for so long but nothing worked.

      Delete
  2. Replies
    1. Vijay, Glad it helped. Appreciate your comments.

      Delete
  3. Hi I am getting the below problem,when i am trying the creation appliction server connection in jdeveloper (Using windows machine), It would be great any help for this problem.

    Testing JSR-160 Runtime ... failed.
    Cannot establish connection.
    Testing JSR-160 DomainRuntime ... skipped.
    Testing JSR-88 ... skipped.
    Testing JSR-88-LOCAL ... skipped.
    Testing JNDI ... skipped.
    Testing JSR-160 Edit ... skipped.
    Testing HTTP ... failed.
    Unable to open conection: Connection refused: connect
    Testing Server MBeans Model ... skipped.
    Testing HTTP Authentication ... failed.
    Unable to open conection: Connection refused: connect

    0 of 9 tests successful.

    Yuva

    ReplyDelete
    Replies
    1. Yuvaraj,

      Looks like you are not able to reach the environment from your machine let alone JDeveloper. First, are you able to ping the server from your machine? If not, you should first resolve that issue.

      Delete
    2. Maybe port of server for which you want to connect is not open. first try to ping or telnet that server, if you are unable to do, then first open your ports.

      Delete
  4. i am just trying to configure application server connection from JDeveloper as listed in the below example
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/obpm/11g/r1/firstProcess/firstprocess_obpm11g.htm#t1

    I am at the 3rd step of Mapping the Studio Role to an LDAP Role. Trying to Configuring the Weblogic Hostname.
    When i tried localhost as Hostname the Tests followed by this step are successful.But while doing the identity Look up the Realm is not being visible.
    Can any one please tell me what would be my complete hostname so that the Realm gets visible while doing identity look up.?

    Thanks in Advance

    ReplyDelete
    Replies
    1. Ideally, if your application server connection is successful you must be able to see the security realm. You must give JDev some time to fetch the realm information after selecting the right app server connection.

      Delete
  5. why we are using weblogic server in oracle soa suite

    ReplyDelete
    Replies
    1. Rajender G,

      Oracle WebLogic server is industry's leading application server and Oracle SOA Suite works best on WebLogic. However, Oracle SOA Suite 11g is also supported on IBM WebSphere and RedHat JBoss application servers too.

      Delete
  6. I am trying to create a connection from jdeveloper to jboss application server. when i test d connection, it runs only one test JSR160. Is this the way it should go? or there should be more some more tests running?

    ReplyDelete
  7. Hi Sathya,
    it's working Hi Sathya,

    I run Jdev as adminitrator(Right Click -> Run as Admin) I am able to connect to server. If I run in normal mode it is not working.
    Thanks

    ReplyDelete
  8. Run as administrator worked :) Excellent post and saved quite a lot of my time.
    Thanks.

    ReplyDelete
  9. Hello

    Changing the Weblogic host name, while creating the default domain has helped me.

    Thank you!

    ReplyDelete