-
Feature Request
-
Resolution: Done
-
Minor
-
1.0.0.Final
-
None
When running the MicroProfile Fault Tolerance TCK there are numerous tests'
deploy methods that have:
@Deployment @ShouldThrowException(DefinitionException.class) public static WebArchive deploy() {...
The current wlp-managed-8.5 container return these as Deployment
Exceptions to the test client which makes the TCK tests fail even if the server
has raised a definition exception.
I have a code patch from an IBM colleague Nathan Mittlestat (whose permission I have to
make this 'issue' and a pull request from on his behalf ) along the lines of:
private void checkForDefinitionExceptions(String applicationName) { String messagesFile = containerConfiguration.getWlpHome() + "/usr/servers/" + containerConfiguration.getServerName() + "/logs/messages.log"; BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(new FileInputStream(messagesFile))); String line; while ((line = br.readLine()) != null) { if (line.contains("CWWKZ0002E: An exception occurred while starting the application " + applicationName + ".") && (line.contains("org.jboss.weld.exceptions.DefinitionException") || line.contains("javax.enterprise.inject.spi.DefinitionException"))) { System.out.println("############DEBUG found CWWKZ0002E for application: " + applicationName); System.out.println(line); throw new DefinitionException(line); } } } catch (IOException e) { System.err.println("Exception while reading messages.log" + e.toString()); e.printStackTrace(); // } catch (FileNotFoundException e) { // System.err.println("Exception while reading messages.log" + e.toString()); // e.printStackTrace(); } finally { try { if (br != null) br.close(); } catch (Exception e) { System.err.println("Exception while closing bufferedreader " + e.toString()); e.printStackTrace(); } } }
This method is called in waitForApplicationTargetState if a wrapping Deployment exception
is observed:
} catch (Exception e) { checkForDefinitionExceptions(applicationName); throw new DeploymentException("Exception while checking application state.", e); }
I will do a PR shortly.
- is related to
-
ARQ-2162 New release for wlp-managed container (with support for multi-app verification before test app deployment)
- Resolved