Results 1 to 3 of 3
  1. #1
    Blaine is offline Member
    Join Date
    May 2010
    Posts
    3
    Rep Power
    0

    Default WebServiceException: java.util.NoSuchElementException in Java web start app with Jre7

    I've a problem with my Java (swing) application, but only with Java 7 in tomcat 7. It works well on Java 6 with tomcat 6/7.

    It's a Java Web Start Application. After download the jnlp it ask's username and password data. It uses a webservice to check if the given username and password are valid. With Java 7 the invoke throws a InvocationTargetException with this: "WebServiceException: java.util.NoSuchElementException"

    I put logs in the server and the call is processed well on the server, returning the value, but with Java 7 client throws this exception, and I don't know how can I solve it.

    Is It a bug of JRE7?

    Here is the client code (my method is called "login")

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    Object result = null;
    short retries = 0;
    while (retries < MAX_RETRIES) {
    retries ++;
    try {
    result = method.invoke(wbPort, args);
    } catch (InvocationTargetException e) {
    Throwable throwable = e.getTargetException();
    if ( (throwable instanceof WebServiceException &&
    throwable.getCause() instanceof ConnectException) ||
    throwable instanceof ConnectException ) {
    if (retries < MAX_RETRIES) {
    changeEndpointNode();
    continue;
    }
    }
    throw e.getTargetException();
    } catch (Exception e) {
    throw new RuntimeException("unexpected invocation exception: " +
    e.getMessage());
    }
    break;
    }
    return result;
    }

    And here Server code:

    public List<String> login() throws AppFault{
    rolManager = null;
    Document document = null;
    try {
    MessageContext mc = wsContext.getMessageContext();
    Map<?, ?> map = (Map<?, ?>)mc.get(
    MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
    DataHandler dh = (DataHandler)map.get("application.session");
    DocumentBuilder builder = DocumentBuilderFactory.
    newInstance().newDocumentBuilder();
    document = builder.parse(dh.getInputStream());
    List<String> privileges = getRolManager().getPrivileges();
    return privileges;
    } catch (Exception e) {
    throw new AppFault("Application Error",
    e.getLocalizedMessage(), e);
    } finally{
    setSessionData(new ApplicationSessionData(document));
    }
    }

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,029
    Rep Power
    6

    Default Re: WebServiceException: java.util.NoSuchElementException in Java web start app with

    It is not productive for you to want this to be a bug in the runtime, because then you are stuck. You first want to exhaust the possibility that it is something on your end that is wrong.

    I would first suspect the deployment of your application, it may be that you are causing conflicts by deploying mismatched versions of libraries.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: WebServiceException: java.util.NoSuchElementException in Java web start app with

    It might be helpful to give the full exception and stack trace.
    Be sure to include any wrapped exceptions (ie the "caused by").
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. java.util.Scanner NoSuchElementException
    By lzw in forum Advanced Java
    Replies: 9
    Last Post: 11-28-2013, 11:22 AM
  2. java.util.NoSuchElementException
    By Xyexs in forum New To Java
    Replies: 3
    Last Post: 04-19-2013, 02:09 PM
  3. java.util.NoSuchElementException
    By tabishis in forum New To Java
    Replies: 1
    Last Post: 10-12-2012, 04:30 AM
  4. java.util.NoSuchElementException
    By Parkuss in forum New To Java
    Replies: 1
    Last Post: 03-25-2011, 07:33 AM
  5. Replies: 6
    Last Post: 03-11-2011, 03:53 AM

Posting Permissions

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