Two Laptop Bag*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Question on EJB based Webservice - Unable to run WSGEN against session bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Question on EJB based Webservice - Unable to run WSGEN against session bean" Watch "Question on EJB based Webservice - Unable to run WSGEN against session bean" New topic
Author

Question on EJB based Webservice - Unable to run WSGEN against session bean

Rajani Gummadi
Ranch Hand

Joined: Dec 17, 2010
Posts: 48
Hi,

I could not find any appropriate subject line, suitable for my question, but would try to make my actual question as clear as possible.

First of all, I have not worked in EJB3 anytime before and not familiar with the annotations.

With an assumption that, the approach for EJB based is same as Servlet based, I tried to implement ejb based end point.

1) I selected EJB project in eclipse and container chosen was Glassfish v3.
2) I coded my interface and impl beans as below



3) My project structure is as follows


4) build.xml is basically same as what Ivan provided in his notes, but the snippet is


Upon running the build.xml, I see that wrapper objects for request and response were created but, it did not generate any WSDL and see the following error


Can some one help me here ? error: Could not create declaration for annotation type javax.ejb.Stateless, what does this mean.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I think the main problem is that you refer to the WSDL in the @WebService annotation. wsgen will process the annotations, but at that time, there is no WSDL. Have you tried removing the WSDL reference in the annotation?
Do you have any particular requirements that causes you to use a "manually" created WSDL, instead of using one GlassFish creates at deployment time?
Here is the absolute simplest example I have been able to come up with having an EJB implement a web service:
1. In Eclipse, create an EJB Project.
2. Implement the EJB:

3. Publish it to GlassFish.

Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Question on EJB based Webservice - Unable to run WSGEN against session bean