Home » Eclipse Projects » Web Tools incubator » [JAX-WS] Unable to generate code from JAX-WS annotations
[JAX-WS] Unable to generate code from JAX-WS annotations [message #435128] |
Thu, 19 March 2009 23:56  |
Eclipse User |
|
|
|
Hi,
I have an existing eclipse project with a Spring nature that I want to use
with WTP JAX-WS in order to generate code for the JAX-WS annotations. I was
originally using JAX-WS from the STP project but wanted to switch to WTP. I
run my web services with Spring's
org.springframework.remoting.jaxws.SimpleJaxWsServiceExporte r, not in a web
container. My expectation is that if I edit a Java file with JAX-WS
annotations the corresponding Java should be generated when it is rebuilt. I
think I need to understand when and how they are built to solve this
problem.
Here is now I configured JAX-WS (I have not run into any specific
documentation for this other than the Fuse videos):
1) set CXF runtime tab to dir with apache-cxf-2.1.4
2) in Spring Config tab select "Use Spring Application Context" (I am not
sure what the purpose of the panel is???)
3) in <project> -> Properties -> Java Compiler -> Annotations I enabled
annotation processing by checking the box (no other changes)
I was notified with a dialog that the project needed to be rebuilt (and I
would expect it to detect the annotations in my source at this time). I see
and empty <project>/.apt_generated directory created but no .class files for
the JAX-WS annotated Java.
Any help appreciated.Thanks!
Derek
|
|
| |
Re: [JAX-WS] Unable to generate code from JAX-WS annotations [message #435132 is a reply to message #435129] |
Fri, 20 March 2009 17:16   |
Eclipse User |
|
|
|
Hi Shane,
I created a Dynamic Web Project with a test POJO using the instructions
given. I set the web service slider to develop mode. I selected wrapped
document/literal so that I could see the JAX-WS support classes get
generated. After I completed the wizard I did not see any new classes get
created. As a result I have the following questions:
1) Under what specific circumstances will the classes be generated. Will
they only be generated when I run the wizard or each time I change and cause
a build of the POJO class? I presume the wizard saves some information about
the POJO that will be treated as a web service implementation.
2) I also did not see any annotations get added to my POJO. Your note
indicates you expect the annotations to be added to my POJO source. I
presume you mean at least WebService and WebMethod.
3) Is there a log entry I can look for to see if everything worked fine or
not?
Note: I have not tried to deploy the web service yet so if the classes are
only generated at deployment this could be my problem. However, I plan to
use Spring in a mode where it uses the JAX-WS Endpoint API to deploy
services for internal testing. I can use a regular web app container like
Tomcat if this is required.
Thanks
Derek
"Shane Clarke" <shane_clarke@hotmail.com> wrote in message
news:3ffa3ee97d1f6401f3b2b5493a89d3e1$1@www.eclipse.org...
> Hi Derek,
>
>> I have an existing eclipse project with a Spring nature that I want to
>> use with WTP JAX-WS in order to generate code for the JAX-WS annotations.
>> I was originally using JAX-WS from the STP project but wanted to switch
>> to WTP. I run my web services with Spring's
>> org.springframework.remoting.jaxws.SimpleJaxWsServiceExporte r, not in a
>> web container.
>
> The CXF Tools (Java2WS and WSDL2Java) are run from the WTP Web Services
> wizards. To use these wizards you have to start from a WTP Dynamic Web
> Project.
>
> However there is no requirement to deploy to a web or application server.
>
> As an example:
> 1. Create a Dynamic Web Project. (File > New > Project > Web > Dynamic Web
> Project). In the configuration combo on the first page of this wizard
> select the "CXF Web Services v2.x" configuration. What ever version it
> defaults to is fine.
>
> 2. Add a POJO implementation class to the source directory.
>
> 3. Launch the WTP Web Services Wizard. (File > New > Other > Web Services
>> Web Service.
>
> 4. Switch the "Web Service Type" at the top of the wizard to "Bottom up
> POJO Web Service"
>
> 5. Hit the "Browse" button and select the implementation class you just
> added.
>
> 6. Drop the slider on the top half of the Web Service wizard to "Develop
> service".
>
> (Note: See the Web Services > Scenario Defaults page for setting defaults
> for the "Web Service Type" and slider position)
>
> 7. Hit Finish or progress through the wizard to change the default
> options.
>
> (Note that in the preferences the JAX-WS tab just before that Spring
> Config tab controls the auto-annotation of annotations on classes when you
> run through the wizard. It won't overwrite any annotations that already
> existed in your starting implementation class. It will add those
> annotations if the preference is selected and the annotation wasn't there
> to begin with). Also have a look at the Java2WS tab to see what's
> artifacts are generated by default.
>
>> My expectation is that if I edit a Java file with JAX-WS annotations the
>> corresponding Java should be generated when it is rebuilt.
>
> The JDT APT processing is only used for validating source files with the
> JAX-WS annotations. It dosen't trigger generation or re-generation of
> code.
>
>> 2) in Spring Config tab select "Use Spring Application Context" (I am not
>> sure what the purpose of the panel is???)
>
> That panel controls the how the WTP Dynamic Web Projects deployment
> descriptor is set up when you create the project.
>
> See the "Server configuration files" section here for a description:
> http://cwiki.apache.org/CXF20DOC/configuration.html
>
>> I see and empty <project>/.apt_generated directory created but no .class
>> files for the JAX-WS annotated Java.
>
> The default output folder for Dynamic Web Projects is /build/classes/
>
>> I have not run into any specific documentation for this other than the
>> Fuse videos
>
> The documentation on how to use the tools and what the various options are
> is sorely lacking at the moment. We'll try to rectify that soon...
>
> Hope that helps,
> Shane
>
|
|
| |
Re: [JAX-WS] Unable to generate code from JAX-WS annotations [message #435136 is a reply to message #435134] |
Fri, 20 March 2009 20:11   |
Eclipse User |
|
|
|
Hi Shane,
Ok, I seem to be getting code generation to happen. But now I see a problem
in the java2ws console output. I poked around and did not see an obvious way
to control this for java2ws. My IDE compiler compliance level is set to 1.6
globally and for the specific project. I am running on Linux x64 with
openjdk.
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo1.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO1
java2ws - Apache CXF 2.1.4
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo1.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO1
java2ws - Apache CXF 2.1.4
Derek
P.S. Thanks for your responsiveness. Let me buy you a drink at Eclipse Con
if you are there...
----------
1. ERROR in
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
(at line 15)
@XmlRootElement(name = "getString", namespace = "http://jaxws.test/")
^^^^^^^^^^^^^^^
Syntax error, annotations are only available if source level is 1.5
----------
2. ERROR in
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
(at line 16)
@XmlAccessorType(XmlAccessType.FIELD)
^^^^^^^^^^^^^^^^
Syntax error, annotations are only available if source level is 1.5
----------
3. ERROR in
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
(at line 17)
@XmlType(name = "getString", namespace = "http://jaxws.test/")
^^^^^^^^
Syntax error, annotations are only available if source level is 1.5
----------
3 problems (3 errors)
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO2
java2ws - Apache CXF 2.1.4
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO2
java2ws - Apache CXF 2.1.4
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO2
java2ws - Apache CXF 2.1.4
"Shane Clarke" <shane_clarke@hotmail.com> wrote in message
news:1bd6083099cadcee81f42df324c0653b$1@www.eclipse.org...
> Hi Derek,
>
> From your description it sounds like you've used Apache Axis as the Web
> Service Runtime in the wizard.
>
> When you open the wizard make sure you change the "Web Service Type" at
> the very top of the page to "Bottom up POJO Web Service". Or set this up
> in the preferences i mentioned in the last post.
>
> When you select your service implementation class using the browse button
> you should see the "Configuration" section just below that field and to
> the right of the slider change.
>
> The Web Service Runtime in that configuration should now read "Apache CXF
> 2.x"
>
>> 1) Under what specific circumstances will the classes be generated. Will
>> they only be generated when I run the wizard or each time I change and
>> cause a build of the POJO class?
>
> The classes are only generated when you run through the wizard.
>> I presume the wizard saves some information about the POJO that will be
>> treated as a web service implementation.
>
> An jaxws endpoint configuration is created in the spring configuration
> that's setup.
>
> Depending on the option in the preferences that'll either be a beans.xml
> file or a cxf-servlet.xml file.
>
> The location of that file will be in the /WebContent/WEB-INF/ directory.
>
>> 2) I also did not see any annotations get added to my POJO. Your note
>> indicates you expect the annotations to be added to my POJO source. I
>> presume you mean at least WebService and WebMethod.
>
> It will add @WebService, @WebMethod, @WebParam, @ResponseWrapper and
> @RequestWrapper depending on preferences and if they already exist in the
> code.
>
>> 3) Is there a log entry I can look for to see if everything worked fine
>> or not?
>
> Any errors that might occur are logged. Check the Window > Show View >
> General > Error Log.
>
> Also, the CXF Java2WS and WSDLJava tools logs output to the console view
> when run. So you should see that output if it runs correctly.
>
>> Note: I have not tried to deploy the web service yet so if the classes
>> are only generated at deployment this could be my problem. However, I
>> plan to use Spring in a mode where it uses the JAX-WS Endpoint API to
>> deploy services for internal testing. I can use a regular web app
>> container like Tomcat if this is required.
>
> No need to deploy to generate classes.
>
> Thanks,
> Shane
>
>
>
|
|
|
Re: [JAX-WS] Unable to generate code from JAX-WS annotations [message #435138 is a reply to message #435136] |
Fri, 20 March 2009 20:33   |
Eclipse User |
|
|
|
I was able to get rid of the 1.5 compliance issue by doing a QuickFix from
the Problems pane. Where exactly is this configurated?
"Derek Palma" <derek.palma@gmail.com> wrote in message
news:gq0taf$smt$1@build.eclipse.org...
> Hi Shane,
>
> Ok, I seem to be getting code generation to happen. But now I see a
> problem in the java2ws console output. I poked around and did not see an
> obvious way to control this for java2ws. My IDE compiler compliance level
> is set to 1.6 globally and for the specific project. I am running on Linux
> x64 with openjdk.
>
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo1.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO1
> java2ws - Apache CXF 2.1.4
>
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo1.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO1
> java2ws - Apache CXF 2.1.4
>
> Derek
> P.S. Thanks for your responsiveness. Let me buy you a drink at Eclipse Con
> if you are there...
>
> ----------
> 1. ERROR in
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
> (at line 15)
> @XmlRootElement(name = "getString", namespace = "http://jaxws.test/")
> ^^^^^^^^^^^^^^^
> Syntax error, annotations are only available if source level is 1.5
> ----------
> 2. ERROR in
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
> (at line 16)
> @XmlAccessorType(XmlAccessType.FIELD)
> ^^^^^^^^^^^^^^^^
> Syntax error, annotations are only available if source level is 1.5
> ----------
> 3. ERROR in
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
> (at line 17)
> @XmlType(name = "getString", namespace = "http://jaxws.test/")
> ^^^^^^^^
> Syntax error, annotations are only available if source level is 1.5
> ----------
> 3 problems (3 errors)
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO2
> java2ws - Apache CXF 2.1.4
>
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO2
> java2ws - Apache CXF 2.1.4
>
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO2
> java2ws - Apache CXF 2.1.4
>
>
> "Shane Clarke" <shane_clarke@hotmail.com> wrote in message
> news:1bd6083099cadcee81f42df324c0653b$1@www.eclipse.org...
>> Hi Derek,
>>
>> From your description it sounds like you've used Apache Axis as the Web
>> Service Runtime in the wizard.
>>
>> When you open the wizard make sure you change the "Web Service Type" at
>> the very top of the page to "Bottom up POJO Web Service". Or set this up
>> in the preferences i mentioned in the last post.
>>
>> When you select your service implementation class using the browse button
>> you should see the "Configuration" section just below that field and to
>> the right of the slider change.
>>
>> The Web Service Runtime in that configuration should now read "Apache CXF
>> 2.x"
>>
>>> 1) Under what specific circumstances will the classes be generated. Will
>>> they only be generated when I run the wizard or each time I change and
>>> cause a build of the POJO class?
>>
>> The classes are only generated when you run through the wizard.
>>> I presume the wizard saves some information about the POJO that will be
>>> treated as a web service implementation.
>>
>> An jaxws endpoint configuration is created in the spring configuration
>> that's setup.
>>
>> Depending on the option in the preferences that'll either be a beans.xml
>> file or a cxf-servlet.xml file.
>>
>> The location of that file will be in the /WebContent/WEB-INF/ directory.
>>
>>> 2) I also did not see any annotations get added to my POJO. Your note
>>> indicates you expect the annotations to be added to my POJO source. I
>>> presume you mean at least WebService and WebMethod.
>>
>> It will add @WebService, @WebMethod, @WebParam, @ResponseWrapper and
>> @RequestWrapper depending on preferences and if they already exist in the
>> code.
>>
>>> 3) Is there a log entry I can look for to see if everything worked fine
>>> or not?
>>
>> Any errors that might occur are logged. Check the Window > Show View >
>> General > Error Log.
>>
>> Also, the CXF Java2WS and WSDLJava tools logs output to the console view
>> when run. So you should see that output if it runs correctly.
>>
>>> Note: I have not tried to deploy the web service yet so if the classes
>>> are only generated at deployment this could be my problem. However, I
>>> plan to use Spring in a mode where it uses the JAX-WS Endpoint API to
>>> deploy services for internal testing. I can use a regular web app
>>> container like Tomcat if this is required.
>>
>> No need to deploy to generate classes.
>>
>> Thanks,
>> Shane
>>
>>
>>
>
|
|
| | | |
Re: [JAX-WS] Unable to generate code from JAX-WS annotations [message #570122 is a reply to message #435129] |
Fri, 20 March 2009 17:16   |
Eclipse User |
|
|
|
Hi Shane,
I created a Dynamic Web Project with a test POJO using the instructions
given. I set the web service slider to develop mode. I selected wrapped
document/literal so that I could see the JAX-WS support classes get
generated. After I completed the wizard I did not see any new classes get
created. As a result I have the following questions:
1) Under what specific circumstances will the classes be generated. Will
they only be generated when I run the wizard or each time I change and cause
a build of the POJO class? I presume the wizard saves some information about
the POJO that will be treated as a web service implementation.
2) I also did not see any annotations get added to my POJO. Your note
indicates you expect the annotations to be added to my POJO source. I
presume you mean at least WebService and WebMethod.
3) Is there a log entry I can look for to see if everything worked fine or
not?
Note: I have not tried to deploy the web service yet so if the classes are
only generated at deployment this could be my problem. However, I plan to
use Spring in a mode where it uses the JAX-WS Endpoint API to deploy
services for internal testing. I can use a regular web app container like
Tomcat if this is required.
Thanks
Derek
"Shane Clarke" <shane_clarke@hotmail.com> wrote in message
news:3ffa3ee97d1f6401f3b2b5493a89d3e1$1@www.eclipse.org...
> Hi Derek,
>
>> I have an existing eclipse project with a Spring nature that I want to
>> use with WTP JAX-WS in order to generate code for the JAX-WS annotations.
>> I was originally using JAX-WS from the STP project but wanted to switch
>> to WTP. I run my web services with Spring's
>> org.springframework.remoting.jaxws.SimpleJaxWsServiceExporte r, not in a
>> web container.
>
> The CXF Tools (Java2WS and WSDL2Java) are run from the WTP Web Services
> wizards. To use these wizards you have to start from a WTP Dynamic Web
> Project.
>
> However there is no requirement to deploy to a web or application server.
>
> As an example:
> 1. Create a Dynamic Web Project. (File > New > Project > Web > Dynamic Web
> Project). In the configuration combo on the first page of this wizard
> select the "CXF Web Services v2.x" configuration. What ever version it
> defaults to is fine.
>
> 2. Add a POJO implementation class to the source directory.
>
> 3. Launch the WTP Web Services Wizard. (File > New > Other > Web Services
>> Web Service.
>
> 4. Switch the "Web Service Type" at the top of the wizard to "Bottom up
> POJO Web Service"
>
> 5. Hit the "Browse" button and select the implementation class you just
> added.
>
> 6. Drop the slider on the top half of the Web Service wizard to "Develop
> service".
>
> (Note: See the Web Services > Scenario Defaults page for setting defaults
> for the "Web Service Type" and slider position)
>
> 7. Hit Finish or progress through the wizard to change the default
> options.
>
> (Note that in the preferences the JAX-WS tab just before that Spring
> Config tab controls the auto-annotation of annotations on classes when you
> run through the wizard. It won't overwrite any annotations that already
> existed in your starting implementation class. It will add those
> annotations if the preference is selected and the annotation wasn't there
> to begin with). Also have a look at the Java2WS tab to see what's
> artifacts are generated by default.
>
>> My expectation is that if I edit a Java file with JAX-WS annotations the
>> corresponding Java should be generated when it is rebuilt.
>
> The JDT APT processing is only used for validating source files with the
> JAX-WS annotations. It dosen't trigger generation or re-generation of
> code.
>
>> 2) in Spring Config tab select "Use Spring Application Context" (I am not
>> sure what the purpose of the panel is???)
>
> That panel controls the how the WTP Dynamic Web Projects deployment
> descriptor is set up when you create the project.
>
> See the "Server configuration files" section here for a description:
> http://cwiki.apache.org/CXF20DOC/configuration.html
>
>> I see and empty <project>/.apt_generated directory created but no .class
>> files for the JAX-WS annotated Java.
>
> The default output folder for Dynamic Web Projects is /build/classes/
>
>> I have not run into any specific documentation for this other than the
>> Fuse videos
>
> The documentation on how to use the tools and what the various options are
> is sorely lacking at the moment. We'll try to rectify that soon...
>
> Hope that helps,
> Shane
>
|
|
| |
Re: [JAX-WS] Unable to generate code from JAX-WS annotations [message #570158 is a reply to message #435134] |
Fri, 20 March 2009 20:11   |
Eclipse User |
|
|
|
Hi Shane,
Ok, I seem to be getting code generation to happen. But now I see a problem
in the java2ws console output. I poked around and did not see an obvious way
to control this for java2ws. My IDE compiler compliance level is set to 1.6
globally and for the specific project. I am running on Linux x64 with
openjdk.
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo1.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO1
java2ws - Apache CXF 2.1.4
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo1.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO1
java2ws - Apache CXF 2.1.4
Derek
P.S. Thanks for your responsiveness. Let me buy you a drink at Eclipse Con
if you are there...
----------
1. ERROR in
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
(at line 15)
@XmlRootElement(name = "getString", namespace = "http://jaxws.test/")
^^^^^^^^^^^^^^^
Syntax error, annotations are only available if source level is 1.5
----------
2. ERROR in
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
(at line 16)
@XmlAccessorType(XmlAccessType.FIELD)
^^^^^^^^^^^^^^^^
Syntax error, annotations are only available if source level is 1.5
----------
3. ERROR in
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
(at line 17)
@XmlType(name = "getString", namespace = "http://jaxws.test/")
^^^^^^^^
Syntax error, annotations are only available if source level is 1.5
----------
3 problems (3 errors)
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO2
java2ws - Apache CXF 2.1.4
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO2
java2ws - Apache CXF 2.1.4
java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
/home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
/home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
/home/dpalma/eclipsedata/test/Test3/build/classes -o
pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
jaxb -wsdl -wrapperbean test.jaxws.POJO2
java2ws - Apache CXF 2.1.4
"Shane Clarke" <shane_clarke@hotmail.com> wrote in message
news:1bd6083099cadcee81f42df324c0653b$1@www.eclipse.org...
> Hi Derek,
>
> From your description it sounds like you've used Apache Axis as the Web
> Service Runtime in the wizard.
>
> When you open the wizard make sure you change the "Web Service Type" at
> the very top of the page to "Bottom up POJO Web Service". Or set this up
> in the preferences i mentioned in the last post.
>
> When you select your service implementation class using the browse button
> you should see the "Configuration" section just below that field and to
> the right of the slider change.
>
> The Web Service Runtime in that configuration should now read "Apache CXF
> 2.x"
>
>> 1) Under what specific circumstances will the classes be generated. Will
>> they only be generated when I run the wizard or each time I change and
>> cause a build of the POJO class?
>
> The classes are only generated when you run through the wizard.
>> I presume the wizard saves some information about the POJO that will be
>> treated as a web service implementation.
>
> An jaxws endpoint configuration is created in the spring configuration
> that's setup.
>
> Depending on the option in the preferences that'll either be a beans.xml
> file or a cxf-servlet.xml file.
>
> The location of that file will be in the /WebContent/WEB-INF/ directory.
>
>> 2) I also did not see any annotations get added to my POJO. Your note
>> indicates you expect the annotations to be added to my POJO source. I
>> presume you mean at least WebService and WebMethod.
>
> It will add @WebService, @WebMethod, @WebParam, @ResponseWrapper and
> @RequestWrapper depending on preferences and if they already exist in the
> code.
>
>> 3) Is there a log entry I can look for to see if everything worked fine
>> or not?
>
> Any errors that might occur are logged. Check the Window > Show View >
> General > Error Log.
>
> Also, the CXF Java2WS and WSDLJava tools logs output to the console view
> when run. So you should see that output if it runs correctly.
>
>> Note: I have not tried to deploy the web service yet so if the classes
>> are only generated at deployment this could be my problem. However, I
>> plan to use Spring in a mode where it uses the JAX-WS Endpoint API to
>> deploy services for internal testing. I can use a regular web app
>> container like Tomcat if this is required.
>
> No need to deploy to generate classes.
>
> Thanks,
> Shane
>
>
>
|
|
|
Re: [JAX-WS] Unable to generate code from JAX-WS annotations [message #570180 is a reply to message #435136] |
Fri, 20 March 2009 20:33   |
Eclipse User |
|
|
|
I was able to get rid of the 1.5 compliance issue by doing a QuickFix from
the Problems pane. Where exactly is this configurated?
"Derek Palma" <derek.palma@gmail.com> wrote in message
news:gq0taf$smt$1@build.eclipse.org...
> Hi Shane,
>
> Ok, I seem to be getting code generation to happen. But now I see a
> problem in the java2ws console output. I poked around and did not see an
> obvious way to control this for java2ws. My IDE compiler compliance level
> is set to 1.6 globally and for the specific project. I am running on Linux
> x64 with openjdk.
>
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo1.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO1
> java2ws - Apache CXF 2.1.4
>
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo1.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO1
> java2ws - Apache CXF 2.1.4
>
> Derek
> P.S. Thanks for your responsiveness. Let me buy you a drink at Eclipse Con
> if you are there...
>
> ----------
> 1. ERROR in
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
> (at line 15)
> @XmlRootElement(name = "getString", namespace = "http://jaxws.test/")
> ^^^^^^^^^^^^^^^
> Syntax error, annotations are only available if source level is 1.5
> ----------
> 2. ERROR in
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
> (at line 16)
> @XmlAccessorType(XmlAccessType.FIELD)
> ^^^^^^^^^^^^^^^^
> Syntax error, annotations are only available if source level is 1.5
> ----------
> 3. ERROR in
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src/test/jaxws/G etString.java
> (at line 17)
> @XmlType(name = "getString", namespace = "http://jaxws.test/")
> ^^^^^^^^
> Syntax error, annotations are only available if source level is 1.5
> ----------
> 3 problems (3 errors)
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO2
> java2ws - Apache CXF 2.1.4
>
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO2
> java2ws - Apache CXF 2.1.4
>
> java2ws -cp /home/dpalma/eclipsedata/test/Test3/build/classes -s
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/src -d
> /home/dpalma/eclipsedata/test/Test3/.cxftmp/wsdl -classdir
> /home/dpalma/eclipsedata/test/Test3/build/classes -o
> pojo2.wsdl -createxsdimports -verbose -frontend jaxws -databinding
> jaxb -wsdl -wrapperbean test.jaxws.POJO2
> java2ws - Apache CXF 2.1.4
>
>
> "Shane Clarke" <shane_clarke@hotmail.com> wrote in message
> news:1bd6083099cadcee81f42df324c0653b$1@www.eclipse.org...
>> Hi Derek,
>>
>> From your description it sounds like you've used Apache Axis as the Web
>> Service Runtime in the wizard.
>>
>> When you open the wizard make sure you change the "Web Service Type" at
>> the very top of the page to "Bottom up POJO Web Service". Or set this up
>> in the preferences i mentioned in the last post.
>>
>> When you select your service implementation class using the browse button
>> you should see the "Configuration" section just below that field and to
>> the right of the slider change.
>>
>> The Web Service Runtime in that configuration should now read "Apache CXF
>> 2.x"
>>
>>> 1) Under what specific circumstances will the classes be generated. Will
>>> they only be generated when I run the wizard or each time I change and
>>> cause a build of the POJO class?
>>
>> The classes are only generated when you run through the wizard.
>>> I presume the wizard saves some information about the POJO that will be
>>> treated as a web service implementation.
>>
>> An jaxws endpoint configuration is created in the spring configuration
>> that's setup.
>>
>> Depending on the option in the preferences that'll either be a beans.xml
>> file or a cxf-servlet.xml file.
>>
>> The location of that file will be in the /WebContent/WEB-INF/ directory.
>>
>>> 2) I also did not see any annotations get added to my POJO. Your note
>>> indicates you expect the annotations to be added to my POJO source. I
>>> presume you mean at least WebService and WebMethod.
>>
>> It will add @WebService, @WebMethod, @WebParam, @ResponseWrapper and
>> @RequestWrapper depending on preferences and if they already exist in the
>> code.
>>
>>> 3) Is there a log entry I can look for to see if everything worked fine
>>> or not?
>>
>> Any errors that might occur are logged. Check the Window > Show View >
>> General > Error Log.
>>
>> Also, the CXF Java2WS and WSDLJava tools logs output to the console view
>> when run. So you should see that output if it runs correctly.
>>
>>> Note: I have not tried to deploy the web service yet so if the classes
>>> are only generated at deployment this could be my problem. However, I
>>> plan to use Spring in a mode where it uses the JAX-WS Endpoint API to
>>> deploy services for internal testing. I can use a regular web app
>>> container like Tomcat if this is required.
>>
>> No need to deploy to generate classes.
>>
>> Thanks,
>> Shane
>>
>>
>>
>
|
|
| |
Re: [JAX-WS] Unable to generate code from JAX-WS annotations [message #570768 is a reply to message #435139] |
Fri, 26 February 2010 20:12  |
Eclipse User |
|
|
|
Sorry to revive such an old thread, but it's the only one I can find that mentions the option I'm missing.
I'm trying to create a JAX-WS web service using Apache CXF and I'm missing the "Bottom Up POJO Web Service" and "Top Down POJO Web Service" choices in my "Web Service Type" drop-down list.
I'm running Galileo (JEE) with JDK 1.6.x. Any suggestions?
|
|
|
Goto Forum:
Current Time: Sat Feb 08 07:44:37 GMT 2025
Powered by FUDForum. Page generated in 0.04843 seconds
|