Abrindo um URL de java

estamos escrevendo um driver jdbc de código aberto para bigquery e nos deparamos com o seguinte problema:

Queremos autorizar nosso driver com o Oauth 2 como um aplicativo instalado. No windows xp, windows 7 x64, o windows 7 x64 + RDP funciona bem. Mas no testbench que é um servidor Windows 2008 R2 + RDP ele falha.

Basicamente, abrimos um navegador da Web, ele efetua login, capturamos a resposta e autenticamos o usuário.

Aqui está o código para a abertura do URL:

    private static void browse(String url) {
    // first try the Java Desktop
    logger.debug("First try the Java Desktop");
    if (Desktop.isDesktopSupported()) {
        Desktop desktop = Desktop.getDesktop();
        if (desktop.isSupported(Action.BROWSE))
            try {
                desktop.browse(URI.create(url));
                return;
            } catch (IOException e) {
                // handled below
            }
    }
    // Next try rundll32 (only works on Windows)
    logger.debug("Try the rundll32");
    try {
        Runtime.getRuntime().exec(
                "rundll32 url.dll,FileProtocolHandler " + url);
        return;
    } catch (IOException e) {
        // handled below
    }
    // Next try browsers
    logger.debug("Try with browsers");
    BareBonesBrowserLaunch.openURL(url);
}

O que eu descobri é: BareBonesBrowserLaunch não abre o link, nem o FileProtocolHandler.

O tamanho da URL é um pouco abaixo do 250.

Qualquer ajuda seria apreciada!

questionAnswers(3)

yourAnswerToTheQuestion