cancel
Showing results for 
Search instead for 
Did you mean: 

Access EJB from Web Service

Former Member
0 Kudos

Hello there!

We created an application with NWDS (SP7) and deployed its ear-file to our application server (WebAS 6.40).

Another project contains web services that allow access to entitities of our server application. Within the NWDS the Web Service project refers to the server project, so I'm able to use classes that reside on the server.

The Web Service is created from a class that resides in the Web Service project. Its ear-file is deployed seperately to the server.

<b>Unfortunately some kind of link between the Web Service ear-file and the server ear-file is missing. When I call the web service, I get a <i>java.lang.NoClassDefFoundError</i>.</b>

I think, I should have something like ejb-ref in the web service deployment descriptor, but was unable to find out how to do that.

I do not want to integrate the web service functionality into the server application - having separate projects (and seperate ear files that can be deployed seperately) might help us in the future, when only web service interfaces change...

<b>I'm lost - please give me some hints.</b>

Thanks in advance,

Frank

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Frank,

Here, You have to specify the reference to the EAR file of your server application.

You can specify this reference in the application-j2ee-engine.xml file. You have to create one reference there to your server application.

At the time of adding this reference it will ask for option and there you choose select application and there choose your application.

Let me know the status whether it works for you or not.

Regards,

Bhavik

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Frank,

You have to declare a runtime reference to the EJB (server) application in your WS project's application-j2ee-engine.xml descriptor, just like this:

<reference reference-type="hard">
  <reference-target target-type="application" provider-name="xxx.com">
    ServerAppName
  </reference-target>
</reference>

and redeploy the WS application.

Hope that helps!

Vladimir

Former Member
0 Kudos

<b>Thank you very much.</b>

I just found out, that I was able to convince the NWDS to show the specific editor for the <i>application-j2ee-engine.xml</i> file.

With the help of this editor I'd been able to add the reference with the tools' help (instead of fumbling with xml source)!

<b>You saved my day!</b>

Best regards,

Frank