Well, I'm not expert at all. The exception is in the server side, right? Can you share the wsdd? Sent via BlackBerry from T-Mobile
-----Original Message----- From: Bing Li <[email protected]> Date: Mon, 14 Mar 2011 21:48:14 To: JOSE L MARTINEZ-AVIAL<[email protected]> Reply-To: [email protected] Cc: <[email protected]> Subject: Re: NoSuchMethodError: ... (LJava/lang/String) Dear Jose, I didn't use WSDL to generate any stud code. What I am currently using is POJO. I don't understand why AXIS has such a design on Web services? Thanks, LB On Mon, Mar 14, 2011 at 7:35 PM, JOSE L MARTINEZ-AVIAL <[email protected]>wrote: > can you provide the WSDL you are using? > > > 2011/3/14 Bing Li <[email protected]> > >> Sorry to send the question again. I forgot putting the example code in the >> previous email. The code is as follows. It works fine. However, my code does >> not. >> >> public class AddressBookService { >> >> private HashMap entries = new HashMap(); >> private MyAddress myaddr = new MyAddress(); >> >> /** >> * Add an Entry to the Address Book >> * @param entry >> */ >> public void addEntry(Entry entry) { >> this.entries.put(entry.getName(), entry); >> } >> >> /** >> * Search an address of a person >> * >> * @param name the name of the person whose address needs to be found >> * @return return the address entry of the person. >> */ >> public Entry findEntry(String name) { >> return myaddr.getAddr(name); >> >> } >> } >> >> >> On Mon, Mar 14, 2011 at 2:33 PM, Bing Li <[email protected]> wrote: >> >>> Dear Martin, >>> >>> >>> I appreciate so much for your help! >>> >>> However, I am still confused about the problem. I tried one example as >>> follows. In this example, a String is sent as a parameter. And then a local >>> method, getAddr(String keyword), of an object, MyAddress, is invoked. I >>> noticed that it worked fine. >>> >>> My case should be the same as that. What I am wondering why such a type >>> Ljava/lang/String emerged! I never touched that. Moreover, even though I >>> changed the String to String[], the problem still exists. Really don't >>> understand why Web services has such a design. >>> >>> I use POJO to implement my Web services. Could you give me a hand? >>> >>> Thanks, >>> LB >>> >>> >>> On Mon, Mar 14, 2011 at 9:49 AM, Martin Gainty <[email protected]>wrote: >>> >>>> it seems that you changed your original input or output message to send >>>> array of string to single string or vice versa >>>> >>>> if you see the operation SelectCategoriedHubByKey make sure your input >>>> and output messages reference the ArrayOfString typed element here is an >>>> example >>>> >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <xsd:schema targetNamespace="http://www.test.org/sample_types" >>>> xmlns:tns="http://www.test.org/sample_types" >>>> xmlns:soap-enc="http://www.w3.org/2001/09/soap-encoding" >>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"> >>>> <!-- >>>> These will cause errors in generation but are necessary for an XML >>>> schema validator >>>> like IBM Schema Quality Checker >>>> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" >>>> schemaLocation=" >>>> http://schemas.xmlsoap.org/soap/encoding/"/> >>>> <xsd:import namespace="http://www.w3.org/2001/09/soap-encoding" >>>> schemaLocation="http://www.w3.org/2001/09/soap-encoding >>>> "/> >>>> --> >>>> <xsd:complexType name="ArrayOfString"> >>>> <xsd:complexContent> >>>> <xsd:restriction base="soap-enc:Array"> >>>> <xsd:sequence> >>>> <xsd:element name="stringElement" type="xsd:string" >>>> minOccurs="0" maxOccurs="unbounded"/> >>>> </xsd:sequence> >>>> <xsd:attributeGroup ref="soap-enc:arrayAttributes"/> >>>> <xsd:attributeGroup ref="soap-enc:commonAttributes"/> >>>> </xsd:restriction> >>>> </xsd:complexContent> >>>> </xsd:complexType> >>>> >>>> <xsd:element name="strings" type="tns:ArrayOfString" nillable="true" >>>> minOccurs="1" maxOccurs="1" /> >>>> >>>> >>>> <!-- you can reference element name 'strings' for either InputMessage or >>>> OutputMessage for your SelectCategoriedHubByKey operation --> >>>> >>>> Martin >>>>______________________________________________ >>>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité >>>> >>>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene >>>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte >>>> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht >>>> dient lediglich dem Austausch von Informationen und entfaltet keine >>>> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von >>>> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. >>>> >>>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le >>>> destinataire prévu, nous te demandons avec bonté que pour satisfaire >>>> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la >>>> copie de ceci est interdite. Ce message sert à l'information seulement et >>>> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que >>>> les email peuvent facilement être sujets à la manipulation, nous ne >>>> pouvons accepter aucune responsabilité pour le contenu fourni. >>>> >>>> >>>> >>>> >>>> >>>> >>>> ------------------------------ >>>> Date: Mon, 14 Mar 2011 04:16:07 +0800 >>>> Subject: Re: NoSuchMethodError: ... (LJava/lang/String) >>>> From: [email protected] >>>> To: [email protected] >>>> CC: [email protected] >>>> >>>> >>>> Dear Andreas, >>>> >>>> Thanks so much for your reply! >>>> >>>> Could you please tell me how to solve the problem? >>>> >>>> Thanks, >>>> LB >>>> >>>> On Mon, Mar 14, 2011 at 3:41 AM, Andreas Veithen < >>>> [email protected]> wrote: >>>> >>>> No, "Ljava/lang/String;" is the type descriptor used by the JVM to >>>> represent java.lang.String. The type descriptor for String[] would be >>>> "[Ljava/lang/String;". >>>> >>>> Andreas >>>> >>>> On Sun, Mar 13, 2011 at 20:31, JOSE L MARTINEZ-AVIAL <[email protected]> >>>> wrote: >>>> > I think it is trying to invoke a method with a String[] attribute, not >>>> > simply a String. >>>> > >>>> > 2011/3/13 Bing Li <[email protected]> >>>> >> >>>> >> Dear all, >>>> >> >>>> >> I am a new Axis2 user. Today I got a weird exception when calling a >>>> Web >>>> >> service. >>>> >> >>>> >> This Web service is deployed on Tomcat/Axis2. I need to transmit an >>>> object >>>> >> (parameter) to it. The object contains a String attribute. The object >>>> is >>>> >> received correctly. However, when calling a local method on the >>>> remote >>>> >> machine, it got the following errors. I noticed that the method >>>> >> SelectCategoriedHubByKey(Ljava/lang/String key) cannot be found on >>>> the >>>> >> machine. Actually, the method should be >>>> SelectCategoriedHubByKey(String >>>> >> key). Why is the parameter changed from String to LJava/lang/String? >>>> How to >>>> >> solve the problem? >>>> >> >>>> >> Thanks so much! >>>> >> LB >>>> >> >>>> >> [ERROR] >>>> >> >>>> com.greatfree.OODB.CategorizedHubDB.SelectCategorizedHubByKey(Ljava/lang/String;)Lcom/greatfree/OODB/CategorizedHub; >>>> >> java.lang.reflect.InvocationTargetException >>>> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >>>> Method) >>>> >> at >>>> >> >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>> >> at >>>> >> >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>> >> at java.lang.reflect.Method.invoke(Method.java:597) >>>> >> at >>>> >> >>>> org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) >>>> >> at >>>> >> >>>> org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) >>>> >> at >>>> >> >>>> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) >>>> >> at >>>> >> >>>> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114) >>>> >> at >>>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173) >>>> >> at >>>> >> >>>> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173) >>>> >> at >>>> >> >>>> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144) >>>> >> at >>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:641) >>>> >> at >>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:722) >>>> >> at >>>> >> >>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) >>>> >> at >>>> >> >>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) >>>> >> at >>>> >> >>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) >>>> >> at >>>> >> >>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) >>>> >> at >>>> >> >>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) >>>> >> at >>>> >> >>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108) >>>> >> at >>>> >> >>>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558) >>>> >> at >>>> >> >>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) >>>> >> at >>>> >> >>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379) >>>> >> at >>>> >> >>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) >>>> >> at >>>> >> >>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259) >>>> >> at >>>> >> >>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:237) >>>> >> at >>>> >> >>>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281) >>>> >> at >>>> >> >>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >>>> >> at >>>> >> >>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >>>> >> at java.lang.Thread.run(Thread.java:662) >>>> >> Caused by: java.lang.NoSuchMethodError: >>>> >> >>>> com.greatfree.OODB.CategorizedHubDB.SelectCategorizedHubByKey(Ljava/lang/String;)Lcom/greatfree/OODB/CategorizedHub; >>>> >> at >>>> >> com.greatfree.HTTP.CategorizedHubService.getCategorizedHub(Unknown >>>> Source) >>>> >> ... 29 more >>>> >> >>>> > >>>> > >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [email protected] >>>> For additional commands, e-mail: [email protected] >>>> >>>> >>>> >>> >> >
