• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The solution is to add the Java EE API jar to classpath like so:

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic