3 Replies Latest reply on Oct 12, 2006 6:11 PM by Thomas Diesler

    Unable to create JavaBean of type org.w3c.dom.Element

    Amit Sri Newbie

      Hi,

      I have developed a webservice with JWSDP-2.0 (jax-rpc wscompile tool) deployed it on JBoss 4.0.2 AS. I have taken bottom-up approach starting with Service interface which takes org.w3c.dom.Element and return the same.
      Everything happened smoothly until I invoked the deployed WS using client (generated by wscompile tool plz see stacktrace below) . If anyone has faced this before please provide me some insight.

      Thanks in advance,
      Amit Srivastava..

      I am getting following exceptions-
      22:24:48,375 ERROR [RPCInvocation] org.xml.sax.SAXException: Unable to create Ja
      vaBean of type org.w3c.dom.Element. Missing default constructor? Error was: ja
      va.lang.InstantiationException: org.w3c.dom.Element.
      org.xml.sax.SAXException: Unable to create JavaBean of type org.w3c.dom.Element.
      Missing default constructor? Error was: java.lang.InstantiationException: org
      .w3c.dom.Element.
      at org.jboss.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeser
      ializer.java:219)
      at org.jboss.axis.encoding.DeserializerImpl.startElement(DeserializerImp
      l.java:466)
      at org.jboss.axis.encoding.DeserializationContextImpl.startElement(Deser
      ializationContextImpl.java:1182)
      at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.jav
      a:244)
      at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPEleme
      ntAxisImpl.java:1386)
      at org.jboss.axis.encoding.DeserializerImpl.startElement(DeserializerImp
      l.java:436)
      at org.jboss.axis.encoding.DeserializationContextImpl.startElement(Deser
      ializationContextImpl.java:1182)
      at org.jboss.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.jav
      a:244)
      at org.jboss.axis.message.SOAPElementAxisImpl.publishToHandler(SOAPEleme
      ntAxisImpl.java:1386)
      at org.jboss.axis.message.RPCElement.deserialize(RPCElement.java:262)
      at org.jboss.axis.message.RPCElement.getParams(RPCElement.java:396)
      at org.jboss.axis.providers.java.RPCInvocation.prepareFromRequestEnvelop
      e(RPCInvocation.java:235)
      at org.jboss.axis.providers.java.RPCProvider.processMessage(RPCProvider.
      java:103)
      at org.jboss.axis.providers.java.JavaProvider.invoke(JavaProvider.java:3
      58)
      at org.jboss.axis.strategies.InvocationStrategy.visit(InvocationStrategy
      .java:73)
      at org.jboss.axis.SimpleChain.doVisiting(SimpleChain.java:160)
      at org.jboss.axis.SimpleChain.invoke(SimpleChain.java:123)
      at org.jboss.axis.handlers.soap.SOAPService.invoke(SOAPService.java:560)

      at org.jboss.webservice.server.ServerEngine.invokeInternal(ServerEngine.
      java:200)
      at org.jboss.webservice.server.ServerEngine.invoke(ServerEngine.java:89)

      at org.jboss.axis.transport.http.AxisServlet.doPost(AxisServlet.java:905
      )
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.axis.transport.http.AxisServletBase.service(AxisServletBase
      .java:370)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:81)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:178)
      at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
      ipalValve.java:39)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
      yAssociationValve.java:153)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :856)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ssConnection(Http11Protocol.java:744)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
      int.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
      kerThread.java:112)
      at java.lang.Thread.run(Thread.java:534)
      22:24:48,421 ERROR [ServerEngine] Server error: AxisFault
      faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
      faultSubcode:
      faultString: Unable to create JavaBean of type org.w3c.dom.Element. Missing de
      fault constructor? Error was: java.lang.InstantiationException: org.w3c.dom.Ele
      ment.
      faultActor:
      faultNode:
      faultDetail:
      {http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException: Unabl
      e to create JavaBean of type org.w3c.dom.Element. Missing default constructor?
      Error was: java.lang.InstantiationException: org.w3c.dom.Element.
      at org.jboss.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeser
      ializer.java:219)
      at org.jboss.axis.encoding.DeserializerImpl.startElement

        • 1. Re: Unable to create JavaBean of type org.w3c.dom.Element
          dave s Newbie

          Amit,

          I'm seeing basically the same thing as you and posted some info but haven't received any responses yet: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=90603

          What did you get in your mapping.xml file for the java-xml-type-mapping elements? Did wscompile generate that section, and if so, did it map your WSDL types to org.w3c.dom.Element objects? Also did the generated SEI have its inputs and outputs as Element, or were they SOAPElement types?

          Thanks,
          Dave

          • 2. Re: Unable to create JavaBean of type org.w3c.dom.Element
            Amit Sri Newbie

            Hi Dave,

            Thanks for your response. The following mapping file is generated by the wscompile tool which looks OK to me.
            Let me know if you have any comments.

            Thanks,
            Amit

            <?xml version="1.0" encoding="UTF-8"?>
            <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
             <package-mapping>
             <package-type>oracle.idm.provisioning.ws.server</package-type>
             <namespaceURI>http://xmlns.oracle.com/FIDM/provisioning/types</namespaceURI>
             </package-mapping>
             <package-mapping>
             <package-type>oracle.idm.provisioning.ws.server</package-type>
             <namespaceURI>http://xmlns.oracle.com/FIDM/provisioning/</namespaceURI>
             </package-mapping>
             <java-xml-type-mapping>
             <java-type>org.w3c.dom.Element</java-type>
             <root-type-qname xmlns:typeNS="http://xmlns.oracle.com/FIDM/provisioning/types">typeNS:Element</root-type-qname>
             <qname-scope>complexType</qname-scope>
             <variable-mapping>
             <java-variable-name>nodeValue</java-variable-name>
             <xml-element-name>nodeValue</xml-element-name>
             </variable-mapping>
             <variable-mapping>
             <java-variable-name>prefix</java-variable-name>
             <xml-element-name>prefix</xml-element-name>
             </variable-mapping>
             <variable-mapping>
             <java-variable-name>textContent</java-variable-name>
             <xml-element-name>textContent</xml-element-name>
             </variable-mapping>
             </java-xml-type-mapping>
             <service-interface-mapping>
             <service-interface>oracle.idm.provisioning.ws.server.SpmlService</service-interface>
             <wsdl-service-name xmlns:serviceNS="http://xmlns.oracle.com/FIDM/provisioning/">serviceNS:SpmlService</wsdl-service-name>
             <port-mapping>
             <port-name>FIDMProvisioningPort</port-name>
             <java-port-name>FIDMProvisioningPort</java-port-name>
             </port-mapping>
             </service-interface-mapping>
             <service-endpoint-interface-mapping>
             <service-endpoint-interface>oracle.idm.provisioning.ws.server.FIDMProvisioning</service-endpoint-interface>
             <wsdl-port-type xmlns:portTypeNS="http://xmlns.oracle.com/FIDM/provisioning/">portTypeNS:FIDMProvisioning</wsdl-port-type>
             <wsdl-binding xmlns:bindingNS="http://xmlns.oracle.com/FIDM/provisioning/">bindingNS:FIDMProvisioningBinding</wsdl-binding>
             <service-endpoint-method-mapping>
             <java-method-name>processRequest</java-method-name>
             <wsdl-operation>processRequest</wsdl-operation>
             <method-param-parts-mapping>
             <param-position>0</param-position>
             <param-type>org.w3c.dom.Element</param-type>
             <wsdl-message-mapping>
             <wsdl-message xmlns:wsdlMsgNS="http://xmlns.oracle.com/FIDM/provisioning/">wsdlMsgNS:FIDMProvisioning_processRequest</wsdl-message>
             <wsdl-message-part-name>Element_1</wsdl-message-part-name>
             <parameter-mode>IN</parameter-mode>
             </wsdl-message-mapping>
             </method-param-parts-mapping>
             <wsdl-return-value-mapping>
             <method-return-value>org.w3c.dom.Element</method-return-value>
             <wsdl-message xmlns:wsdlMsgNS="http://xmlns.oracle.com/FIDM/provisioning/">wsdlMsgNS:FIDMProvisioning_processRequestResponse</wsdl-message>
             <wsdl-message-part-name>result</wsdl-message-part-name>
             </wsdl-return-value-mapping>
             </service-endpoint-method-mapping>
             </service-endpoint-interface-mapping>
            </java-wsdl-mapping>


            • 3. Re: Unable to create JavaBean of type org.w3c.dom.Element
              Thomas Diesler Master

              We do support message style endpoints in jbossws.

              http://labs.jboss.com/portal/jbossws/user-guide/en/html/getting-started.html#message-endpoints

              Note, the Axis based stack is in maintenance mode for customers.