on 08-13-2010 3:40 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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;
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.