Building a Web-Service client: "A WebService annotation is not present on class"
Hi there
I'm trying to build a client which should submit some form data to a SAP web service. Using wsimport I created the necessary classes to build the client. I then created a standalone client to test out the web service in my IDE, everything worked fine.
Afterwards I tried installing the web service client as a bundle on my CQ instance (5.5), but i failed to start because of the following errors in my bundle:
javax.jws -- Cannot be resolved javax.jws.soap -- Cannot be resolved
After some googling I found this question on StackOverflow which did solve the problem through adding the following dependency to maven:
<dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-ws-metadata_2.0_spec</artifactId> <version>1.1.2</version> <scope>compile</scope> </dependency>
This is 1 of 2 external dependencies I'm using, the other one is a LDAP SDK from Unboundid. Now my bundle would start, but trying to submit data to the web service would fail with the following message:
A WebService annotation is not present on class: com.company.cq.webservice.SAPWEBSERVICE Cannot serve request to /bin/appName/submit in com.company.cq.servlets.Submit
The class in question does have a WebService annotation - it was also working as a standalone application. Can someone tell me what might be the problem here and how to solve it?
If it helps, this is also my maven-bundle-plugin configuration:
<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Bundle-SymbolicName>com.company.cq.appname-bundle</Bundle-SymbolicName> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> <Embed-Directory>OSGI-INF/lib</Embed-Directory> <Embed-Transitive>true</Embed-Transitive> <Export-Package> com.unboundid.*, com.company.cq.* </Export-Package> </instructions> </configuration> </plugin>
Any help is greatly appreciated :)
Thanks!