[
http://issues.ops4j.org/jira/browse/PAXRUNNER-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_10978
]
Alin Dreghiciu commented on PAXRUNNER-85:
-----------------------------------------
Related to your remark about the Warning: this cannot be done as the url
setting/handling is core for pax runner. So, f I do not set the url stream
handler factory you would not be able to use the mvn: urls' (just the standard
ones (file/http/zip)
But, I implemented as explained by Stuart above and I think this will solve
your case, so please give it a try.
Yet, is not 100% solved correctly as I do set but I do not reset back to the
original handler, so this may cause unforeseen problems (I still delegate to
the original handler but after runner stops the factory remains set).
This case (reset) will be solved in a more generic way as I plan to implement a
shutdown phase of the frameworks/runner (right now I just kill the launched
framework and exit)
> Handle cases where a URLStreamHandlerFactory is already installed
> -----------------------------------------------------------------
>
> Key: PAXRUNNER-85
> URL: http://issues.ops4j.org/jira/browse/PAXRUNNER-85
> Project: Pax Runner
> Issue Type: Improvement
> Components: handler
> Affects Versions: 0.5.5
> Reporter: Stuart McCulloch
> Assignee: Alin Dreghiciu
> Fix For: 0.5.6
>
>
> As reported by Hendy: when provisioning using NetBeans, an exception occurs
> because NB has already installed its own URLStreamHandlerFactory:
> java.lang.Error: factory already defined
> at java.net.URL.setURLStreamHandlerFactory(URL.java:1076)
> at
> org.ops4j.pax.runner.handler.internal.URLStreamHandlerExtender.start
> (URLStreamHandlerExtender.java:67)
> at
> org.ops4j.pax.runner.handler.internal.Activator.start(Activator.java:66)
> at org.ops4j.pax.runner.Run.createActivator(Run.java:405)
> at org.ops4j.pax.runner.Run.installHandlers (Run.java:175)
> at org.ops4j.pax.runner.Run.start(Run.java:134)
> at org.ops4j.pax.runner.Run.main(Run.java:481)
> Quick fix is to catch this exception and simply continue (although this will
> definitely limit the available functionality) - a better solution, which is
> used in several applications, is to use reflection to forcibly update the
> URLStreamHandlerFactory with the Pax-Runner factory and delegate to the
> original factory for unknown protocols...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.ops4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general