Carlo de Wolf [
http://community.jboss.org/people/wolfc] created the discussion
"Re: Help, my extension isn't starting"
To view the discussion, visit:
http://community.jboss.org/message/584599#584599
--------------------------------------------------------------
+Why is this such a hassle?+
For that we need to take a look in the JDK source ServiceLoader.java:
public S next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
String cn = nextName;
nextName = null;
try {
S p = service.cast(Class.forName(cn, true, loader)
.newInstance());
providers.put(cn, p);
return p;
} catch (ClassNotFoundException x) {
fail(service,
"Provider " + cn + " not found");
} catch (Throwable x) {
fail(service,
"Provider " + cn + " could not be instantiated: " + x,
x);
}
throw new Error(); // This cannot happen
}
If it encounters a ClassNotFoundException it doesn't emmit which class it can not
find. Also the original exception is swallowed, so any diagnostic information within is
lost.
They got one thing right though: fail. ;-)
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/584599#584599]
Start a new discussion in JBoss AS7 Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]