[ 
https://issues.apache.org/jira/browse/FELIX-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708994#action_12708994
 ] 

Martin Zdila commented on FELIX-1032:
-------------------------------------

The application has currently 158 bundles.
Currently I can reproduce the exception updating one bundle(A) several times. 
The bundle(A) scans on it's activation all ACTIVE bundle(B)s and searches for 
the /web-resources directory in them. After couple of the bundle(A) updates 
(cca 3 and more) I get incorrect behaviour. Suprisingly, it is different on 
different JVMs(!):

1. Sun Java:
URLConnection conn = bundleB.getEntry("web-resources/").openConnection(); 
conn.getInputStream() throws forementioned exception. The cause is very 
strange. I observed, that Inflater.ensureOpen is called after the Inflater is 
actually finalized!!! That's very weird and looks like a bug in the JVM :-O. 
The immediate subsequent call and further calls to conn.getInputStream() are 
successful. So the ugly bugfix is to retry the call once more after it throws 
NPE ;-).

2. OpenJDK:
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu7)
OpenJDK Client VM (build 14.0-b08, mixed mode, sharing)

bundleB.getEntry("web-resources/").openConnection().getInputStream() returns 
null. Not for each bundle, but for random bundles, different on each bundle (A) 
update. This is true if using OpenJDK:

Also note that I am using spring-osgi. I can create a vnc connection to my 
machine if it helps and I can assist you with the bug reproduction. Thanks for 
the interest.

> NPE on URL#openStream()
> -----------------------
>
>                 Key: FELIX-1032
>                 URL: https://issues.apache.org/jira/browse/FELIX-1032
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-1.4.1, felix-1.6.0
>         Environment: Linux bono 2.6.28-6-generic #17-Ubuntu SMP Fri Jan 30 
> 15:34:36 UTC 2009 i686 GNU/Linux
> java version "1.6.0_13"
> Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
> Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
>            Reporter: Martin Zdila
>            Priority: Critical
>
> Note that also affected is felix-1.6.0 (it is not in the list).
> I am often getting NPE with the following code:
> new URL("bundle://66.0:0/somewhere/my.resource" /* or any other bundle:// URL 
> */).openStream();
> java.lang.NullPointerException
>       at java.util.zip.Inflater.ensureOpen(Inflater.java:336)
>       at java.util.zip.Inflater.getBytesWritten(Inflater.java:296)
>       at java.util.zip.ZipFile$1.available(ZipFile.java:243)
>       at 
> org.apache.felix.framework.URLHandlersBundleURLConnection.connect(URLHandlersBundleURLConnection.java:125)
>       at 
> org.apache.felix.framework.URLHandlersBundleURLConnection.getInputStream(URLHandlersBundleURLConnection.java:134)
>       at java.net.URL.openStream(URL.java:1009)
> It is not allways reproducible. The first call causes the NPE and the second 
> call with the same URL string goes without problems.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to