cancel
Showing results for 
Search instead for 
Did you mean: 

Deployable web service proxy DC issue

Former Member
0 Kudos

After getting useful pointers to deployment issues for the web service deployable proxy () here, I am now having a different issue with the deployed proxy.

1. I have non DC versions of the Web service deployable proxy and the client EJB code for which the lookup code from the EJB client code works absolutely fine.

Ref section <b>Implement the session bean</b> on page 40 of the PDF <b>Providing and Consuming Web Services</b>on this URL : https://www.sdn.sap.com/irj/go/km/docs/library/nw/netweaverdevelopersguide2004s/sap%20netweaver%20developer's%20Guide%202004s/UsingJava_00_PDFsList.ca

2. For the dc version of the two i.e. Deployable proxy and the Client EJB , my code

fails giving a class cast exception at the statement

CreditLimitCheck obj = (CreditLimitCheck)
ctx.lookup("java:comp/env/CreditLimitCheckProxy");

the JNDI registry of the server shows following

  • wsclients [Context]

  • proxies [Context]

  • <VENDOR_NAME> [Context]

  • <DEPLOYABLE PROXY APPLICATION NAME> [Context]

+ <FULLY QULIFIED CLASS NAME OF THE WS PROXY>

+ [Class Name] : <FULLY QULIFIED CLASS NAME OF THE WS PROXY><b>Impl</b>

Note the Class name is appended with Impl which is not a class available at compile time.

I can see the DC & NON DC version of deployable proxy having the same kind of JNDI registry entries , only difference being the Vendor name getting changed from <b>sap.com</b> to the one for my SWC setup.

The question here being, same code in NON DC setup works fine , but the same put inside DC gives me a class cast exception. Has anybody faced similar situation with deployable proxy DCs?

Rgds,

Amol

Accepted Solutions (0)

Answers (1)

Answers (1)

sid-desh
Advisor
Advisor
0 Kudos

Hi Amol,

This can be done in DC projects also i believe. Just go to ejb-j2ee-engine.xml of the client ejb and add jndi mapping with the following values:

Application Local JNDI name - CreditLimitProxy

Server Component Type - Interface

Server Component JNDI Name - /wsclients/proxies/sap.com/CreditLimitCheckProxy/com.sap.demo.proxy.CreditLimitCheckProxy

Please try out and let us know

Regards

Sidharth

Former Member
0 Kudos

Sidharth,

A quick question ...

The description for server Component Type in the referenced PDF is

<b>Server component type – Choose the type of the reference. The types can be

service or interface depending on the component type that is referenced.</b>

My current value for Server component Type in the DC project is <b>Service</b>. I wonder if this could be the reason of ClassCastException..Will try and let you know.

Regards,

Amol

Former Member
0 Kudos

Sidharth,

It din't work with Server component type = Interface either :(...any clues?

-- Amol

Former Member
0 Kudos

Just to bring this up again...

experts...any pointers?

The same code when put inside a dc gives class cast exception..why?

Former Member
0 Kudos

Hi Amol,

I am also getting the same problem. Did you get any solution for it? If yes please share at the earliest.

Regards,

Priyanka

Former Member
0 Kudos

I had the same problem and found the issue. This post is to help anyone else that runs across it.

If you get to this point you probably did the following:

Set up a deployable proxy DC.

Added all the entries to the various xml files.

Had a problem with deployment of the ear due to the reference type being set to 'hard'.

Changed the reference type to 'weak' to get the deployment to work.

The Reference type really needs to be set to 'hard'.

The issue is that the Reference target name needs to be set to the deployable proxy name. For example, if the proxy DC is named 'testprxy' then the Reference target needs to have this name. If you are using NWDI tracks (not a local DC), then the name will include the SC name (ex. abc~testprxy where abc is the SC name).

Also, the provider name should be the same as the vendor name used for the DC.

If the proxy DC full path name is: com.myco.abc.proxies.TestProxy -

Summary of names and paths to use for the various entries:

In ejb-j2ee-engine.xml - Server component JNDI name

/wsclients/proxies/myco.com/abc~testprxy/com.myco.abc.proxies.TestProxy

In application-j2ee-engine.xml - Reference target

abc~testprxy (or just testprxy if it is a local DC)

Use any name for the Application local JNDI name in the ejb-j2ee-engine.xml. But this is the only place in the xml files where this name is used.

If you use MyTestProxy as the Application local JNDI name, then the reference in code for the context lookup would be 'java:comp/env/MyTestProxy'.

Just remember local DCs don't have an SC name to include (which was 'abc~' in the examples above).

When in doubt about the JNDI name (full path), use Visual Administrator to look at the JNDI registry (start at wsclients which is at the bottom of the list).

Hope this helps.

-Cindy