On Thu, Mar 3, 2011 at 7:00 PM, Reuben Pasquini <reu...@frickjack.com> wrote:
> Here's an ExtensionManager patch that got me back in business with webstart
>
> (don't know what's up with the sun.org.moz... import in Felix.java):
>
> ---------------------
>
> C:\Users\pasquini\Documents\Code\felix-framework
>> svn diff -x -w
> Index: src/main/java/org/apache/felix/framework/Felix.java
> ===================================================================
> --- src/main/java/org/apache/felix/framework/Felix.java (revision 1076687)
> +++ src/main/java/org/apache/felix/framework/Felix.java (working copy)
> @@ -75,8 +75,8 @@
>  import org.osgi.framework.hooks.service.ListenerHook;
>  import org.osgi.service.packageadmin.ExportedPackage;
>  import org.osgi.service.startlevel.StartLevel;
> -import sun.org.mozilla.javascript.internal.UintMap;
>
> +
>  public class Felix extends BundleImpl implements Framework
>  {
>      // The secure action used to do privileged calls
> Index: src/main/java/org/apache/felix/framework/ExtensionManager.java
> ===================================================================
> --- src/main/java/org/apache/felix/framework/ExtensionManager.java
> (revision 1076687)
> +++ src/main/java/org/apache/felix/framework/ExtensionManager.java
> (working copy)
> @@ -87,6 +87,10 @@
>
>      static
>      {
> +        // Allow system-property based disable of ExtensionManager.
> +        // Adding http://felix.extension:9 to the class path causes
> problems
> +        // in webstart which enforces a "single origin" policy as of jre 6
> update 24.
> +        if( System.getProperty( "felix.extensions.enabled", "true"
> ).equalsIgnoreCase( "true" ) ) {
>          // pre-init the url sub-system as otherwise we don't work on
> gnu/classpath
>          ExtensionManager extensionManager = new ExtensionManager();
>          try
> @@ -113,7 +117,10 @@
>              extensionManager = null;
>          }
>          m_extensionManager = extensionManager;
> +        } else {
> +            m_extensionManager = null;
>      }
> +    }
>
>      private final Logger m_logger;
>      private final Map m_headerMap = new StringMap(false);
>
> ---------------------------
>
>
>
> Then add
>
>            <property name="felix.extensions.enabled" value="false" />
> in the .jnlp <resources> block, and I'm back in business.
>
> Thanks for pointing me in the right direction.
>
> Hope something like this makes it into the  next release ... ?

It will - unless i figure out what is going on and find a real fix.

regards,

Karl


>
> Cheers,
>
> Reuben
>
>
>
> On Thu, Mar 3, 2011 at 10:52 AM, Reuben Pasquini <reu...@frickjack.com>
> wrote:
>>
>> I agree it sounds like an Oracle bug, but a workaround would be great.
>>
>> A config parameter that disables extension bundles works for me too.
>>
>> I embed felix in a very limitted way to manage the startup/shutdown
>> lifecycle
>>
>> via BundleActivators, so I don't think my apps will miss the extension
>> bundles.
>>
>> Let me know when you have a patch checked in, and I'll give it a try ...
>>
>> or if you think it's a small change, then point me at the right part of
>> the felix
>>
>> repo, and I'll try to throw together a patch for you.
>>
>> Thanks for the help!
>>
>>
>>
>> Cheers,
>>
>> Reuben
>>
>> On Thu, Mar 3, 2011 at 3:16 AM, Karl Pauls <karlpa...@gmail.com> wrote:
>>>
>>> On Thu, Mar 3, 2011 at 10:08 AM, Bauersachs Ingo
>>> <ingo.bauersa...@fhnw.ch> wrote:
>>> >> Problem is this doesn't make sense to me as the app has allpermission
>>> >> (or sets the security manager to null even). Why enforce this then? It
>>> >> sounds like a bug (and there are several at oracle by now). Lets see
>>> >> what they do
>>> >
>>> > Indeed, this makes no sense.
>>> >
>>> >> I'll try to find a workaround on the weekend and if
>>> >> not, I'll probably add a property to disable extension bundles (which
>>> >> would make the url go away - only extension bundles will not work).
>>> >
>>> > 6u24 is out and I needed a workaround fast. Changing the extension url
>>> > from http to file seems to satisfy the same origin policy. If my change
>>> > doesn't cause other side-effects it might even be a permanent solution. (I
>>> > have far to less experience with OSGi/Felix to really comment on this)
>>>
>>> If it works for you it is ok for now - it is not the permanent
>>> solution as there will be other issues (there is a reason we do what
>>> we do there - related to extension bundles). But if i can't find
>>> something better the solution will be close (i.e., provide a way to
>>> disable extension bundles -> don't register this url at all).
>>>
>>> regards,
>>>
>>> Karl
>>>
>>>
>>> > Regards,
>>> > Ingo
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>>> > For additional commands, e-mail: users-h...@felix.apache.org
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Karl Pauls
>>> karlpa...@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>>> For additional commands, e-mail: users-h...@felix.apache.org
>>>
>>
>
>



-- 
Karl Pauls
karlpa...@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to