Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

UnknownHostException trying to connect to WebService

843833Jun 9 2005 — edited Apr 26 2007
Hi, I have to connect to a WebService and get the following error when running my client-program.
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.net.UnknownHostException: ollilap.hsh-berlin.com
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:java.net.UnknownHostException: ollilap.hsh-berlin.com
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
        at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
        at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:181)
        at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:397)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:135)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
        at org.apache.axis.client.Call.invoke(Call.java:2737)
        at org.apache.axis.client.Call.invoke(Call.java:2413)
        at org.apache.axis.client.Call.invoke(Call.java:2336)
        at org.apache.axis.client.Call.invoke(Call.java:1793)
        at Test.runIt(Test.java:51)
        at Test.main(Test.java:24)

        {http://xml.apache.org/axis/}hostname:Dell1

java.net.UnknownHostException: ollilap.hsh-berlin.com
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)

        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
        at org.apache.axis.client.Call.invoke(Call.java:2737)
        at org.apache.axis.client.Call.invoke(Call.java:2413)
        at org.apache.axis.client.Call.invoke(Call.java:2336)
        at org.apache.axis.client.Call.invoke(Call.java:1793)
        at Test.runIt(Test.java:51)
        at Test.main(Test.java:24)
Caused by: java.net.UnknownHostException: ollilap.hsh-berlin.com
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
        at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
        at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
        at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:181)
        at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:397)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:135)

        ... 11 more
My Test.java looks like this:
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
import java.security.Security;

import org.apache.axis.Constants;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

import javax.xml.rpc.ParameterMode;

public class Test
{
	public static void main(String [] args) throws Exception {
		try {
			runIt();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private static void runIt() throws Exception {
		System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
		Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
		System.setProperty("javax.net.ssl.trustStore","C:/java/olliclientkeystore");

		String ret = "";
		String endpoint = "https://ollilap.hsh-berlin.com:8443/axis/services/MesoWebService";
		Service service;
		Call call;

		service = new Service();
		call = (Call) service.createCall();
		call.setTargetEndpointAddress(new URL(endpoint));
		call.setOperationName("Operation1");
		call.addParameter("Param1", Constants.XSD_STRING, ParameterMode.IN);
		call.addParameter("Param2", Constants.XSD_STRING, ParameterMode.IN);
		call.addParameter("Param3", Constants.XSD_STRING, ParameterMode.IN);
		call.addParameter("Param4", Constants.XSD_INT, ParameterMode.IN);
		call.setReturnType( XMLType.XSD_STRING );
		call.setUsername("user1");
		call.setPassword("pass1");
		ret = (String) call.invoke(new Object[] {"xxx",null,null, new int[] {1,3,5}});

		File f = new File("C:\\WebService.xml");
		if (f.exists() && f.canWrite()) {
			f.delete();
		}
		try {
			FileWriter write = new FileWriter("C:\\WebService.xml",true);
			write.write(ret);
			write.close();
		} catch(IOException e) {
			e.printStackTrace();
		}
	}
}
I know that the host exists so that can't be the error (?).
It would be great if anybody could give me a hint how to solve the problem - I'm running out of ideas.
(Please help a newbie!)

Comments

Kevin Pinsky

[Removed Comment]

-Kevin

[Removed Comment]

-Kevin

Hi Kevin,

     May be functional requirement might be same. But, this article presentation and implementation is completely different to A-team solution. A-team solution will be useful, when a requester\ beneficiary is trying to request a catalog resource for himself.  The solution described in this article, is useful when requester is trying to request resources, for himself or on behalf of someone else as well. Technical implementation is completely different. I request you to go through both the implementations.

      Thanks for your comments.

Note:

      This article is based on 11G R2 PS2. Catalog page is changed a bit, when compared to 11G R2. A-Team article is based on 11G R2. I believe this article is not a duplicate effort.

Thanks and regards,

Venkat

Kevin Pinsky

Hi Kevin,

     May be functional requirement might be same. But, this article presentation and implementation is completely different to A-team solution. A-team solution will be useful, when a requester\ beneficiary is trying to request a catalog resource for himself.  The solution described in this article, is useful when requester is trying to request resources, for himself or on behalf of someone else as well. Technical implementation is completely different. I request you to go through both the implementations.

      Thanks for your comments.

Note:

      This article is based on 11G R2 PS2. Catalog page is changed a bit, when compared to 11G R2. A-Team article is based on 11G R2. I believe this article is not a duplicate effort.

Thanks and regards,

Venkat

After reading through again, you are right that there are differences between the implementation.

Question on your code. In your isEntityProvisioned method, did you mean to retrieve a List<Role> for all types of catalog items?

-Kevin

After reading through again, you are right that there are differences between the implementation.

Question on your code. In your isEntityProvisioned method, did you mean to retrieve a List<Role> for all types of catalog items?

-Kevin

Yes, we might improve this method to retrieve only required catalog items.

Kevin Pinsky

Yes, we might improve this method to retrieve only required catalog items.

I think you misread my post. I was referring to this code:

public boolean isEntityProvisioned(Map provisionedMap, String entityType,

  String entityId) {

  boolean isProvisioned = false;

  if (provisionedMap != null && entityType != null) {

  if (entityType.equalsIgnoreCase(OIMType.Role.getValue())) {

  List<Role> roleList =

  (List<Role>)provisionedMap.get(OIMType.Role.getValue());

  if (roleList != null)

  isProvisioned = roleList.contains(entityId);

  } else if (entityType.equalsIgnoreCase(OIMType.Entitlement.getValue())) {

  List<Role> entitlementList =

  (List<Role>)provisionedMap.get(OIMType.Entitlement.getValue());

  if (entitlementList != null)

  isProvisioned = entitlementList.contains(entityId);

  } else if (entityType.equalsIgnoreCase(OIMType.ApplicationInstance.getValue())) {

  List<Role> applicationList =

  (List<Role>)provisionedMap.get(OIMType.ApplicationInstance.getValue());

  if (applicationList != null)

  isProvisioned = applicationList.contains(entityId);

  }

  }

  return isProvisioned;

  }

The items in bold.  The first one is right, but shouldn't the second be List<Entitlement> and the third be List<Account>

-Kevin

I think you misread my post. I was referring to this code:

public boolean isEntityProvisioned(Map provisionedMap, String entityType,

  String entityId) {

  boolean isProvisioned = false;

  if (provisionedMap != null && entityType != null) {

  if (entityType.equalsIgnoreCase(OIMType.Role.getValue())) {

  List<Role> roleList =

  (List<Role>)provisionedMap.get(OIMType.Role.getValue());

  if (roleList != null)

  isProvisioned = roleList.contains(entityId);

  } else if (entityType.equalsIgnoreCase(OIMType.Entitlement.getValue())) {

  List<Role> entitlementList =

  (List<Role>)provisionedMap.get(OIMType.Entitlement.getValue());

  if (entitlementList != null)

  isProvisioned = entitlementList.contains(entityId);

  } else if (entityType.equalsIgnoreCase(OIMType.ApplicationInstance.getValue())) {

  List<Role> applicationList =

  (List<Role>)provisionedMap.get(OIMType.ApplicationInstance.getValue());

  if (applicationList != null)

  isProvisioned = applicationList.contains(entityId);

  }

  }

  return isProvisioned;

  }

The items in bold.  The first one is right, but shouldn't the second be List<Entitlement> and the third be List<Account>

-Kevin

Yes, you are correct. Thanks for pointing. I will correct it.

877259

Thanks Venkata !! for such an helpful post on Cart Customization!!
I followed all your steps as listed.

I am getting the following errors:

1. In step "17. Update the following attributes on the commandImageLink. Once the changes are made, click OK."

I am not able to update the Action listener = #{CatalogCartDetailsBean.WarningsActionListener} and

I have attached the screen shots. Am I missing something ?

pastedImage_1.png

1.1 and visible=#{CatalogCartDetailsBean.cartItemsAlreadyProvisioned}
pastedImage_2.png

2. Getting a similar error in Step 24:
Disabled=#{CatalogCartDetailsBean.submitButtonEnabled}
here it is not able to find CartEntitiesVOIterator

Have I missed something ?

Thanks,

SK

Nicolás Ibañez

Thanks Venkata !! for such an helpful post on Cart Customization!!
I followed all your steps as listed.

I am getting the following errors:

1. In step "17. Update the following attributes on the commandImageLink. Once the changes are made, click OK."

I am not able to update the Action listener = #{CatalogCartDetailsBean.WarningsActionListener} and

I have attached the screen shots. Am I missing something ?

pastedImage_1.png

1.1 and visible=#{CatalogCartDetailsBean.cartItemsAlreadyProvisioned}
pastedImage_2.png

2. Getting a similar error in Step 24:
Disabled=#{CatalogCartDetailsBean.submitButtonEnabled}
here it is not able to find CartEntitiesVOIterator

Have I missed something ?

Thanks,

SK

Hi guys,
I have the same error, any solution for this?

Thanks in advance!

Leo Martinez

Hi!

Same error over here. Would really appreciate some help on the matter.

Thanks!

3149882

Hi Kevin,

I am also getting same error while updating actionListener as:


Action listener = #{CatalogCartDetailsBean.WarningsActionListener}


Can you please guide how to resolve this error.

Thanks

HJ

Ioanna Kat-Oracle

Same problem here. Has anyone found a solution to this one??

thanks,

Ioanna

Dmitry Berezkin

Same problem here. Has anyone found a solution to this one??

thanks,

Ioanna

From OIM DEV Guide:

Снимок экрана 2017-03-24 в 9.55.32.png

3551561

IS there a solution or workaround for Step 24 ?  Getting same error.  We are using 11gR2 PS3

Thanks

User_QLJZ3

Hi anybody have the source code? Step 5 code is missing.
Anybody or knows if it works in the 11g r2 PS3 or 12c versions? Thanks

1 - 14
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 24 2007
Added on Jun 9 2005
3 comments
11,988 views