On 05/28/2009 03:15 PM, Ted Stockwell wrote:
I did some googling and found the source code for 
org.jdesktop.jdic.init.JdicManager online.
I notice that it does this in the initShareNative method....

binaryPath = (new 
URL(JdicManager.class.getProtectionDomain().getCodeSource().getLocation(), 
".")).openConnection().getPermission().getName();

Karl and I talked about this. It appears that this code assumes it can use this hack to get the the path to the JAR file. This is clearly a hack and will not always work as is witnessed here.

The URL associated with a code source does not necessarily have to be the URL to the JAR. In the case of OSGi, the location is not spec'ed to be a URL to the JAR. Further, since the framework caches the installed bundle, there is no guarantee the URL need to point to anything or the same JAR that the framework has cached.

The above code will not work in Felix as-is since the associated protection 
domain has a fudged URL set by Felix.

It has little to do with that. It has to do with the code above making faulty assumptions.

-> richard

I think it would be possible to make Felix create a working ProtectionDomain 
for most bundles (though not for the system bundle).


--- On Thu, 5/28/09, Triquoit Mathieu<mathieu.triqu...@gmail.com>  wrote:

From: Triquoit Mathieu<mathieu.triqu...@gmail.com>
Subject: java.io.IOException: FakeURLStreamHandler can not be used!
To: users@felix.apache.org
Date: Thursday, May 28, 2009, 7:46 AM
Hello,

I am using jdic in a module to create an email (by example
with Outlook)...
When the code to create the mail is reached, I have the
following exception
:

org.jdesktop.jdic.init.JdicInitException:
java.io.IOException:
FakeURLStreamHandler can not be used!
         at
org.jdesktop.jdic.init.JdicManager.initShareNative(Unknown
Source)
         at
org.jdesktop.jdic.desktop.internal.ServiceManager.<clinit>(Unknown
Source)
         at
org.jdesktop.jdic.desktop.Desktop.mail(Unknown Source)
         at
eu.europa.ec.taxud.eforms.editor.gui.EFormFrame.sendMailImpl(EFormFrame.java:550)
         at
eu.europa.ec.taxud.eforms.editor.gui.EFormFrame.sendMail(EFormFrame.java:516)
         at
eu.europa.ec.taxud.eforms.editor.gui.EFormFrame$3$1.run(EFormFrame.java:421)
         at
java.awt.event.InvocationEvent.dispatch(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)
Caused by: java.io.IOException: FakeURLStreamHandler can
not be used!
         at
org.apache.felix.framework.FakeURLStreamHandler.openConnection(FakeURLStreamHandler.java:39)
         at
java.net.URL.openConnection(Unknown Source)
         ... 14 more
In main loop, we have serious trouble:
java.lang.NullPointerException
In main loop, we have serious trouble:
java.lang.NullPointerException

Do you have any idea ?

Thanks in advance,
Regards,
Mathieu





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

Reply via email to