You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Karl Pauls (JIRA)" <ji...@apache.org> on 2011/03/10 11:39:59 UTC

[jira] Created: (FELIX-2877) java6 update 24 breaks felix when used inside webstart

java6 update 24 breaks felix when used inside webstart
------------------------------------------------------

                 Key: FELIX-2877
                 URL: https://issues.apache.org/jira/browse/FELIX-2877
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-3.0.9
         Environment: java6 update24
            Reporter: Karl Pauls
            Assignee: Karl Pauls
             Fix For: framework-3.2.0


See FELIX-2780.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Resolved: (FELIX-2877) java6 update 24 breaks felix when used inside webstart

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls resolved FELIX-2877.
-------------------------------

    Resolution: Fixed

> java6 update 24 breaks felix when used inside webstart
> ------------------------------------------------------
>
>                 Key: FELIX-2877
>                 URL: https://issues.apache.org/jira/browse/FELIX-2877
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: java6 update24
>            Reporter: Karl Pauls
>            Assignee: Karl Pauls
>             Fix For: framework-3.2.0
>
>
> See FELIX-2780.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (FELIX-2877) java6 update 24 breaks felix when used inside webstart

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls updated FELIX-2877:
------------------------------

    Description: 
The problem was reported on FELIX-2780 but is an issue in its own right. From the comments:

... this exception is what I
got due to update 24.

This happens in static code inside javax.imageio.ImageIO when its trying to
load the image handlers.

Caused by: java.lang.SecurityException: Permission denied:
http://felix.extensions:9/META-INF/services/javax.imageio.spi.ImageInputStreamSpi
    at
com.sun.deploy.security.DeployURLClassPath$UrlLoader.findResource(Unknown
Source)
    at com.sun.deploy.security.DeployURLClassPath$1.next(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$1.hasMoreElements(Unknown
Source)
    at java.net.URLClassLoader$3$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader$3.next(Unknown Source)
    at java.net.URLClassLoader$3.hasMoreElements(Unknown Source)
    at sun.misc.CompoundEnumeration.next(Unknown Source)
    at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
    at sun.misc.CompoundEnumeration.next(Unknown Source)
    at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
    at sun.misc.Service$LazyIterator.hasNext(Unknown Source)
    at
javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown
Source)
    at javax.imageio.spi.IIORegistry.<init>(Unknown Source)
    at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
    at javax.imageio.ImageIO.<clinit>(Unknown Source)

...

this snippet of code seem so be the source of the problem 
why is this an illegal URL? 

class ExtensionManager extends URLStreamHandler implements Content 
{ 
    // The private instance that is added to Felix.class.getClassLoader() - 
    // will be null if extension bundles are not supported (i.e., we are not 
    // loaded by an instance of URLClassLoader) 
    static final ExtensionManager m_extensionManager; 

    static 
    { 
        // pre-init the url sub-system as otherwise we don't work on gnu/classpath 
        ExtensionManager extensionManager = new ExtensionManager(); 
        try 
        { 
            (new URL("http://felix.extensions:9/")).openConnection(); 
        } 
        catch (Throwable t) 

In the end, Sylvain RIBEYRON did find this fix:

Hi all. 

I've had the same issue running Felix on Web Start. 

I've resolved the issue by patching the ExtensionManager.java. 

At line 510, replace the line: 

throw new IOException("Resource not provided by any extension!"); 

By the following code: 

        // JDK6u24 issue 
        return new URLConnection(url) { 
@Override 
public void connect() throws IOException { 
throw new IOException("Resource not provided by any extension!"); 
} 
}; 
        // End JDK6u24 issue 

The issue occurs when looking up classes, because IOException is thrown on URL.openConnection when classes (or resources) are not found. The IOException should not be thrown on the openConnection method, but later on the connect method on URLConnection (this streamHandler should work as any other http handler: when a file does not exist, the http server sends a 404 response. This response can only occur when URLconnection is established, not when URLConnection is initialized). 

  was:See FELIX-2780.


> java6 update 24 breaks felix when used inside webstart
> ------------------------------------------------------
>
>                 Key: FELIX-2877
>                 URL: https://issues.apache.org/jira/browse/FELIX-2877
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: java6 update24
>            Reporter: Karl Pauls
>            Assignee: Karl Pauls
>             Fix For: framework-3.2.0
>
>
> The problem was reported on FELIX-2780 but is an issue in its own right. From the comments:
> ... this exception is what I
> got due to update 24.
> This happens in static code inside javax.imageio.ImageIO when its trying to
> load the image handlers.
> Caused by: java.lang.SecurityException: Permission denied:
> http://felix.extensions:9/META-INF/services/javax.imageio.spi.ImageInputStreamSpi
>     at
> com.sun.deploy.security.DeployURLClassPath$UrlLoader.findResource(Unknown
> Source)
>     at com.sun.deploy.security.DeployURLClassPath$1.next(Unknown Source)
>     at com.sun.deploy.security.DeployURLClassPath$1.hasMoreElements(Unknown
> Source)
>     at java.net.URLClassLoader$3$1.run(Unknown Source)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader$3.next(Unknown Source)
>     at java.net.URLClassLoader$3.hasMoreElements(Unknown Source)
>     at sun.misc.CompoundEnumeration.next(Unknown Source)
>     at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
>     at sun.misc.CompoundEnumeration.next(Unknown Source)
>     at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
>     at sun.misc.Service$LazyIterator.hasNext(Unknown Source)
>     at
> javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown
> Source)
>     at javax.imageio.spi.IIORegistry.<init>(Unknown Source)
>     at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
>     at javax.imageio.ImageIO.<clinit>(Unknown Source)
> ...
> this snippet of code seem so be the source of the problem 
> why is this an illegal URL? 
> class ExtensionManager extends URLStreamHandler implements Content 
> { 
>     // The private instance that is added to Felix.class.getClassLoader() - 
>     // will be null if extension bundles are not supported (i.e., we are not 
>     // loaded by an instance of URLClassLoader) 
>     static final ExtensionManager m_extensionManager; 
>     static 
>     { 
>         // pre-init the url sub-system as otherwise we don't work on gnu/classpath 
>         ExtensionManager extensionManager = new ExtensionManager(); 
>         try 
>         { 
>             (new URL("http://felix.extensions:9/")).openConnection(); 
>         } 
>         catch (Throwable t) 
> In the end, Sylvain RIBEYRON did find this fix:
> Hi all. 
> I've had the same issue running Felix on Web Start. 
> I've resolved the issue by patching the ExtensionManager.java. 
> At line 510, replace the line: 
> throw new IOException("Resource not provided by any extension!"); 
> By the following code: 
>         // JDK6u24 issue 
>         return new URLConnection(url) { 
> @Override 
> public void connect() throws IOException { 
> throw new IOException("Resource not provided by any extension!"); 
> } 
> }; 
>         // End JDK6u24 issue 
> The issue occurs when looking up classes, because IOException is thrown on URL.openConnection when classes (or resources) are not found. The IOException should not be thrown on the openConnection method, but later on the connect method on URLConnection (this streamHandler should work as any other http handler: when a file does not exist, the http server sends a 404 response. This response can only occur when URLconnection is established, not when URLConnection is initialized). 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira