7 Replies Latest reply: Apr 4, 2012 7:41 AM by 919712 RSS

    Http Binding - Unable to access the following endpoint(s): REPLACE_WITH_ACT

      Hi ,

      Issue : HttpBinding end point url for REST based service is throwing an error at run time.
      Error is --->Unable to access the following endpoint(s): http://localhost:7001/RestApp-demo-context-root/jersey/databaseInsertREST/insertIntoCustomers


      Step 1: I have created a simple REST based web service in java. The following is the code.


      package demo;

      import java.sql.Connection;

      import java.sql.DriverManager;
      import java.sql.PreparedStatement;

      import javax.jws.Oneway;
      import javax.jws.WebMethod;
      import javax.jws.WebService;

      import javax.naming.Context;
      import javax.naming.InitialContext;

      import javax.sql.DataSource;
      import java.sql.*;
      import java.util.Hashtable;

      import javax.ws.rs.Consumes;
      import javax.ws.rs.FormParam;
      import javax.ws.rs.POST;
      import javax.ws.rs.Path;
      import javax.ws.rs.PathParam;
      import javax.ws.rs.Produces;
      import javax.ws.rs.QueryParam;
      //import javax.ws.rs.core.Context;
      import javax.ws.rs.core.MediaType;
      import javax.ws.rs.core.UriInfo;

      public class DatabaseInsertREST {
      public DatabaseInsertREST(){

      // Specifies that the method processes HTTP POST requests

      public String insertIntoCustomers(Customers customer) {
      Context ctx = null;
      Hashtable ht = new Hashtable();
      ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
      try {
      ctx = new InitialContext(ht);
      DataSource ds = (DataSource)ctx.lookup("jdbc/SampleDataSource");
      Connection con = ds.getConnection("weblogic", "weblogic123");
      int i = 0;

      PreparedStatement pstmt =
      con.prepareStatement("INSERT INTO CUSTOMERS VALUES(?,?,?)");
      pstmt.setString(1, customer.getFirstName());
      pstmt.setString(2, customer.getLastName());
      pstmt.setString(3, customer.getCompany());


      } catch (Exception ex) {
      return "success";
      Step 2:The end point URL of the deployed service is -

      Step 3: Testing in Browser

      I tested with Browsers' Poster ( in my case Chrome poster) by passing following input and it worked well with no issues.


      Response as follows:

      status: 200 OK
      Date: Sat, 25 Feb 2012 21:22:47 GMT
      X-Powered-By: Servlet/2.5 JSP/2.1
      Transfer-Encoding: chunked
      X-ORACLE-DMS-ECID: aee8c876a5798c5e:6624b71d:135b5f03400:-8000-0000000000000440
      Content-Type: text/plain

      ( I saw my backend DB and record is inserted too)
      Step 4 :
      I created a Http binding in SOA composite by using the same above end point ( which was working from browsers post). But when I run , I get the following error

      Non Recoverable System Fault :
      Unable to access the following endpoint(s): REPLACE_WITH_ACTUAL_URL

      Non Recoverable System Fault :
      Unable to access the following endpoint(s): http://localhost:7001/RestApp-demo-context-root/jersey/databaseInsertREST/insertIntoCustomers

      Non Recoverable System Fault :
      <bpelFault><faultType>0</faultType><remoteFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): REPLACE_WITH_ACTUAL_URL</summary></part><part name="detail"><detail>Unable to access the following endpoint(s): REPLACE_WITH_ACTUAL_URL</detail></part><part name="code"><code>null</code></part></remoteFault></bpelFault>

      I have spent so much of time , trying to resolve this . Appreciate your help.


      Edited by: Sridhar-SOA on Feb 27, 2012 3:23 AM