Results 1 to 5 of 5

Thread: From error to error. - Endpoint invocation resulted in exception

  1. #1
    Join Date
    Jan 2006
    Location
    Canary Islands - Spain
    Posts
    10

    Default From error to error. - Endpoint invocation resulted in exception

    The web service is invoked, an return an ELEMENT type, the I have a SOAP Exception. I'm using the new Snapshot version.

    Code:
    2006-07-06 11:28:44,129 INFO  [STDOUT] 2006-07-06 11:28:44,129 INFO [xxx.controlservidores.ws.ReceptorFtpEndPoint] - Devolvemos como resultado OK
    2006-07-06 11:28:44,145 INFO  [STDOUT] 2006-07-06 11:28:44,145 DEBUG [org.springframework.ws.soap.SoapMessageDispatcher] - Testing endpoint exception resolver [org.springframework.ws.soap.endpoint.SimpleSoapExceptionResolver@131ebb3]
    2006-07-06 11:28:44,160 INFO  [STDOUT] 2006-07-06 11:28:44,160 WARN [org.springframework.ws.soap.SoapMessageDispatcher] - Endpoint invocation resulted in exception - responding with SOAP Fault
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    	at java.util.ArrayList.RangeCheck(ArrayList.java:547)
    This is the EndPoint code. I introduce a try--catch just before the return code... as you can see the Exception goes after the return code...

    Code:
    protected Element invokeInternal(Element requestElement, Document document) throws Exception {
    		logger.info("invokeInternal. " + requestElement.getNamespaceURI() + " - " + requestElement.getLocalName());
    		Assert.isTrue(NAMESPACE_URI.equals(requestElement.getNamespaceURI()), "Invalid namespace");
            Assert.isTrue(ECHO_REQUEST_LOCAL_NAME.equals(requestElement.getLocalName()), "Invalid local name");
    
            NodeList children = requestElement.getChildNodes();
            Text requestText = null;
            for (int i = 0; i < children.getLength(); i++) {
                if (children.item(i).getNodeType() == Node.TEXT_NODE) {
                    requestText = (Text) children.item(i);
                    break;
                }
            }
            if (requestText == null) {
                throw new IllegalArgumentException("Could not find request text node");
            }
            try {
            String servidor = requestText.getNodeValue();
    
            logger.info("Se invocó el servicio con valor " + servidor);
            String resultado = receptorFtpService.setAlive(servidor);
                    
            Element responseElement = document.createElementNS(NAMESPACE_URI, ECHO_RESPONSE_LOCAL_NAME);
            Text responseText = document.createTextNode(resultado);
            responseElement.appendChild(responseText);
            logger.info("Devolvemos como resultado " + resultado);
            return responseElement;
            }
            catch (Exception e) {
            	logger.fatal(e.getMessage());
            	return null;
            }
    Thanks in advance...

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    It's just a hunch, but are you using JBoss by any chance?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    Jan 2006
    Location
    Canary Islands - Spain
    Posts
    10

    Default

    Yes, I'm using JBoss 4.0.3SP1 and 4.0.4GA.

  4. #4
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Yeah, that's what I thought. I think it's a bug in JBoss's implementation of SAAJ. I've notified the JBoss developers: http://www.jboss.com/index.html?modu...wtopic&t=86580, so let's hope it gets fixed soon.

    As a workaround, you can override JBoss's SAAJ implementation with the reference implementation. I'm not a JBoss expert, so I don't know how this is done, but I think you can find resources on the web that tell you how.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  5. #5
    Join Date
    Jan 2006
    Location
    Canary Islands - Spain
    Posts
    10

    Default

    Thank you very much...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •