I try to follow the Getting Started with JAX-WS Web Services tutorial on the netbeans site. I create the web-service-app (Java EE 6 Web, Tomcat 7.0), when I add a web-service class netbeans asks for me if I want to use METRO (because the server does't JSR-109), so I say yes and it adds some metro libraries.
Now the webservice is using the javax.ejb.Stateless as I selected the "Implement Web Service as a Stateless Session Bean" checkbox, but no Library containing this class is added and I get an error in Netbeans:
import javax.ejb.Stateless;
...
@WebService(serviceName = "WebServiceTest")
@Stateless()
public class WebServiceTest {...}
"cannot find symbol: class Stateless"
ofcourse it can't. When I add the "Java EE Web 6 API Library - javaee-web-api-6.0.jar" the error is solved, but when I deploy the project I get an error thats a whole lot more difficult, and that error is the actual problem...
Deployment is in progress...
deploy?config=file%3A%2FC%3A%2FUsers%2Ftjen%2FAppData%2FLocal%2FTemp%2Fcontext6376466830057976095.xml&path=/CalculatorWSApplication
FAIL - Deployed application at context path /CalculatorWSApplication but context failed to start
[here a direction to the line of error]
The module has not been deployed.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:187)
[...a whole lot of red-collored stack-trace stuff]
BUILD FAILED (total time: 1 second)
at the following line:
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
I put the arguments over different lines like this:
<nbdeploy
clientUrlPart="${client.urlPart}"
debugmode="false"
forceRedeploy="${forceRedeploy}"
/>
Which didn't help me at all(but maybe it does help you), because the eror was at the line:
/>
Now if I comment out the Stateless usage, and remove the "Java EE Web 6 API Library - javaee-web-api-6.0.jar" library, there is no problem and it all works like a charm. (after a 'clean and build' otherwise it keeps going errored)
It doesn't matter which library i add, if I do, i get that same error. I can get the example working, but I would like to be able to add libraries without it crashing...
Hope to solve this mystery, Tjen
PS: some specs
This can be achieved by adding metro libraries to tomcat. GlassFish has metro library inbuilt. In order to run web service on tomcat, Metro libraries have to be included.
please google how would you add library. best of luck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With