Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I can create only one web service in EJB module. Why?

D. Formenton
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sirs,

I am working with Netbeans 6.7.1 and glassfish v. 2.1

- I made an Enterprise Application
- Under Enterprise Application made a EJB Module
- In EJB Module I create a Persistence Unit then create TWO Entity Class from Database Class_A and Class_B
- then I made TWO Session Bean for Entity Classes
- and at last I made TWO Web Services, build and deploy all

but, if I ask:


and then


Only the first one respond correctly, but, if I delete the Class_A then the the second call
work fine!

If I make again Class_A chain then Class_A work fine and the old Class_B stop to respond!

Seems as if it is impossible to have two web service in the same project, but, I am sure, this
assertion is wrong.

Obviously, if I make two distinct EJB module (in the same Enterprise application), one for Class_A (and related Web Service) and another for Class_B (and related Web Service) all work fine, but it is, for me, incomprehensible.

The question is: what I have to do to have two (or more) webservice in the same EJB module?

Thank you, wery much for your answer.

Ivan Krizsan
Ranch Hand
Posts: 2198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just tried the following:
- Create one EJB Module (project).
- In the EJB project, created two stateless session beans with @WebService annotations.
- Created on EAR project.
- Added the EJB project to the EAR project.
- Deployed the EAR project to GlassFish 2.1.1.
- Tested both the web services by retrieving WSDL and using the internal WS test tool in GlassFish.

I used NetBeans 6.2m2 to develop the above and had no problems using the web services.
Have you tried to develop something like the above, with only two stateless session EJBs acting as web services in an EAR and nothing additional?
Best wishes!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic