[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1042
  • Last Modified:

How to call remote server with truststore from stand alone java program


I am trying to call the EJB in WAS container from outside machine using stand alone java program. Error I am getting is
Exception in thread  javax.ejb.CreateException: JNDI lookup failed for "ejb name, javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "iiop://hostname:port".  Make sure that any bootstrap address information in the URL is correct and that the target name server is running.  A bootstrap address with no port specification defaults to port 2809.  Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. [Root exception is org.omg.CORBA.TRANSIENT: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine:host=hostname,port=0  vmcid: IBM  minor code: E02  completed: No]

In provider URL I have iiop://hostname:port. Also WAS container is secured and I guess I need to pass truststore and or keystore.

Can anybody tell me how to set truststore and keystore in stand alone java program so that I can call remote server to access ejb.

1 Solution

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now