cancel
Showing results for 
Search instead for 
Did you mean: 

ClassCastException Destination Service

Former Member
0 Kudos

Hello everybody:

I am trying to develop a JCO client pool. I have read that you can develop that is with the destination service. There are more ways to get this objective but I have others problems:

JCA: I think that I can develop in this way but

- this force me to use the IConnection and Iservice class and I will have to develop the functionality again.

- Another issue is that I don’t know where I can find this service to set up its properties.

JCO Client: there are two ways without pool (directly) and with pool, but the problem is that I have to set the connections parameters directly in the class or with a logon.properties and not with a service. It is only a matter of security and administrator doesn’t want to use that.

Conection with POOL (logon.properties where I get the parameters to do logon)

if (JCO.getClientPoolManager().getPool(POOL_NAME)!=null) {

//There is a Pool, do nothing

}else {

OrderedProperties logonProperties =OrderedProperties.load("/logon.properties");

JCO.addClientPool(POOL_NAME,5,logonProperties); // properties

}

-Destination Service: In this case it doesn’t work because there is a ClassCastException in the third line when tries to cast: (DestinationService) initCtx.lookup (DestinationService.JNDI_KEY);

My code is the following:

Context initCtx = new InitialContext();

String y=DestinationService.JNDI_KEY_LOCAL;

DestinationService dst= (DestinationService)initCtx.lookup(DestinationService.JNDI_KEY);

The problem is that I have developed an AbstractPortalComponent and not EJB and I don’t know how I have to put the reference to the project or simply it doesn’t work if you don’t develop in EJB. I have tried:

- To include the jar into the directory lib but it doesn’t work.

tc_sec_destinations_interface.jar

tc_sec_destinations_service.jar

tc_sec_compat.jar

tc_sec_https.jar

tc_sec_jaas.jar

tc_sec_saml_util.jar

tc_sec_ssf.jar

tc_sec_userstore_lib.jar

- To put the sharing reference and private reference in the portalapp.xml as you ca see below, but with the same result:

<property name="SharingReference" value="tc_sec_destinations_service.jar, tc_sec_destinations_interface.jar"/>

<property name="PrivateReference" value="tc_sec_destinations_service.jar, tc_sec_destinations_interface.jar"/>

Questions are easy:

What I have to do to avoid the classCastException?

Are there any other ways to connect r3 system in an easy way or with another solution in the possibilities I mentioned before?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member192152
Active Participant
0 Kudos

Hi, I have the same problem! My portalapp.xml SharingReference not works...

Please help me.

Best regards,

Angelo

Former Member
0 Kudos

That's interesting. When do you get the ClassCastExceptions? What Java Application Server are you using? Is it possible you are receiving those exceptions after you restart the server, do you un-deploy and re-deploy your application on restarting the server?

What's your exception stacktrace, can you give a potion of it?

The casting code seems OK, looking at http://help.sap.com/saphelp_nw04/helpdata/en/17/d609b48ea5f748b47c0f32be265935/content.htm. Are you running a Glassfish Application Server?

Ivan