Quelqu'un pourrait-il m'expliquer où se trouve la supposée variable dupliquée ? J'ai beau chercher je ne trouve pas ! J'ai l'impression que l'erreur se trouve autre part, vu que j'ai trouvé nulle trace de la variable dupliquée.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<%@ page import="javax.xml.namespace.QName,
org.apache.axis2.AxisFault,
org.apache.axis2.addressing.EndpointReference,
org.apache.axis2.client.Options,
org.apache.axis2.rpc.client.RPCServiceClient,
sample.addressbook.entry.Entry"
%>
<head>
</head>
<body>
<%
        RPCServiceClient serviceClient = new RPCServiceClient();
 
        Options options = serviceClient.getOptions();
 
        EndpointReference targetEPR = new EndpointReference(
                "http://127.0.0.1:8080/axis2/services/AddressBookService");
        options.setTo(targetEPR);
 
        // /////////////////////////////////////////////////////////////////////
 
        /*
         * Creates an Entry and stores it in the AddressBook.
         */
 
        // QName of the target method 
        QName opAddEntry = new QName("http://service.addressbook.sample", "addEntry");
 
        /*
         * Constructing a new Entry
         */
        Entry entry = new Entry();
 
        entry.setName("Abby Cadabby");
        entry.setStreet("Sesame Street");
        entry.setCity("Sesame City");
        entry.setState("Sesame State");
        entry.setPostalCode("11111");
 
        // Constructing the arguments array for the method invocation
        Object[] opAddEntryArgs = new Object[] { entry };
 
        // Invoking the method
        serviceClient.invokeRobust(opAddEntry, opAddEntryArgs);
 
        ////////////////////////////////////////////////////////////////////////
        
        
        ///////////////////////////////////////////////////////////////////////
        
        /*
         * Fetching an Entry from the Address book
         */
        
        // QName of the method to invoke 
        QName opFindEntry = new QName("http://service.addressbook.sample", "findEntry");
 
        //
        String name = "Abby Cadabby";
 
        Object[] opFindEntryArgs = new Object[] { name };
        Class[] returnTypes = new Class[] { Entry.class };
 
        
        Object[] response = serviceClient.invokeBlocking(opFindEntry,
                opFindEntryArgs, returnTypes);
        
        Entry result = (Entry) response[0];
        
        if (result == null) {
            System.out.println("No entry found for " + name);
            return;
        } 
        
        System.out.println("Name   :" + result.getName());
        System.out.println("Street :" + result.getStreet());
        System.out.println("City   :" + result.getCity());
        System.out.println("State  :" + result.getState());
        System.out.println("Postal Code :" + result.getPostalCode());
         %>
 
</body>
</html>
et voici mon erreur :

Une erreur s'est produite à la ligne: 66 dans le fichier jsp: /axis2-web/exemple.jsp
Duplicate local variable response
63: Class[] returnTypes = new Class[] { Entry.class };
64:
65:
66: Object[] response = serviceClient.invokeBlocking(opFindEntry,
67: opFindEntryArgs, returnTypes);
68:
69:


Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:316)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)