Category Archives: applet

java.io.FileNotFoundException: D:\META-INF\services\org.apache.commons.logging.LogFactory (The system cannot find the file specified)

I try to create a PDF Document with PDF BOX app-2.0.4.jar in my java applet,

PDDocument doc = new PDDocument();

but an exception is thrown:

java.io.FileNotFoundException:
D:\Examples\META-INF\services\org.apache.commons.logging.LogFactory (The
system cannot find the file specified)

at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
    at java.net.URL.openStream(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.getResourceAsStream(Unknown Source)
    at org.apache.commons.logging.LogFactory$3.run(LogFactory.java:1280)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.commons.logging.LogFactory.getResourceAsStream(LogFactory.java:1276)
    at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:532)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:657)
    at org.apache.pdfbox.pdmodel.PDDocument.<clinit>(PDDocument.java:78)
    at comUtilScan.ScanAllPapers$2$1.run(ScanAllPapers.java:116)
    at java.security.AccessController.doPrivileged(Native Method)
    at comUtilScan.ScanAllPapers$2.actionPerformed(ScanAllPapers.java:111)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

Apache HTTP Server Redirect calls to a different port on same box

Backstory:

I have a Java Applet which is hosted on a server and accessible through HTTP here:

https://myserver/applet

Note that the port (443) is omitted.

This applet used to be able to create a InetSocketAddress to the server on a different port (for this, I am using port 2345, but thats only for the example). myserver:2345

This used to work fine and dandy until...

The problem:

However, with Java 8, unsigned ('sandboxed') applets cannot call to a different port that the one which they are hosted on (in this case, 443). So I am trying to reroute the socket connection call using the Apache HTTP server - using either mod_proxy or mod_rewrite - from the 443 port to the 2345 port.

Now I cannot just wholesale reroute everything from 443 to that other port, as I still need the original SSL functionality, however, there are no calls being made to the server other than the socket call which go anywhere but applet, which is why I have been trying to route everything at '/' to the other port and leave everything else alone.

Does anyone have any ideas? This is a non-exhaustive list I have tried these things below in my httpd.conf file. Note: There are other things in the VirtualHost, but shouldn't cause any conflict, mostly NSS setup.

<VirtualHost _default_:443>
  RewriteEngine on
  RewriteRule ^/$ https://192.168.5.22:2261/ [P]
</VirtualHost>

or:

<VirtualHost _default_:443>
  ProxyPreserveHost off
  AllowCONNECT 443

  #Ignore anything with applet
  ProxyPassMatch ^/applet !

  #Reroute the socket calls
  ProxyPass / https://192.168.5.22:2261/
  ProxyPassReverse / https://192.168.5.22:2261/
</VirtualHost>

Is something like this even possible or am I just wasting time?