Skip to Content
avatar image
Former Member

exception in P4-HTTP

Hi

I have this P4-HTTP example

import javax.naming.InitialContext;

import javax.naming.NamingException;

import java.util.Properties;

public class ExampleTransportTypesSwitching {

   private static InitialContext ctx = null;

   public static void main(String[] args) {

   init ("P4HTTP://", "172.16.10.65", "50004", "administrator", "123QWEasd", "httptunneling");

  }

   public static void init(String schema, String host, String port, String user, String pass, String transportType) {

   try {

  Properties p = new Properties();

   if (schema == null) {

  schema = "P4://";

  }

  p.put("java.naming.factory.initial", "com.sap.engine.services.jndi.InitialContextFactoryImpl");

  p.put("java.naming.provider.url", host+":"+port);

  p.put("java.naming.security.principal", user);

  p.put("java.naming.security.credentials", pass);

   // Parameter transportType for Transport Layer Queue has value
  // "None", "ssl", "httptunneling_ssl" or "httptunneling".
   p.put("TransportLayerQueue", transportType);

   ctx = new InitialContext(p);

  System.out.println("NamingClient context: " + ctx);

  } catch(NamingException e) {

  e.printStackTrace();

  }

  }

on my server SAP NW 7.4 listen 50004,50007,50008 ports. I can send and receive successfully RMI requests, but over HTTP don't can. I got this exception

java.net.SocketException: Connection reset

  at java.net.SocketInputStream.read(SocketInputStream.java:209)

  at java.net.SocketInputStream.read(SocketInputStream.java:141)

  at java.net.SocketInputStream.read(SocketInputStream.java:223)

  at com.sap.engine.services.httptunneling.HttpLib.readLine(HttpLib.java:159)

  at com.sap.engine.services.httptunneling.HttpLib.readHeader(HttpLib.java:182)

  at com.sap.engine.services.httptunneling.HttpTunnelingSocket.createConnection(HttpTunnelingSocket.java:208)

  at com.sap.engine.services.httptunneling.HttpTunnelingSocket.<init>(HttpTunnelingSocket.java:113)

  at com.sap.engine.services.httptunneling.HttpTunnelingTransportFactory.getSocket

Please help, what I do wrong?

tnx

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 01, 2015 at 11:34 AM

    For P4HTTP default port number is 5NN05 (NN - instance number). Moreover, you need to add schema to java.naming.provider.url.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 01, 2015 at 12:07 PM

    thanks for reply.

    But in my servers don't open 5NN05 port, need enable manually ?

    Add comment
    10|10000 characters needed characters exceeded