cancel
Showing results for 
Search instead for 
Did you mean: 

EJB enabled in WebDynpro

Former Member
0 Kudos

Currently we are working on a webdynpro application that uses the SAPDB for persistence. We have built several EJB's in order to store/retrieve the data from the DB from/to the webdynpro application. On the SDN forum I found several solutions but they all use a webservice i.e. create a Webservice from the EJB and import this as a model into webdynpro. This works perfectly though within the proxy classes the URL is hardcoded.

This is a major problem for us, because we want to deploy our project to different environments (Development, QA and Production) while these machines use different names and port numbers.

There is a solution using a Data Command Bean that works as an interface between the EJB and Webdynpro. I have used a Stateless Session EJB but for some reason the JNDI can not be found within the Data Command Bean .

Just to make clear we did the following:

Created a dictionary project

Created a JDO

Created a EJB that uses the JDO

For testing purposes we created a WebService that can create a record in the EJB and used the default JNDI for JDO.

This worked I can make the records within the database

Created the Data Command Bean

Imported in webDynPro and made the mapping

Now if I make an instance of the EJB within the Data Command Bean (called via WebDynPro) I get a naming error within the Data Command Bean

JNDI name not found.

We have tried the following: defined name in "ejb-j2ee-engine.xml" did not work and also the WebService gave a not found error

Used sap.com/CMDJDONEP/CMDJDONEJBBean which is the default JNDI name space (application provider, application name and EJB Name)also did not work.

Please advise!

Karst Koopman

Hans Diepstraten

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hans,

I might have a workaround for you. I had a similar problem when working on an application that use proxies in a team environment. Any time any of us would generate the proxies and check them in to the DTR, when the others would sync the project, the proxy URL would be updated to point to that persons machine. So if a colleague of mine working on a laptop checked in, and I were to sync and deploy while he took his laptop offline, my server would try to access a proxy that is on a server that is no longer on the network.

This can be solved during the proxy generation step by drilling down into the Logical Ports section of the proxy. Choose the logical port in question and update the target address to a location suitable for you. In our case, since we wanted each person to be able to test on their own machine, we simply ensured that everyone would change this field to localhost before checking in.

I'll be posting some detailed blogs about this and other development issues I've had in the near future, so please check back here for more information: /people/steve.winkler/blog

Cheers,

Steve

-


If you find a post helpful, please help the community keep going by setting an example and rewarding the poster with points.

Former Member
0 Kudos

This is unfortunately not a good workaround, since you have to modify code to work in the different environments, something that should be strongly avoided. When you start looking at SOX compliance (something that's rather important in N.A. these days) installing technically untested code into a productive environment is a definite no-no.

Can you say if WebDynpro is going to fix this in the future? Deployable Java proxies uses Destinations - perhaps WebDynpro should do the same?

I was just about to start down the path of accessing RFCs using Web Services, but now I think I'll go through the pain of configuring a JCO connection instead - at least until this WebDynPro shortcoming is addressed.

Former Member
0 Kudos

A colleague of mine is currently working on a solution for this. He's planning on writing a blog in the near future about how to solve the problem. I'll double check with him and see if he's finished it and then provide a link here.

Cheers,

Steve

-


If you find a post useful, please help keep the community going by setting a good example and rewarding the poster with points.

Former Member
0 Kudos

Excellent - I look forward to reading it Steve.

Thanks.

Answers (0)