Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 15359 invoked from network); 8 Dec 2008 06:11:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2008 06:11:10 -0000 Received: (qmail 35794 invoked by uid 500); 8 Dec 2008 06:11:22 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 35745 invoked by uid 500); 8 Dec 2008 06:11:22 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 35734 invoked by uid 99); 8 Dec 2008 06:11:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Dec 2008 22:11:22 -0800 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willem.jiang@gmail.com designates 209.85.142.187 as permitted sender) Received: from [209.85.142.187] (HELO ti-out-0910.google.com) (209.85.142.187) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Dec 2008 06:09:49 +0000 Received: by ti-out-0910.google.com with SMTP id u5so726927tia.10 for ; Sun, 07 Dec 2008 22:10:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=y651jOxm3+zjb/++uqx6Ocdfv+sVD9wt4xAvWyVXLPM=; b=i+IMvU6ne3/qPBpuIe2IAOTGtMTJx/OAExxs3WiUgwWiDGVkfAnwVsLy0ON2yKqoNR zUYoB3ew9yw5K1N+gWLYG2FCetzivdg/5ggCtT+nOOMQbxCd+zpchQBJbyMiCPLPEdtT aeolWGm9Rf9T72f8BbHREA8LFCf5kexNjDU+w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=t7qdYyJd/snYn9zTSCOVJ30dUwzevlq7v8kI4bx9C5SN8Y/Uc2h4dG9rLy8fOW+J+X 6m646CkczP1QjdNwM4WKCuzccBpga8eiRcs/PZ5Ct9v1cVJazKeHEpkgi3/+BD/tGupi JgBmKY0/tP3F9HPmYaPzjBYxsgd5rBSEIfiBU= Received: by 10.110.43.16 with SMTP id q16mr4063289tiq.2.1228716636334; Sun, 07 Dec 2008 22:10:36 -0800 (PST) Received: from ?192.168.0.118? ([221.223.253.135]) by mx.google.com with ESMTPS id d4sm9708771tib.1.2008.12.07.22.10.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 07 Dec 2008 22:10:33 -0800 (PST) Message-ID: <493CBA4A.8010403@gmail.com> Date: Mon, 08 Dec 2008 14:10:18 +0800 From: Willem Jiang User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: dev@cxf.apache.org Subject: Re: svn commit: r723026 - in /cxf/branches/2.1.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ systests/src/test/java/org/apache/cxf/systest/jaxws/ References: <20081203192857.2F36D238887A@eris.apache.org> In-Reply-To: <20081203192857.2F36D238887A@eris.apache.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Dan, I got this error when I ran the ClientServerMiscTest in 2.1.x-fixes branch. Could you have a look at this ? java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract boolean javax.xml.bind.annotation.XmlElement.required() (Found data of type class java.lang.String[true]) at sun.reflect.annotation.AnnotationTypeMismatchExceptionProxy.generateException(Unknown Source) at sun.reflect.annotation.AnnotationInvocationHandler.invoke(Unknown Source) at $Proxy37.required(Unknown Source) at com.sun.xml.bind.v2.model.annotation.XmlElementQuick.required(XmlElementQuick.java:48) at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl.getTypes(ElementPropertyInfoImpl.java:139) at com.sun.xml.bind.v2.model.impl.RuntimeElementPropertyInfoImpl.getTypes(RuntimeElementPropertyInfoImpl.java:86) at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.size(ElementPropertyInfoImpl.java:78) at java.util.AbstractList$Itr.hasNext(Unknown Source) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:255) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:98) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:79) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:209) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:93) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:79) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:315) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:330) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:432) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:286) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at javax.xml.bind.ContextFinder.newInstance(Unknown Source) at javax.xml.bind.ContextFinder.find(Unknown Source) at javax.xml.bind.JAXBContext.newInstance(Unknown Source) at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:431) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:257) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:359) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:519) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:410) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:189) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:164) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100) at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117) at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168) at org.apache.cxf.systest.jaxws.ServerMisc.run(ServerMisc.java:76) at org.apache.cxf.testutil.common.AbstractTestServerBase.start(AbstractTestServerBase.java:67) at org.apache.cxf.systest.jaxws.ServerMisc.main(ServerMisc.java:112) Willem dkulp@apache.org wrote: > Author: dkulp > Date: Wed Dec 3 11:28:56 2008 > New Revision: 723026 > > URL: http://svn.apache.org/viewvc?rev=723026&view=rev > Log: > Merged revisions 723024 via svnmerge from > https://svn.apache.org/repos/asf/cxf/trunk > > ........ > r723024 | dkulp | 2008-12-03 14:24:56 -0500 (Wed, 03 Dec 2008) | 2 lines > > [CXF-1930] Fix for anonymous wrappers when asm is found > ........ > > Modified: > cxf/branches/2.1.x-fixes/ (props changed) > cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java > cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java > cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java > > Propchange: cxf/branches/2.1.x-fixes/ > ------------------------------------------------------------------------------ > --- svn:mergeinfo (original) > +++ svn:mergeinfo Wed Dec 3 11:28:56 2008 > @@ -1 +1 @@ > -/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696016,696094,696433,696720,697085,697868,698128,699289,700261,700507,700602,700981,701316,701783,701830,701862,702187,702205-702248,702267,702547,702561,702580,702602,702609,702616,702653,702656,702957,703191,703239,703309,703501,703513,703548,704584,704937,704997,705150,705235,705274,705340,705446,705548,705614,705692,705708,706482,706631,706675,706900,706909,707034,707089,707100,707902,708035,708044,708074,708410,708417,708550,708554,709353-709354,709425,710076,710150,71 015 > 4,711193,711388,711410,711490,711635,711975,712194,712198,712238,712272,712299,712312,712670,712893,713082,713095-713096,713099,713584,713597,713737,713804,713899,714167-714168,714245,714255,717937-717961,718281,718439,718448,718565,718620,718640,718665,718970,719017,719210,719215-719218,719222,719273,719305,719327,719354,719362,719368,719382,719649,719680,720053,720119,720238 > +/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696016,696094,696433,696720,697085,697868,698128,699289,700261,700507,700602,700981,701316,701783,701830,701862,702187,702205-702248,702267,702547,702561,702580,702602,702609,702616,702653,702656,702957,703191,703239,703309,703501,703513,703548,704584,704937,704997,705150,705235,705274,705340,705446,705548,705614,705692,705708,706482,706631,706675,706900,706909,707034,707089,707100,707902,708035,708044,708074,708410,708417,708550,708554,709353-709354,709425,710076,710150,71 015 > 4,711193,711388,711410,711490,711635,711975,712194,712198,712238,712272,712299,712312,712670,712893,713082,713095-713096,713099,713584,713597,713737,713804,713899,714167-714168,714245,714255,717937-717961,718281,718439,718448,718565,718620,718640,718665,718970,719017,719210,719215-719218,719222,719273,719305,719327,719354,719362,719368,719382,719649,719680,720053,720119,720238,723024 > > Propchange: cxf/branches/2.1.x-fixes/ > ------------------------------------------------------------------------------ > Binary property 'svnmerge-integrated' - no diff available. > > Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java > URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java?rev=723026&r1=723025&r2=723026&view=diff > ============================================================================== > --- cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java (original) > +++ cxf/branches/2.1.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java Wed Dec 3 11:28:56 2008 > @@ -161,14 +161,17 @@ > boolean isRequest) { > > QName wrapperElement = messageInfo.getName(); > + > + boolean anonymous = factory.getAnonymousWrapperTypes(); > > ClassWriter cw = createClassWriter(); > - String className = getPackageName(method) + ".jaxws_asm." > + String pkg = getPackageName(method) + ".jaxws_asm" + (anonymous ? "_an" : ""); > + String className = pkg + "." > + StringUtils.capitalize(op.getName().getLocalPart()); > if (!isRequest) { > className = className + "Response"; > } > - String pname = getPackageName(method) + ".jaxws_asm.package-info"; > + String pname = pkg + ".package-info"; > Class def = findClass(pname, method.getDeclaringClass()); > if (def == null) { > generatePackageInfo(pname, wrapperElement.getNamespaceURI(), > @@ -195,8 +198,12 @@ > av0.visitEnd(); > > av0 = cw.visitAnnotation("Ljavax/xml/bind/annotation/XmlType;", true); > - av0.visit("name", wrapperElement.getLocalPart()); > - av0.visit("namespace", wrapperElement.getNamespaceURI()); > + if (!anonymous) { > + av0.visit("name", wrapperElement.getLocalPart()); > + av0.visit("namespace", wrapperElement.getNamespaceURI()); > + } else { > + av0.visit("name", ""); > + } > av0.visitEnd(); > > // add constructor > > Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java > URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=723026&r1=723025&r2=723026&view=diff > ============================================================================== > --- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java (original) > +++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java Wed Dec 3 11:28:56 2008 > @@ -19,12 +19,16 @@ > > package org.apache.cxf.systest.jaxws; > > +import java.io.InputStream; > import java.lang.reflect.UndeclaredThrowableException; > +import java.net.HttpURLConnection; > import java.net.URL; > import java.util.ArrayList; > import java.util.Arrays; > import java.util.Collections; > +import java.util.HashMap; > import java.util.List; > +import java.util.Map; > import java.util.Set; > > import javax.xml.namespace.QName; > @@ -32,6 +36,10 @@ > import javax.xml.ws.Service; > import javax.xml.ws.soap.SOAPBinding; > import javax.xml.ws.soap.SOAPFaultException; > +import javax.xml.xpath.XPathConstants; > + > +import org.w3c.dom.Document; > +import org.w3c.dom.Node; > > import org.apache.cxf.anonymous_complex_type.AnonymousComplexType; > import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeService; > @@ -39,7 +47,10 @@ > import org.apache.cxf.anonymous_complex_type.RefSplitNameResponse; > import org.apache.cxf.anonymous_complex_type.SplitName; > import org.apache.cxf.anonymous_complex_type.SplitNameResponse.Names; > +import org.apache.cxf.binding.soap.Soap11; > import org.apache.cxf.frontend.ClientProxyFactoryBean; > +import org.apache.cxf.helpers.XMLUtils; > +import org.apache.cxf.helpers.XPathUtils; > import org.apache.cxf.jaxb_element_test.JaxbElementTest; > import org.apache.cxf.jaxb_element_test.JaxbElementTest_Service; > import org.apache.cxf.ordered_param_holder.ComplexStruct; > @@ -556,4 +567,44 @@ > assertEquals(2, port.operationInSub1(2)); > assertEquals(3, port.operationInSub2(3)); > } > + > + > + > + @Test > + public void testAnonymousMinOccursConfig() throws Exception { > + HttpURLConnection httpConnection = > + getHttpConnection(ServerMisc.DOCLIT_CODEFIRST_SETTINGS_URL + "?wsdl"); > + httpConnection.connect(); > + > + assertEquals(200, httpConnection.getResponseCode()); > + assertEquals("OK", httpConnection.getResponseMessage()); > + InputStream in = httpConnection.getInputStream(); > + assertNotNull(in); > + > + Document doc = XMLUtils.parse(in); > + assertNotNull(doc); > + > + > + Map ns = new HashMap(); > + ns.put("soap", Soap11.SOAP_NAMESPACE); > + ns.put("tns", "http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService"); > + ns.put("wsdl", "http://schemas.xmlsoap.org/wsdl/"); > + ns.put("xs", "http://www.w3.org/2001/XMLSchema"); > + > + > + XPathUtils xu = new XPathUtils(ns); > + > + //make sure the wrapper types are anonymous types > + Node ct = (Node) xu.getValue("//wsdl:definitions/wsdl:types/xs:schema" > + + "/xs:element[@name='getFooSetResponse']/xs:complexType/xs:sequence", > + doc, XPathConstants.NODE); > + assertNotNull(ct); > + > + //make sure the params are nillable, not minOccurs=0 > + ct = (Node) xu.getValue("//wsdl:definitions/wsdl:types/xs:schema" > + + "/xs:element[@name='multiInOut']/xs:complexType/xs:sequence" > + + "/xs:element[@nillable='true']", > + doc, XPathConstants.NODE); > + assertNotNull(ct); > + } > } > > Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java > URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java?rev=723026&r1=723025&r2=723026&view=diff > ============================================================================== > --- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java (original) > +++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java Wed Dec 3 11:28:56 2008 > @@ -26,9 +26,11 @@ > import org.apache.cxf.jaxws.JAXWSMethodInvoker; > import org.apache.cxf.jaxws.JaxWsServerFactoryBean; > import org.apache.cxf.ordered_param_holder.OrderedParamHolderImpl; > +import org.apache.cxf.service.factory.AbstractServiceConfiguration; > import org.apache.cxf.service.invoker.Factory; > import org.apache.cxf.service.invoker.PerRequestFactory; > import org.apache.cxf.service.invoker.PooledFactory; > +import org.apache.cxf.service.model.MessagePartInfo; > import org.apache.cxf.testutil.common.AbstractBusTestServerBase; > > > @@ -41,6 +43,8 @@ > "http://localhost:9003/DocLitWrappedCodeFirstServiceBaseService/"; > public static final String DOCLITBARE_CODEFIRST_URL = > "http://localhost:9003/DocLitBareCodeFirstService/"; > + public static final String DOCLIT_CODEFIRST_SETTINGS_URL = > + "http://localhost:9003/DocLitWrappedCodeFirstServiceSettings/"; > > protected void run() { > > @@ -48,11 +52,28 @@ > factory = new PooledFactory(factory, 4); > > JAXWSMethodInvoker invoker = new JAXWSMethodInvoker(factory); > - JaxWsServerFactoryBean factoryBean = new JaxWsServerFactoryBean(); > + JaxWsServerFactoryBean factoryBean; > + > + factoryBean = new JaxWsServerFactoryBean(); > factoryBean.setAddress(DOCLIT_CODEFIRST_URL); > factoryBean.setServiceClass(DocLitWrappedCodeFirstServiceImpl.class); > factoryBean.setInvoker(invoker); > factoryBean.create(); > + > + factoryBean = new JaxWsServerFactoryBean(); > + factoryBean.setAddress(DOCLIT_CODEFIRST_SETTINGS_URL); > + factoryBean.setServiceClass(DocLitWrappedCodeFirstServiceImpl.class); > + factoryBean.setInvoker(invoker); > + factoryBean.getServiceFactory().setAnonymousWrapperTypes(true); > + factoryBean.getServiceFactory().getServiceConfigurations().add(0, new AbstractServiceConfiguration() { > + public Boolean isWrapperPartNillable(MessagePartInfo mpi) { > + return Boolean.TRUE; > + } > + public Long getWrapperPartMinOccurs(MessagePartInfo mpi) { > + return Long.valueOf(1L); > + } > + }); > + factoryBean.create(); > > //Object implementor4 = new DocLitWrappedCodeFirstServiceImpl(); > //Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4); > > >