Bug 1022988 - Out-of-the-box installation: improve UF error message "Could not initialize class ...FileSystemProviders$FileSystemProvidersHolder"
Summary: Out-of-the-box installation: improve UF error message "Could not initialize c...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER5
: 6.0.0
Assignee: Alexandre Porcelli
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-24 12:14 UTC by Geoffrey De Smet
Modified: 2014-08-06 20:19 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:19:33 UTC
Type: Bug


Attachments (Terms of Use)

Description Geoffrey De Smet 2013-10-24 12:14:20 UTC
Problem: the real exception gets eaten because of the static constructors.

When running kie-wb from maciesj zip that works for everyone but me, I get this error message:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.uberfire.java.nio.file.api.FileSystemProviders$FileSystemProvidersHolder
        at org.uberfire.java.nio.file.api.FileSystemProviders.getProvider(FileSystemProviders.java:99)
        at org.uberfire.java.nio.file.api.FileSystemProviders.resolveProvider(FileSystemProviders.java:92)
        at org.uberfire.java.nio.file.FileSystems.newFileSystem(FileSystems.java:117)
        at org.uberfire.java.nio.file.FileSystems.newFileSystem(FileSystems.java:83)
        at org.uberfire.io.impl.AbstractIOService.newFileSystem(AbstractIOService.java:206)
        at org.uberfire.metadata.io.IOServiceIndexedImpl.newFileSystem(IOServiceIndexedImpl.java:123)
        at org.uberfire.backend.server.config.ConfigurationServiceImpl.setup(ConfigurationServiceImpl.java:67)
        ... 79 more

The real exception probably happened in
FileSystemProvidersHolder.buildProviders()
or
FileSystemProvidersHolder.buildProvidersMap()
but that exception got eaten so I am dead in the water to figure out what's wrong on my system (which could be anything from disk space to write permissions to startup speed to ...).

Solution: Don't use static constructors. They are very complex to use correctly (see Java puzzlers on deadlocks with static constructors). PS: IIRC, all static constructors are run in the exact same thread, so synchronized is pointless for a static constructor.

Comment 2 Geoffrey De Smet 2013-10-24 12:29:08 UTC
How to reproduce:

Inside one of the 2 methods of FileSystemProvidersHolder, just add this line:
throw new IllegalStateException("This bug is caused by jack the ripper.");

Then build run kie-wb.war. Notice that not a single error message mentions that jack the ripper did it.

Comment 3 Lukáš Petrovický 2013-10-29 09:19:36 UTC
I do agree that we need to make the code not eat the exception. Debugging these things is very painful.

Comment 4 Alexandre Porcelli 2013-10-30 19:02:43 UTC
Issue fixed and pushed to Uberfire master and 0.3.x branches:

https://github.com/droolsjbpm/uberfire/commit/0f6548af0
https://github.com/droolsjbpm/uberfire/commit/46539438e

Comment 5 Lukáš Petrovický 2013-11-23 21:23:44 UTC
Confirmed fixed in the code.


Note You need to log in before you can comment on or make changes to this bug.