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

Hi,

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.

Thanks
don_utaAsked:
Who is Participating?
 
objectsCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.