IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Servlets/JSP Java Discussion :

duplicate local variable response


Sujet :

Servlets/JSP Java

  1. #1
    Candidat au Club
    Inscrit en
    Mars 2008
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Mars 2008
    Messages : 4
    Points : 2
    Points
    2
    Par défaut duplicate local variable response
    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)

  2. #2
    Membre éclairé Avatar de rberthou
    Profil pro
    Inscrit en
    Septembre 2007
    Messages
    612
    Détails du profil
    Informations personnelles :
    Âge : 60
    Localisation : France

    Informations forums :
    Inscription : Septembre 2007
    Messages : 612
    Points : 690
    Points
    690
    Par défaut
    Si tu es dans une page jsp (ce qui doit etre le cas)
    Object[] response
    Cela doit être l'objet "response" qui fait partie des objets implicites d'une page jsp (comme request, application, ...).

Discussions similaires

  1. [JSP]Duplicate local variable
    Par Unreal Time dans le forum Servlets/JSP
    Réponses: 2
    Dernier message: 14/06/2012, 11h58
  2. Erreur à la compilation:Duplicate local variable
    Par manguigs dans le forum Débuter avec Java
    Réponses: 2
    Dernier message: 17/03/2009, 12h05
  3. erreur:The local variable may not have been initialized
    Par wiss20000 dans le forum Langage
    Réponses: 7
    Dernier message: 22/03/2007, 15h18
  4. Réponses: 2
    Dernier message: 20/09/2006, 18h10
  5. Problème de duplication de variables session
    Par boubsa dans le forum Langage
    Réponses: 5
    Dernier message: 10/05/2006, 16h49

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo