Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D2A6DE101 for ; Thu, 7 Feb 2013 17:21:59 +0000 (UTC) Received: (qmail 32989 invoked by uid 500); 7 Feb 2013 17:21:59 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 32936 invoked by uid 500); 7 Feb 2013 17:21:59 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 32926 invoked by uid 99); 7 Feb 2013 17:21:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 17:21:59 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.85.173.253] (HELO server.dankulp.com) (64.85.173.253) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2013 17:21:53 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id 17F5D180A45; Thu, 7 Feb 2013 12:21:33 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter-users@cxf.apache.org.5IMIOEafDg Received: from macbook.house.dankulp.com (c-24-91-72-253.hsd1.ma.comcast.net [24.91.72.253]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTPSA id 8D06A180A35; Thu, 7 Feb 2013 12:21:26 -0500 (EST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: Abstract Type InstantiationException From: Daniel Kulp In-Reply-To: Date: Thu, 7 Feb 2013 12:21:25 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: users@cxf.apache.org, "Gormann, Erich" X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 On Feb 6, 2013, at 7:38 AM, "Gormann, Erich" = wrote: > Dear all, >=20 > I'am just new to this and first I would like to greet you all. >=20 > Since two years I'am working with web services and 2 weeks ago I used = Apache CXF the first time. I generated code using the wsdl2java goal in = the cxf-codegen-plugin. My cxf version is 2.7.3. >=20 > When calling a webservice from outside I faced the following problem = (complete stack at the end of this post): We'd likely need to see a bit more information. In particular: 1) The element and sequence that would represent the message that is = being sent in the soap:body 2) The soap message being sent. If the element within the messages sequence looks something like: then the soap message would HAVE to have an xsi:type attribute on the = element to specify that it is a subclass. If it looks like: then I believe it should be working fine. Would need to see the schema = and messages though to double check. Dan >=20 > Feb 06, 2013 8:55:00 AM com.sun.xml.bind.v2.ClassFactory create > INFO: failed to create a new instance of class = eu.mybankpayments.protocol.messages._20120917.AbstractApplicationID > java.lang.InstantiationException > at = sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Inst= antiationExceptionConstructorAccessorImpl.java:48) >=20 >=20 > There is an abstract type an 2 concrete sub classes in my xsd. Here is = what cxf has generated as annotation above the abstract type: > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name =3D "XYZID", propOrder =3D { > "value" > }) > public abstract class XYZID > implements Serializable > { ...} >=20 > This is the annotation above the sub class: >=20 > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name =3D "XYZIDSubType") > public class XYZIDSubType > extends XYZID > implements Serializable > { >=20 > The XSD looks like following: >=20 > For the abstract class: > > > > > >=20 > For the sub class: > > > > > > > >=20 >=20 > Thank you in advance for any help . >=20 > Regards, Eric >=20 >=20 > Feb 06, 2013 8:55:00 AM com.sun.xml.bind.v2.ClassFactory create > INFO: failed to create a new instance of class = eu.mybankpayments.protocol.messages._20120917.AbstractApplicationID > java.lang.InstantiationException > at = sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Inst= antiationExceptionConstructorAccessorImpl.java:48) > at = java.lang.reflect.Constructor.newInstance(Constructor.java:525) > at = com.sun.xml.bind.v2.ClassFactory.create0(ClassFactory.java:133) > at = com.sun.xml.bind.v2.ClassFactory.create(ClassFactory.java:142) > at = com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.createInstan= ce(UnmarshallingContext.java:609) > at = com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl$TransducerImpl.parse(R= untimeClassInfoImpl.java:392) > at = com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransduced= AccessorImpl.parse(TransducedAccessor.java:247) > at = com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPrope= rtyLoader.java:65) > at = com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(Unmarsh= allingContext.java:514) > at = com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(S= tAXStreamConnector.java:338) > at = com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElem= ent(StAXStreamConnector.java:216) > at = com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXSt= reamConnector.java:185) > at = com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unmar= shallerImpl.java:370) > at = com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unmars= hallerImpl.java:349) > at = org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java= :769) > at = org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:= 94) > at = org.apache.cxf.jaxb.JAXBEncoderDecoder$1.run(JAXBEncoderDecoder.java:797) > at java.security.AccessController.doPrivileged(Native Method) > at = org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:= 795) > at = org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:= 629) > at = org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:157) > at = org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLitera= lInInterceptor.java:198) > at = org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha= in.java:271) > at = org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiation= Observer.java:121) > at = org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPD= estination.java:239) > at = org.apache.cxf.transport.servlet.ServletController.invokeDestination(Servl= etController.java:218) > at = org.apache.cxf.transport.servlet.ServletController.invoke(ServletControlle= r.java:198) > at = org.apache.cxf.transport.servlet.ServletController.invoke(ServletControlle= r.java:137) > at = org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringSe= rvlet.java:158) > at = org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Abstrac= tHTTPServlet.java:243) > at = org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPSe= rvlet.java:163) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) > at = org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPS= ervlet.java:219) > at = org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati= onFilterChain.java:305) > at = org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter= Chain.java:210) > at = org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.= java:222) > at = org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.= java:123) > at = org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45) > at = org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBa= se.java:472) > at = org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1= 71) > at = org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:9= 9) > at = org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) > at = org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja= va:118) > at = org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407= ) > at = org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Pro= cessor.java:1004) > at = org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstr= actProtocol.java:589) > at = org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.jav= a:310) > at = java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:= 1110) > at = java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java= :603) > at java.lang.Thread.run(Thread.java:722) >=20 > Gesch=E4ftsf=FChrer: Wolf Kunisch > Aufsichtsratsvorsitzender: Christophe Duquenne > Sitz der Gesellschaft: Frankfurt/M. > Handelsregister: Frankfurt/Main HRB 40 417 >=20 > * * * * * * * * L E G A L D I S C L A I M E R * * * * * * * * > This e-mail and the documents attached are confidential and intended = solely for the addressee; it may also be privileged. If you receive this = e-mail by error, please notify the sender immediately and destroy it. As = its integrity cannot be secured on the internet, the Atos group = liability cannot be triggered for the message content. Although the = sender endeavors to maintain a computer virus-free network, the sender = does not warrant that this transmission is virus-free and shall not be = liable for any damages resulting from any virus transmitted. > * * * * * * * * L E G A L D I S C L A I M E R * * * * * * * * --=20 Daniel Kulp dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com