Skip to content

Commit

Permalink
#16 Base Package is shown by the failure analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Paga committed Jan 26, 2017
1 parent 6f301c5 commit 5a97859
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Expand Up @@ -52,7 +52,7 @@ protected <T> T searchAndInstantiateSeiImplementation(Class seiName) throws Boo
implementingClass = webServiceScanner.scanForClassWhichImplementsAndPickFirst(seiName, seiImplementationPackageName);
LOG.info("Found SEI implementing class: '{}'", implementingClass.getName());
} catch (BootStarterCxfException exception) {
throw SeiImplClassNotFoundException.build().setNotFoundClassName(seiName.getName());
throw SeiImplClassNotFoundException.build().setNotFoundClassName(seiName.getName()).setScannedBasePackage(seiImplementationPackageName);
}
return instantiateFromClass(implementingClass);
}
Expand Down Expand Up @@ -91,12 +91,4 @@ private <T> T instantiateFromClass(Class<T> clazz) throws BootStarterCxfExceptio
}
}

protected Class<?> classForName(String className) throws BootStarterCxfException {
try {
return Class.forName(className);
} catch (ClassNotFoundException exception) {
throw new BootStarterCxfException(NO_CLASS_FOUND, exception);
}
}

}
Expand Up @@ -9,7 +9,7 @@
*/
public class SeiImplClassNotFoundException extends BootStarterCxfException {

protected static final String MESSAGE = "The Service Endpoint Interface (SEI) implementing class could´nt be found";
protected static final String MESSAGE = "The Service Endpoint Interface (SEI) implementing class couldn't be found";

public SeiImplClassNotFoundException() {
super(MESSAGE);
Expand All @@ -21,6 +21,8 @@ public static SeiImplClassNotFoundException build() {

private String notFoundClassName;

private String scannedBasePackage;

public String getNotFoundClassName() {
return notFoundClassName;
}
Expand All @@ -29,4 +31,13 @@ public SeiImplClassNotFoundException setNotFoundClassName(String notFoundClassNa
this.notFoundClassName = notFoundClassName;
return this;
}

public SeiImplClassNotFoundException setScannedBasePackage(String scannedBasePackage) {
this.scannedBasePackage = scannedBasePackage;
return this;
}

public String getScannedBasePackage() {
return scannedBasePackage;
}
}
Expand Up @@ -11,10 +11,12 @@
*/
public class SeiImplMissingFailureAnalyzer extends AbstractFailureAnalyzer<SeiImplClassNotFoundException> {

public static final String MESSAGE = "Build a Class that implements your Service Endpoint Interface (SEI): '%s' and is present in a scanned sub-package of: '%s'. ";

@Override
protected FailureAnalysis analyze(Throwable rootFailure, SeiImplClassNotFoundException cause) {
return new FailureAnalysis(SeiImplClassNotFoundException.MESSAGE,
String.format("Build a Class that implements your Service Endpoint Interface (SEI): '%s' and try again!", cause.getNotFoundClassName()), cause);
String.format(MESSAGE, cause.getNotFoundClassName(), cause.getScannedBasePackage()), cause);
}

}

0 comments on commit 5a97859

Please sign in to comment.