2

I am trying to test some API's using jbehave. While trying to configure my Jbehave stories i am running into the following error (attached below): I even tried using --illegal-access=permit. I used the command java -cp out com.example.prederiq.PrederaAiq.StoryConfiguration (where com.example.prederiq.PrederaAiq is my package name and StoryConfiguration is my class name that i want to configure) on my windows command prompt but it threw a classNotFoundException. i even navigated to the folder where my Configuration file is present using cd ubuntu commands and tried to use this command but it still did not work.

Full error

My StoryConfiguration class:

public class StoryConfiguration extends JUnitStories {

    @Override
    public Configuration configuration() {
        return new MostUsefulConfiguration().useStoryLoader(new LoadFromClasspath(this.getClass())).useStoryReporterBuilder(new StoryReporterBuilder().withCodeLocation(CodeLocations.codeLocationFromClass(this.getClass())).withDefaultFormats().withFormats(StoryReporterBuilder.Format.CONSOLE, StoryReporterBuilder.Format.HTML));
    }

    @Override
    public InjectableStepsFactory stepsFactory() {
        return new InstanceStepsFactory(configuration(),new PrederaAiqApplicationTests());
    }

    @Override
    public List<String> storyPaths() {
       return Arrays.asList("com/example/prederiq/PrederaAiq/test.story");
    }
}
James Z
  • 12,209
  • 10
  • 24
  • 44
abzd
  • 41
  • 1
  • 10
  • Does this answer your question? [How to solve InaccessibleObjectException ("Unable to make {member} accessible: module {A} does not 'opens {package}' to {B}") on Java 9?](https://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m) – Christopher Schneider Jun 21 '21 at 21:12
  • I am finding it very hard to understand and I'm confused on what to do in my case. Can you give me a step to step explanation on how i should go about this if you do not mind please. i am a beginner so i am sorry that you've to bear with me – abzd Jun 21 '21 at 23:25
  • https://jbehave.atlassian.net/browse/JBEHAVE-1479 - the issue is fixed, but not released yet – VaL Jun 22 '21 at 07:59
  • if i am using the java --add-opens commands, what should my parameters be in this case?? – abzd Jun 22 '21 at 16:53
  • which approach should i use in my case i am confused. And what parameters should i use for my respective approaches – abzd Jun 22 '21 at 17:05

0 Answers0