Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

FAQ and Troubleshooting

baev edited this page Sep 11, 2014 · 38 revisions

Java heap space related to org.aspectj.weaver.*

You can see the following stacktrace:

java.lang.OutOfMemoryError: Java heap space

at java.util.HashMap.createEntry(HashMap.java:869) at java.util.HashMap.addEntry(HashMap.java:856) at java.util.HashMap.put(HashMap.java:484) at java.util.HashSet.add(HashSet.java:217) at org.aspectj.apache.bcel.generic.InstructionHandle.addTargeter(InstructionHandle.java:161) at org.aspectj.apache.bcel.generic.MethodGen.(MethodGen.java:300) at org.aspectj.weaver.bcel.LazyMethodGen.initialize(LazyMethodGen.java:366) at org.aspectj.weaver.bcel.LazyMethodGen.markAsChanged(LazyMethodGen.java:534) at org.aspectj.weaver.bcel.LazyMethodGen.getBody(LazyMethodGen.java:924) at org.aspectj.weaver.bcel.BcelShadow.makeShadowForMethod(BcelShadow.java:679) at org.aspectj.weaver.bcel.BcelShadow.makeMethodExecution(BcelShadow.java:675) at org.aspectj.weaver.bcel.BcelShadow.makeMethodExecution(BcelShadow.java:655) at org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:2618) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:481) at org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:101) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1691) at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1635) at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1400) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1186)

**Solution**: add the following content to **resources/META-INF/aop.xml**:
```xml
<aspectj>
    <weaver options="">
        <include within="{mask for your classes package, 
'ru.yandex.qatools.allure.*' as example}"/>
    </weaver>
</aspectj>

See http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html for more details.

Allure CLI: java.lang.RuntimeException: java.lang.IllegalArgumentException: Parameter 'directory' is not a directory

You should specify path to directory containing XML files and not to XML files directly.

Solution: make sure you launch CLI like the following:

$ allure /path/to/directory/with/xml/files # CLI 2.0+

XML files created but no steps, attachments and parameters are present (mainly Java issue)

You didn't specify -javaagent JVM argument which is mandatory when working with steps, attachments and parameters because we're using AspectJ to process them.

Solution:: make sure the JVM is being launched with -javaagent path/to/aspectj-weaver.jar. See example on how this is done with Maven.

XML files are successfully created during test run but no HTML report is then generated

This is mainly caused by incompatible versions of Allure adapter and report generator tool (CLI, Maven plugin, etc.). Versions 1.3.x and 1.4.x of Allure are using incompatible XML formats.

Solution: check that Allure adapter versions equals to Allure report generator version. E.g. if you're using command line tool 1.3.9 then your Allure adapter version should also be 1.3.x. We guarantee full compatibility of minor versions (1.3.1 is compatible to 1.3.9, but 1.4.0 is not compatible to 1.3.9).

Escaping troubles: seeing &lt; and &gt; in report but should be < and >

Titles and names containing these characters are incorrectly escaped.

Solution: You're probably using outdated JAXB implementation. Check that com.sun.xml.bind:jaxb-impl version 2.2.2 or above is used everywhere in your project.

I see nothing when opening report page in my browser \ "Access denied" message

That means that report data failed to load. Possible solutions:

  • When opening report from the local file either open it in Firefox or launch Chrome with --allow-file-access-from-files flag. For other browsers you need to enable cross origin requests to local files.
  • Upload report to web server and open it from there
  • If you get 404 error from remote server then check logs in order to verify that report was built successfully
  • If you still experience problems please email us Debug section contents and we'll help you to resolve the problem
  • If your test framework is JUnit - check that you're using version 4. Allure is incompatible with version 3 of JUnit and that's why no data is gathered from tests.

"Error getting reports from the plugin..." during Maven build

When running Maven build with Allure Maven Plugin you can see the following error:

[INFO] Error getting reports from the plugin 'ru.yandex.qatools.allure:allure-maven-plugin:1.3.7': Unable to load the mojo 'ru.yandex.qatools.allure:allure-maven-plugin:1.3.7:report' in the plugin 'ru.yandex.qatools.allure:allure-maven-plugin'. A required class is missing: Lorg/apache/maven/plugin/BuildPluginManager; org.apache.maven.plugin.BuildPluginManager

> **Solution:** you need to use Maven version 3.

#### Unsupported major.minor version 51.0
> This error can happen when trying to use any Allure code including examples:
> ```
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project allure-testng-example: Execution default-test of goal org.apache.maven.plugins:maven surefire-plugin:2.16:test failed: There was an error in the forked process
[ERROR] java.lang.UnsupportedClassVersionError: ru/yandex/qatools/allure/testng/AllureTestListener : Unsupported major.minor version 51.0
[ERROR] at java.lang.ClassLoader.defineClass1(Native Method)
[ERROR] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
[ERROR] at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
[ERROR] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

Solution: you need to use Java 1.7+.

java.lang.NoClassDefFoundError: org/apache/commons/io/Charsets

This error happens when you're using Apache Commons IO library in your project and your version is below 2.4.

java.lang.NoClassDefFoundError: org/apache/commons/io/Charsets at ru.yandex.qatools.allure.utils.AllureResultsUtils.writeAttachment(AllureResultsUtils.java:95) at ru.yandex.qatools.allure.utils.AllureResultsUtils.writeAttachment(AllureResultsUtils.java:86) at ru.yandex.qatools.allure.events.MakeAttachEvent.process(MakeAttachEvent.java:25) at ru.yandex.qatools.allure.events.MakeAttachEvent.process(MakeAttachEvent.java:13) at ru.yandex.qatools.allure.Allure.fire(Allure.java:54) at ru.yandex.qatools.allure.aspects.AllureAttachAspects.attach(AllureAttachAspects.java:35)

> **Solution:** check that Apache Commons IO 2.4+ is used everywhere in your project.