-
Mar 16th, 2007, 03:40 AM
#1
Tutorial
I've finally had the time to finish writing the tutorial for Spring-WS. It starts at http://static.springframework.org/sp...tutorial1.html (old stuff), an continues at http://static.springframework.org/sp...tutorial2.html (new stuff).
Let me know what you think!
-
Mar 16th, 2007, 10:10 AM
#2
Thanks Arjen - it fills a gap. Martin.
-
Mar 21st, 2007, 06:00 PM
#3
Thanks Arjen. It saves some time. I would update this page so others can find it. http://www.springframework.org/spring-ws
-
Mar 22nd, 2007, 04:14 AM
#4
Thanks, updated the site.
-
Oct 9th, 2007, 11:20 AM
#5
org.springframework.oxm.jaxb.JaxbSystemException
Hi Arjan,
I am new to use all this stuff. I am just moving forward by reading the spring-ws tutorial. I am using Jaxb2Marshaller for marshalling and unmarshalling. All that I want to do is just Marshalling and Unmarshalling. I don't want to go through webservice stuff and all. Please see below what I have done so far.
1. Downloaded JWSDP2.0 pack, which contains Jaxb2.0 and am added the jars (jaxb1-impl.jar,jaxb-api.jar,jaxb-impl.jar,jaxb-xjc.jar and the jars coming with spring-ws-1.0.1 release) into class path.
2. Ran Jaxb Schemangen.bat against java file (Settings.java bean) for generating XSD file.
3. After XSD generated, then I ran xjc.bat (Jaxb compiler) against this XSD file.
4. Then it has generated two files: ObjectFactory.java and Settings.java in generated folder.
5. Configured Jaxb2Marshaller in applicationContext as specified below.
<bean id="application" class="testing.Application">
<property name="marshaller" ref="jaxb2Marshaller" />
<property name="unmarshaller" ref="jaxb2Marshaller" />
</bean>
<bean id="jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
<property name="contextPath" value="generated">
</property>
</bean>
Here, "generated" folder contains the java files ObjectFactory.java and Settings.java generated xjc compiler.
6. Then I ran into two exceptions one after the other
i. java.lang.NoClassDefFoundError: javax.activation.DataSource - I have added Activation.jar into class path to resolve this problem.
ii. java.lang.NoClassDefFoundError: javax.xml.stream.XMLStreamException - I have added jsr173_1.0_api.jar into class path to resolve this problem.
7. Now I am getting the following exception when it calls marshall method.
org.springframework.oxm.jaxb.JaxbSystemException: Settings nor any of its super class is known to this context; nested exception is
javax.xml.bind.JAXBException: Settings nor any of its super class is known to this context
As I am spending lot of time so far in resolving the above exception, I thought of letting you know about this. I would be very happy if you can provide any clues/suggestions for resolving this error. Also, point me if am doing anything wrong here.
Thanks,
Ravi
-
Oct 10th, 2007, 06:45 AM
#6
If you're just interested in Marshalling, refer to the corresponding chapter in the reference docs: http://static.springframework.org/sp.../html/oxm.html.
In general, you need to configure JAXB with a contextPath. This is not the folder to which you generated the classes, but rather the Java package which contains the ObjectFactory and other files. Or you can set the classesToBeBound property (to Settings in your case).
-
Oct 11th, 2007, 09:43 PM
#7
This is a great tutorial.. thanks for the work.
-
Oct 24th, 2007, 03:51 AM
#8
Tutorial Help
I have a problem in following the spring web service tutorial in the spring website (http://static.springframework.org/sp...tutorial2.html)
I could not execute the command in maven2
> mvn archetype:create -DarchetypeGroupId=org.springframework.ws \
-DarchetypeArtifactId=spring-ws-archetype \
-DarchetypeVersion=1.0-rc1-SNAPSHOT \
-DgroupId=com.mycompany.hr \
-DartifactId=holidayService
It returns an error “plugin … does not exist”
C:\>mvn archetype:create -DarchetypeGroupId=org.springframework.ws -DarchetypeArtifactId=spring-ws-archetype -DarchetypeVersion=1.0-rc1-SNAPSHOT -DgroupId=com.mycompany.hr -DartifactId=holidayService
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Mon Oct 22 18:46:43 SGT 2007
I already deployed the maven 2.0.7; extracting the maven-2.0.7-bin.zip to . .. \Program Files\Apache Software Foundation\maven-2.0.7 (http://maven.apache.org/download.html) and updated my system variables.
I also downloaded maven-archetype-plugin-1.0-alpha-7.jar from the (http://repo1.maven.org/maven2/org/ap...n/1.0-alpha-7/) and copied it to my maven2\bin directory
I’m wondering if you could help me in using maven2 so that I could follow the tutorial.
or do you have a detailed walkthrough in how to install maven2? or another tutorial on how to start a spring web service project?
Thanks,
-
Oct 26th, 2007, 04:31 AM
#9
You might have a corrupted local repository. Remove ${HOME}/.m2/repository, and see it that works.
-
Nov 16th, 2007, 01:28 AM
#10
Tutorial Help
Thanks Arjen
, i was able to finish the spring ws tutorial
http://static.springframework.org/sp.../tutorial.html.
Here are the steps i did for those who have the same problem.
(“plugin … does not exist” error, maven could not download the files from the repo)
1. removed the ${HOME}/.m2/repository
2. edited my maven2 settings.xml, i added my proxy settings (wer using web proxy at the office)
3. executed "maven install" with error:
[ERROR] BUILD ERROR
[INFO] Failed to resolve artifact.
Missing:
----------
1) javax.activation:activation:jar:1.0.2
4. downloaded activation jar version 1.0.2 and manually installed it
5. executed "maven install" again and the command created a new maven project
I have a new question though: HOW could i IMPORT the genereated project to ECLIPSE IDE?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules