cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro References

Former Member
0 Kudos

Hi,

With Java AS CE 7.1 EHP1 or CE 7.2 or any other version where Web Dynpro References are deprecated and using any MDM server before MDM 7.1 SP04:

If you have used the MDM library

com.sap.mdm.tech.mdm4j

as runtime dependency from a Web Dynpro DC, please let me know how the dependency is added;

Thanks;

Edited by: Harish Gali on Aug 13, 2010 4:41 PM

Edited by: Harish Gali on Aug 13, 2010 4:41 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Harish,

You need to do the following:

1) Take the JAR's contained in the SCA and create an External Library DC with them and add two public parts - one for assembly and one for compilation.

2) Create an Enterprise Application DC to wrap and deploy the DC created in (1).

3) Now, in your own Web Dynpro DC, reference the two DC's above for the compilation and runtime references.

Detailed steps for (1) and (2) can be found in this blog:

External Library Deployment and Usage in SAP NetWeaver Developer Studio (NWDS)

[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60d99678-1a29-2d10-94b4-9d9a67b7199b]

Regards,

Walter

Former Member
0 Kudos

Hi Walter,<br><br>

Currently the MDM JARs are packaged in a EAR DC like youu2019ve described, and referenced from a Web Dynpro DC - it all works fine;<br>

We establish a pooled connection to MDM server:

UserSessionContext.setConnectionType(ConnectionTypes.LOCAL_POOL_CONNECTION)

;<br><br>

Now we are trying to establish connection to MDM server using the MDM Connector;<br>

For this, the MDM_JAVA_API SC is already deployed on the AS u2013 it contains the MDM JARs library com.sap.mdm.tech.mdm4j & the connector;<br>

And we changed the earlier option while establish connection to UserSessionContext.setConnectionType(ConnectionTypes.JCA_CONNECTION);<br><br>

When we try to execute, it throws ClassCastException:

<br>

u2026<br>

u2026<br>

Caused by: com.sap.mdm.commands.CommandException: com.sap.mdm.net.ConnectionException: Problem while creating JCA connection to MDM server 'xxx<br>

at com.sap.mdm.commands.GetRepositoryRegionListCommand.execute(GetRepositoryRegionListCommand.java:94)

<br>at com.sap.mdm.session.SessionManager.getRepositoryRegions(SessionManager.java:810)

... 55 more

<br><br>Caused by: com.sap.mdm.net.ConnectionException: Problem while creating JCA connection to MDM server u2018xxx '

<br>at com.sap.mdm.internal.session.JcaConnectionUtil.getJcaConnectionAccessor(JcaConnectionUtil.java:82)

<br>at com.sap.mdm.internal.session.JcaConnectionAccessor.reserveConnection(JcaConnectionAccessor.java:76)

<br>at com.sap.mdm.internal.session.JcaConnectionAccessor.reserveConnection(JcaConnectionAccessor.java:63)

<br>at com.sap.mdm.commands.GetRepositoryRegionListCommand.execute(GetRepositoryRegionListCommand.java:80)

... 56 more

<br><br>Caused by: java.lang.ClassCastException: class com.sap.mdm.internal.net.SimpleConnectionImpl:library:com.sap.mdm.tech.mdm4j_com.sap.engine.boot.loader.ResourceMultiParentClassLoader_543492fc_alive incompatible with interface com.sap.mdm.net.ConnectionAccessor:demo.sap.com/ear~mdmjars_com.sap.engine.boot.loader.ResourceMultiParentClassLoader_6074d551_alive

<br>at com.sap.mdm.internal.session.JcaConnectionUtil.getJcaConnectionAccessor(JcaConnectionUtil.java:73)

... 59 more

<br><br>

demo.sap.com/ear~mdmjars is the EAR DC we created for MDM JARs, and referenced by the Web Dynpro DC;

<br><br>

I think this casting exception is because MDM Connector uses classes from com.sap.mdm.tech.mdm4j library, while Web Dynpro DC uses classes from ear~mdmjars;<br>

So we are trying to refer to u2018com.sap.mdm.tech.mdm4ju2019 from Web Dynpro DC too u2013 but itu2019s not possible as library references are deprecated & cannot add DC dependency either as that SC cannot be added in the track;

<br><br>

Hope this explains the issue clearly;<br>

Do you have any suggestions on alternate ways to try?

<br><br>

MDM 7.1 SP01<br>

CE 7.2<br>

On MDM Connector: : http://help.sap.com/saphelp_nwmdm71/helpdata/en/ad/1905ea6dd541b18d0740b30b7e2c60/frameset.htm

Former Member
0 Kudos

They need to reference the same library. (Otherwise you will get a class cast exception guaranteed)

So either the server application needs to be referencing the custom one you created or;

The Web Dynpro one needs to be referencing the library on the server.

This means either you need to find a way to hack the class path of the server;

or alternatively find a way to reference the library. (Maybe you can just find the descriptor file in navigator and manually edit it? Might fail later but I would try that.)

Thats all folks, imho.

--

ilAn

Former Member
0 Kudos

Hi Ilan,

I understood your point;

It might work if we edit the descriptor manually & directly deploy the updated EAR.

But even this won't work in NWDI environment as it gets built again on CBS, which will revert the manual changes done to the descriptor.

Thanks;

Former Member
0 Kudos

Hi Harish,

Forgot to add the following:

In the EAR DC (used to wrap and deploy the EJB DC), include the following in the deployment descriptor application-j2ee-engine.xml, which can be found in the META-INF folder of the EAR project.


<?xml version="1.0" encoding="UTF-8"?>
<application-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="application-j2ee-engine.xsd">
<reference reference-type="hard">
<reference-target provider-name="sap.com" 
			target-type="library">com.sap.mdm.tech.mdm4j</reference-target>
</reference>
<start-up mode="always"/>
</application-j2ee-engine>

Good luck,

Walter

Former Member
0 Kudos

Hi Walter,

The EAR DC is used to just package the MDM JARs & deploy on server. It doesn't have any EJB modules;

From the Web Dynpro DC, we refer to this EAR (i.e. the MDM JARs) at runtime;

I think then adding this reference would lead to linkage error at runtime as there will be duplicate classes available;

Did I miss anything here?

Thanks;

Former Member
0 Kudos

I wonder if you could "double" link. You don't include any of the MDM jars in the deployed ear file - just a reference to the real MDM files.

So your web dynpro references a reference that references a reference?

Former Member
0 Kudos

Hi Ilan,

That was a good point;

The EAR just needs to refer the existing library, need not wrap & deploy the JARs again; hence no scope for ClassCastException;

Thank you very much;

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

hi

switch your nwds to development infrastructure perspective.

select your dc--->Dependencies tab --->click the add button to select the com.sap.mdm.tech.mdm4j

as required dc.

before doing that , you have to import the SC which contains com.sap.mdm.tech.mdm4j to your nwds.

Best regards,

John

Former Member
0 Kudos

Hi John,

This version of SC containing the library DC could not be added to a NWDI track. That's why the difficulty in adding runtime dependency - as the the Web Dynpro references are deprecated.

Do you think it's possible to add the dependency in any other way?

Thanks;

junwu
Active Contributor
0 Kudos

hi ,

I think you get the wrong sca file.

i am using MDMJ71004_5-10006189.SCA, which is around 22M.

check the file size, you will find the difference.

Best regards,

John

Former Member
0 Kudos

Hi John,

I think the SCA you are using is for MDM 7.1 SP04;

But for versions before that, the SC cannot be added to a track, as noted in this SAP Note 1235191 - Unfeasibility to import the SCA into the NWDI;

Thanks;