Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalAccessError: tried to access field when i try to run junit test #102

Closed
prat23k opened this issue Sep 7, 2016 · 6 comments

Comments

@prat23k
Copy link

prat23k commented Sep 7, 2016

Hi,
I have migrated my automation framework from thucydides to serenity, when i run the tests from the maven working fine but when i try to run test from junit test ,giving below error

java.lang.IllegalAccessError: tried to access field org.jbehave.core.embedder.Embedder.embedderMonitor from class net.serenitybdd.jbehave.embedders.ExtendedEmbedder
at net.serenitybdd.jbehave.embedders.ExtendedEmbedder.(ExtendedEmbedder.java:28)
at net.serenitybdd.jbehave.runners.SerenityReportingRunner.(SerenityReportingRunner.java:79)
at net.serenitybdd.jbehave.runners.SerenityReportingRunner.(SerenityReportingRunner.java:73)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:84)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:70)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

@wakaleo
Copy link
Member

wakaleo commented Sep 7, 2016

This looks like a dependency conflict with JBehave - check that your version of JBehave is the same as the one used by Serenity.

@prat23k
Copy link
Author

prat23k commented Sep 7, 2016

Thank you for quick reply i am using serenity jbehave,
net.serenity-bdd
serenity-jbehave
${serenity.jbehave.version}

@wakaleo
Copy link
Member

wakaleo commented Sep 7, 2016

What version of jbehave (not serenity-jbehave) are you using?

@prat23k
Copy link
Author

prat23k commented Sep 7, 2016

jbehave-core 4.0.5 i am using

@wakaleo
Copy link
Member

wakaleo commented Sep 7, 2016

The versions are OK, and the code should work. Could be a Maven repo/caching/dependency conflic issue. If you can create a sample project that reproduces the issue we can take a look.

@prat23k
Copy link
Author

prat23k commented Sep 8, 2016

Thank you for your help,i created a sample project with above mentioned versions it looks ok ,and another observation if i extend test to SerenityStories then only i could see this issue.

@wakaleo wakaleo closed this as completed Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants