Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rajani Gummadi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Vlad Virlan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution is to add the Java EE API jar to classpath like so:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic