Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

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.

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!
Attractive, successful people love this tiny ad:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!