Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Tutorial

  1. #1
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default 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!
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  2. #2
    Join Date
    Feb 2006
    Location
    London
    Posts
    77

    Default

    Thanks Arjen - it fills a gap. Martin.

  3. #3
    Join Date
    Aug 2004
    Location
    Philadelphia, PA
    Posts
    14

    Default

    Thanks Arjen. It saves some time. I would update this page so others can find it. http://www.springframework.org/spring-ws

  4. #4
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Thanks, updated the site.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  5. #5

    Default 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

  6. #6
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    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).
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  7. #7

    Default Marshalling and unMarshalling using Jaxb2Marshaller

    Thanks. Marshalling and unMarshalling using Jaxb2Marshaller works fine for me

  8. #8

    Default

    This is a great tutorial.. thanks for the work.

  9. #9
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    6

    Default 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,

  10. #10
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    You might have a corrupted local repository. Remove ${HOME}/.m2/repository, and see it that works.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •