felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filippo Diotalevi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-1386) Updating fileinstall bundle in watched directory causes IllegalsStateException
Date Wed, 12 Aug 2009 12:45:14 GMT

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

Filippo Diotalevi commented on FELIX-1386:
------------------------------------------

Actually your exception rang a bell; I remember having seeing it a while ago in this situation
1) the fileinstall bundle was in the watched folder
2) the fileinstall bundle had a future system date (it was built in a machine with wrong system
date)

Having a look again into the code, I find now the situation quite clear. 

What happens is simply that FileInstall bundle decides to update itself (because the file
found in the watched directory is apparently new). Nothing wrong in that.

The update works correctly, but just after the update you have a call to the logger (DirectoryWatcher#791).
In turn, it calls
context.getServiceReference(LogService.class.getName());  //DirectoryWatcher#449
In the particular moment when this call happen, the bundle is not yet ready to work (IllegalStateException:
Invalid BundleContext). I remember finding a similar problem, in the Web Console, in FELIX-1003.

I don't know if that's the problem you are experiencing, but your stacktrace confirm it's
really the log() operation
SEVERE: at org.apache.felix.fileinstall.DirectoryWatcher.getLogService(DirectoryWatcher.java:449)

SEVERE: at org.apache.felix.fileinstall.DirectoryWatcher.log(DirectoryWatcher.java:416) 
SEVERE: at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:133) 

Possible workarounds:
- delete the log statement at DirectoryWatcher#791
- Thread.sleep(something) before logging!

wdyt?




> Updating fileinstall bundle in watched directory causes IllegalsStateException
> ------------------------------------------------------------------------------
>
>                 Key: FELIX-1386
>                 URL: https://issues.apache.org/jira/browse/FELIX-1386
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-1.2.0
>         Environment: generic
>            Reporter: Sahoo
>            Assignee: Filippo Diotalevi
>             Fix For: fileinstall-1.4.0
>
>
> In my environment, fileinstall is installed via autostart properties, but it is located
in a directory watched by fileinstall. When I updated fileinstall bundle, I get the following
exception:
> Jul 20, 2009 11:52:04 AM  
> SEVERE: Exception in thread "{felix.fileinstall.poll=5000, felix.fileinstall.bundles.new.start=false,
felix.fileinstall.dir=/space/ss141213/WS/gf/v3.trunk.new/publish/glassfishv3/glassfish/modules/,
felix.fileinstall.debug=1}" 
> Jul 20, 2009 11:52:20 AM  
> SEVERE: java.lang.IllegalStateException: Invalid BundleContext.
> Jul 20, 2009 11:52:20 AM  
> SEVERE:         at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:393)
> Jul 20, 2009 11:52:20 AM  
> SEVERE:         at org.apache.felix.framework.BundleContextImpl.getServiceReference(BundleContextImpl.java:257)
> Jul 20, 2009 11:52:20 AM  
> SEVERE:         at org.apache.felix.fileinstall.DirectoryWatcher.getLogService(DirectoryWatcher.java:449)
> Jul 20, 2009 11:52:20 AM  
> SEVERE:         at org.apache.felix.fileinstall.DirectoryWatcher.log(DirectoryWatcher.java:416)
> Jul 20, 2009 11:52:20 AM  
> SEVERE:         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:133)
> Jul 20, 2009 11:52:04 AM  

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


Mime
View raw message