0

I just got my allure framework done .. but while generating HTML report with command line I get following error

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>(JaxbAnnotationIntrospector.java:139) at com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector.<init>(JaxbAnnotationIntrospector.java:126) at io.qameta.allure.context.JacksonContext.<init>(JacksonContext.java:24) at io.qameta.allure.ConfigurationBuilder.useDefault(ConfigurationBuilder.java:50) at io.qameta.allure.Commands.createReportConfiguration(Commands.java:158) at io.qameta.allure.Commands.generate(Commands.java:63) at io.qameta.allure.CommandLine.run(CommandLine.java:129) at java.base/java.util.Optional.orElseGet(Optional.java:348) at io.qameta.allure.CommandLine.main(CommandLine.java:72) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlElement at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:533) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:186) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:476) ... 9 more

Command i used -

allure generate --report-dir directory-with-results --clean
java --version
java 9-ea
Java(TM) SE Runtime Environment (build 9-ea+162)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+162, mixed mode)
allure --version
2.0.0
rspec -v
RSpec 3.6
The Rookie
  • 595
  • 9
  • 26
  • 1
    @ZhekaKozlov "Note that you can make all of the above Java EE modules available at run time by specifying the --add-modules java.se.ee option. The java.se.ee module is an aggregate module that includes java.se.ee as well as the above Java EE API modules." I am not sure where do I specify it. I am totally alien to JAVA – The Rookie May 12 '17 at 12:29
  • 2
    If you are totally alien to Java, don't install unreleased versions, i.e. stick to Java 8 for now. ;) That said, since `allure` seems to be a launch script provided by the framework, they should change it depending on which Java version they launch. You might want to open an issue [here](https://github.com/allure-framework/allure2). – Nicolai Parlog May 12 '17 at 13:01

3 Answers3

1

There's no need to downgrade java, there's an easier solution, at least on Linux. So in my case I have java 8 and java 9. By default java 9 is used.

If allure requires java 8, I just run it like that:

$ JAVA_HOME=/usr/lib/jvm/java-8-oracle allure generate

This temporarily switches the java version from 9 to 8 just for this command.

LachoTomov
  • 3,312
  • 30
  • 42
0

So there is no solution as such but as per @Nicolai I downgraded to JAVA 8 and it has fixed the issue.

On how I downgraded follow these simple steps mentioned here

The Rookie
  • 595
  • 9
  • 26
0

there are very simple way to genrated reports via allure. first install allure. allure-pytest 2.6.0 allure-python-commons 2.6.0

then if you unable to genrated the reports then follow below steps.. step -1 (using pytest) pytest test_parameterDemo.py --alluredir=path where you want to save reports.

step -2 allure serve report_path

if still it is showing allure is not command (blah -blah)

then install allure using npm plugin with below command npm install -g allure-commandline --save-dev

then again follow step-2 then one server will start and you can able to see allure reports.

jayesh
  • 3,277
  • 1
  • 18
  • 7