[
https://issues.apache.org/jira/browse/AXIS2-4926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12984629#action_12984629
]
Isuru Eranga Suriarachchi commented on AXIS2-4926:
--------------------------------------------------
Hi Kasun,
You should see the following line on the console with the above error.
com.sun.tools.internal.ws.processor.modeler.ModelerException: modeler error:
@javax.jws.Webservice annotated classes that do not belong to a package must
have the @javax.jws.Webservice.targetNamespace element.
This is because if you haven't specified the target ns, the JAX-WS service
generates the target ns of the service using the package. So if you deploy the
service without a target ns in the default package, it can't generate a
namespace at all.
So you have to specify the target ns for the service as follows.
@WebService(serviceName = "TestService", targetNamespace =
"http://test.axis2.org")
After doing this, you should be able to deploy the service in the default
package without any trouble.
Thanks,
~Isuru
> Can't view WSDL when service class in the default package
> ---------------------------------------------------------
>
> Key: AXIS2-4926
> URL: https://issues.apache.org/jira/browse/AXIS2-4926
> Project: Axis2
> Issue Type: Bug
> Components: jaxws
> Environment: Linux
> Reporter: Kasun Weranga Gunathilake
> Assignee: Isuru Eranga Suriarachchi
> Attachments: jaxwsSample.jar, Student.java, StudentMarksService.java
>
>
> WSDL can't be accessed, if deployed service class is not inside a package.
> In this case I have used two classes Student.java and
> StudentMarksService.java, When I used this classes inside a package I can
> access the WSDL. otherwise it will give the following error. Java classes and
> jar file has been attached.
> This is the exception.
> /tmp/_axis2StudentMarksService/jaxws/GetHighestMarks.java:16: cannot find
> symbol
> symbol : class Student
> location: class jaxws.GetHighestMarks
> private Student student;
> ^
> /tmp/_axis2StudentMarksService/jaxws/GetHighestMarks.java:23: cannot find
> symbol
> symbol : class Student
> location: class jaxws.GetHighestMarks
> public Student getStudent() {
> ^
> /tmp/_axis2StudentMarksService/jaxws/GetHighestMarks.java:32: cannot find
> symbol
> symbol : class Student
> location: class jaxws.GetHighestMarks
> public void setStudent(Student student) {
> ^
> /tmp/_axis2StudentMarksService/jaxws/GetAverage.java:16: cannot find symbol
> symbol : class Student
> location: class jaxws.GetAverage
> private Student student;
> ^
> /tmp/_axis2StudentMarksService/jaxws/GetAverage.java:23: cannot find symbol
> symbol : class Student
> location: class jaxws.GetAverage
> public Student getStudent() {
> ^
> /tmp/_axis2StudentMarksService/jaxws/GetAverage.java:32: cannot find symbol
> symbol : class Student
> location: class jaxws.GetAverage
> public void setStudent(Student student) {
> ^
> 6 errors
> [ERROR] Error occurred generating WSDL file for Web service implementation
> class {StudentMarksService}: {java.lang.Exception: A WSDL Definition could
> not be generated for the implementation class: StudentMarksService}
> java.lang.Exception: A WSDL Definition could not be generated for the
> implementation class: StudentMarksService
> at
> org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl(JAXWSRIWSDLGenerator.java:185)
> at
> org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initialize(JAXWSRIWSDLGenerator.java:379)
> at
> org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:372)
> at
> org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1394)
> at
> org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:149)
> at
> org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHttpService.java:281)
> at
> org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(AxisHttpService.java:187)
> at
> org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServiceProcessor.java:82)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:619)
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]