Results 1 to 5 of 5

Thread: noclassdeffounderror (SoapException) while wiring WebServiceTemplate - in xbean.jar?

  1. #1
    Join Date
    Sep 2007
    Posts
    3

    Question noclassdeffounderror (SoapException) while wiring WebServiceTemplate - in xbean.jar?

    Hi,
    This is my 1st forage into Spring-WS, so forgive any immediate oversights.

    Basically, I've generated some stub code using XMLBeans 2.0.0 (using an Ant task ran via Eclipse 3.1.2) and I'm now trying to access a webservice, using xmlbeans [request] marshalling, within a Spring-based JUnit test (AbstractDependencyInjectionSpringContextTests subclass). However, when I try to run the test within Eclipse, I get a noclassdeffounderror for javax.xml.SoapException during Spring's attempt to wire-up the WebServiceTemplate.

    The missing class appears to be part of the xbean.jar which is included in the project's Java build path (see image attached). The stack trace is:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'webServiceTemplate' defined in file [C:\java\workspace\<my_project>\applicationContext-service.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.ws.client.core.WebServiceTempl ate]; constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
    org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.ws.client.core.WebServiceTempl ate]; constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
    java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
    .....

    My Spring Fragment is:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">

    <beans>

    <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServi ceTemplate">
    <property name="marshaller" ref="xmlBeansMarshaller"/>
    <property name="defaultUri" value="http://some/service"/>
    </bean>

    <bean id="xmlBeansMarshaller" class="org.springframework.oxm.xmlbeans.XmlBeansMa rshaller" />
    </beans>

    Any ideas as to what might be going greatly appreciated (conflicts, missing dependencies)?

    Thanks

    Rich
    Attached Images Attached Images

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    I wouldn't count on it being part of the xbean.jar it is a part of the j2ee classes. YOu will need to include a jar from the j2ee library.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Sep 2007
    Posts
    3

    Red face

    Yep, I probably need j2ee or saaj.jar

    It's not like me to not simply unzip the jar to see what it actually contains, but we had our 1st child on Aug 31st, and sleep (and a logical thought process) has been difficult to find recently .

    I'll check the j2ee/saaj dependency when I get back into the office Thursday, I'm sure that will straighten things out.

    Cheers

    Rich

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    It's not like me to not simply unzip the jar to see what it actually contains, but we had our 1st child on Aug 31st, and sleep (and a logical thought process) has been difficult to find recently .
    Concrats.

    j2ee or saaj should fix it (in our project it is part of the saaj.jar).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Sep 2007
    Posts
    3

    Talking

    Yep,
    Got my client working finally, I had to include saaj-api.jar, saaj-impl and j2ee.jar to satisfy all dependencies.

    Cheers

    Rich

Posting Permissions

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