Adobe Acrobat intercepts every URL from a call to BasicService.showDocument () in java

Our internal Java application launches various http URLs at different times, including URLs on web pages, MS Word documents, MS Excel documents, PDF files, etc.

On more than 50 machines, starting URLs works fine, and the right application correctly opens this page / document. However, on one annoying machine, Adobe Acrobat tries to open every URL (regardless of whether the target is a PDF file or not) and fails (even in pdf documents):

Error opening this document. The file name, directory name, or volume label syntax is invalid.

Code to run urls:

URL url = new URL("http://www.example.com");
BasicService bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
boolean worked = bs.showDocument(url);

The variable workedis true after the call.

Other points that may be helpful:

  • Java Web-Start.
  • , , URL-, AppletContext.showDocument()
  • URL- "..." URL- .
  • JRE Adobe Acrobat.

/, .

Update:

:

    String[] services = ServiceManager.getServiceNames();
    if(services!=null) {
      for(int i=0;i<services.length;i++) {
        System.out.println("Available Service: "+services[i]);
      }
    }

    BasicService bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
    System.out.println(url);
    System.out.println(bs);
    System.out.println("bs.getCodeBase():"+bs.getCodeBase());
    System.out.println("bs.isOffline():"+bs.isOffline());
    System.out.println("bs.isWebBrowserSupported():"+bs.isWebBrowserSupported());
    boolean worked = bs.showDocument(url);
    System.out.println("bs.showDocument:"+worked);
  } catch(UnavailableServiceException ue) {
    System.out.println("UnavailableServiceException thrown");
    ue.printStackTrace();
  }


Available Service: javax.jnlp.BasicService
Available Service: javax.jnlp.FileOpenService
Available Service: javax.jnlp.FileSaveService
Available Service: javax.jnlp.DownloadService
Available Service: javax.jnlp.ClipboardService
Available Service: javax.jnlp.PersistenceService
Available Service: javax.jnlp.PrintService
Available Service: javax.jnlp.ExtendedService
Available Service: javax.jnlp.SingleInstanceService
http://<snip>
com.sun.jnlp.BasicServiceImpl@bbb8b5
bs.getCodeBase():http://xxx.xxxxxx.com:8080/
bs.isOffline():false
bs.isWebBrowserSupported():true
bs.showDocument:true
+5
1

? , ?

FileOpenService fos = (FileOpenService)ServiceManager.lookup("javax.jnlp.FileOpenService"); 
+1

All Articles