cancel
Showing results for 
Search instead for 
Did you mean: 

Access to existing SDAs

Former Member
0 Kudos

Hi,

I am trying to write an application that is supposed to work with existing SDAs. For example: com.sap.xi.mdt.api

I copied the aii_mdt_api.jar file in to my project folder, added it to my built path and imported the needed class files where necessary.

After adding to my class path several EJB Candidates are showing up. I want to use one of them (MessageMonitoringBean) and used "Add to ejb-mxl.xml" in order to add it to my project.

Because this Bean is located in a server based SAD I think I will have to add it to my ejb-j2ee-engine.xml also? Do I have to use JNDI name? How can I use this Bean in my project?

Does anyone have a tutorial for this topic?

Hope you guys can help me out.

Best Regards,

Holger

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Holger,

In this case because you want to use existing beans you do not need the ejb project that defines the ejb at all.

All you need is a reference, similar to this one in application-j2ee-engine.xml :

<reference reference-type="weak">

<reference-target target-type="application" provider-name="sap.com">com.sap.xi.mdt</reference-target>

</reference>

and you will be able to use the ejb-s from your web project

As for the web part, there in web.xml you need to specify ejb reference to the ejb you would like to use. The JNDI name of the bean you would like to use has been specified at deployment time, so you can check what it is by:

Login to the j2ee engine via Visual Administrator

Go to server -> services -> ejb

In the runtime tab search for the application containing the bean and expand it.

Find the exact bean and check it's properties.

I hope this helps.

Greetings, Myriana

Former Member
0 Kudos

Hi Myriana,

thx for your help.

I fixed it this way:

<application-j2ee-engine>

<reference reference-type="hard">

<reference-target provider-name="sap.com" target-type="library">com.sap.xi.mdt.api</reference-target>

</reference>

<provider-name>mycompany.de</provider-name>

<fail-over-enable mode="disable"/>

</application-j2ee-engine>

Plus additional references in my Ejb Project. This way I can access the existing Beans within my own EJBs.

Thanks for your help!!!

This turorial was also helpful:

http://www.redhat.com/docs/manuals/rhaps/jonas-guide/ch-beans-ejbref.html

Regards,

Holger

Former Member
0 Kudos

Hi Holger,

If you would like to use a EJB from an already existing application already available on the j2ee engine you simply need to reference this application and in your own application define the references to the already existing beans.

Check:

http://help.sap.com/saphelp_nw2004s/helpdata/en/28/c9a3a9606f434ea757a3536d220704/content.htm

for creating application references and

http://help.sap.com/saphelp_nw2004s/helpdata/en/55/29ed5eff965448941c0b42f01b9804/content.htm

for configuring ejb references.

Greetings, Myriana

Former Member
0 Kudos

Hi Myriana,

thx for your quick response. That's exactly what I was looking for.

I experimented a little bit and have two more questions. For testing I used the MassageMonitoringBean, located in aii_mdt_api.jar. I took this bean exemplarily. I am sure it could be replaced by any other bean.

I did the following:

Ejb-Project:

- I added MassageMonitoringBean to my ejb-jar.xml and ejb-j2ee-engine.xml

Question: Do I have to set any references, like JNDI name within ejb-j2ee-engine.xml?

Web-Project:

- I added MassageMonitoringBean to web.xml and web-j2ee-engine.xml

- MassageMonitoringBean is located in ejb-ref, JNDI name is empty.

Question: Where do I get the JNDI name from?

Thx for your help.

Regards,

Holger