Announcement Announcement Module
Collapse
No announcement yet.
Strange issue with Example app Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange issue with Example app

    I have setup a modified version of the example app. I can see that the webservice is being called and that it is processing correctly but before it can return a response it bombs out with a no such method error <init>. Here is a look at the stack trace, bean, and spring config. Any help would be greatly appreciated. I have tried adding an init method to the bean but that doesn't seem to help.

    ST:

    <Apr 3, 2007 3:22:18 PM CDT> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@28f 7c3c - appName: 'SpringWS', name: 'SpringWS.war', c
    ontext-path: '/SpringWS'] Root cause of ServletException.
    java.lang.NoSuchMethodError: <init>
    at org.springframework.ws.server.endpoint.AbstractJDo mPayloadEndpoint.in
    voke(AbstractJDomPayloadEndpoint.java:45)
    at org.springframework.ws.server.endpoint.PayloadEndp ointAdapter.invoke(
    PayloadEndpointAdapter.java:43)
    at org.springframework.ws.server.MessageDispatcher.di spatch(MessageDispa
    tcher.java:205)
    at org.springframework.ws.server.MessageDispatcher.re ceive(MessageDispat
    cher.java:166)
    at org.springframework.ws.transport.support.WebServic eMessageReceiverObj
    ectSupport.handle(WebServiceMessageReceiverObjectS upport.java:78)
    Truncated. see log file for complete stacktrace
    >

    Bean:

    import org.jdom.Element;
    import org.jdom.Namespace;
    import org.jdom.xpath.XPath;
    import org.springframework.ws.server.endpoint.AbstractJDo mPayloadEndpoint;

    public class EmployeeInfoWSEndpoint extends AbstractJDomPayloadEndpoint {

    @Override
    protected Element invokeInternal(Element employeeInfoRequest) throws Exception {

    Namespace namespace = Namespace.getNamespace("em", "http://www.cellularsouth.com/xsd");
    XPath firstNameExpression = XPath.newInstance("//em:FirstName");
    XPath lastNameExpression = XPath.newInstance("//em:LastName");
    XPath ageExpression = XPath.newInstance("//em:Age");
    firstNameExpression.addNamespace(namespace);
    lastNameExpression.addNamespace(namespace);
    ageExpression.addNamespace(namespace);

    String empName = firstNameExpression.valueOf(employeeInfoRequest) + " " + lastNameExpression.valueOf(employeeInfoRequest);
    int empAge = Integer.parseInt(ageExpression.valueOf(employeeInf oRequest));

    System.out.println(empName + " is " + empAge);

    return new Element("SpringWSReturn").setText(empName + " is " + empAge);

    }

    }


    Config xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

    <bean id="EmployeeWSEndpoint" class="com.cellularsouth.ws.EmployeeInfoWSEndpoint "/>

    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootQNameEndpointMapping">
    <property name="mappings">
    <props>
    <prop key="{http://www.cellularsouth.com/xsd}EmployeeInfoRequest">EmployeeWSEndpoint</prop>
    </props>
    </property>
    </bean>

    <bean id="EmployeeWSWsdl" class="org.springframework.ws.wsdl.wsdl11.DynamicW sdl11Definition">
    <property name="builder">
    <bean class="org.springframework.ws.wsdl.wsdl11.builder. XsdBasedSoap11Wsdl4jDefinitionBuilder">
    <property name="schema" value="/WEB-INF/xsd/EmployeeInfo.xsd"/>
    <property name="portTypeName" value="EmployeeInfo"/>
    <property name="locationUri" value="http://localhost:9111/SpringWS/EmployeeInfoService/"/>
    </bean>
    </property>
    </bean>

    </beans>

  • #2
    Hmm, that's weird. Everything looks fine. It looks like there's an error on line 45 of AbstractJDomPayloadEndpoint, which contains the following:

    Code:
    return responseElement != null ? new JDOMSource(responseElement) : null;
    The <init> is Java's way of saying that it is missing a constructor on that line.

    Which version of JDOM are you using? Can you find the JDOMSource in your classpath?

    Comment


    • #3
      Thanks for the help! It was an older version of JDOM in the server domain classpath. I did a prefer-webinf-classes and everything worked just fine.

      Comment


      • #4
        You gotta love J2EE app servers with their dated versions of standard libraries. Seriously, I cannot wait until we have OSGI-enabled app servers, which hopefully solve this.

        Comment

        Working...
        X