Giter VIP home page Giter VIP logo

An error occurred while instantiating class Tryagain1.sumValidation: Unable to make public Tryagain1.sumValidation() accessible: module Tryagain does not "exports Tryagain1" to module org.testng about testng-eclipse HOT 7 CLOSED

v91negi avatar v91negi commented on July 18, 2024
An error occurred while instantiating class Tryagain1.sumValidation: Unable to make public Tryagain1.sumValidation() accessible: module Tryagain does not "exports Tryagain1" to module org.testng

from testng-eclipse.

Comments (7)

v91negi avatar v91negi commented on July 18, 2024

please suugest for this

from testng-eclipse.

missedone avatar missedone commented on July 18, 2024

do you have the same issue if run the test with build tool like maven or gradle?

from testng-eclipse.

v91negi avatar v91negi commented on July 18, 2024

from testng-eclipse.

krmahadevan avatar krmahadevan commented on July 18, 2024

@missedone -

accessible: module Tryagain does not "exports Tryagain1" to module org.testng

This looks like there is Java modules involved.

@v91negi - Do you have a module-info.java in your project somewhere? What happens when you delete this file and try again?

from testng-eclipse.

v91negi avatar v91negi commented on July 18, 2024

from testng-eclipse.

v91negi avatar v91negi commented on July 18, 2024

Thank you ,after deleting module info file. Issue resolved and test case pass, as below:-

[RemoteTestNG] detected TestNG version 7.7.0
300
160
450
PASSED: Tryagain.files.sumValidationtest.sumofCourses

===============================================
    Default test
    Tests run: 1, Failures: 0, Skips: 0
===============================================


===============================================

Can you share more details about this, why module_info.java causing error?

from testng-eclipse.

krmahadevan avatar krmahadevan commented on July 18, 2024

@v91negi - If you have a module-info.java then it means that you are trying to leverage the modularisation capabilities that JDK9 and above provide. modules are basically a higher level grouping on top of package. Until JDK8 one could group classes into a package and there was no further grouping that was possible. JDK9 introduced the notion of modules wherein you could basically group a bunch of package into module.

I suggest that you read a bit about module so that it clears out the concept. After that the error message should be self explanatory. In a nutshell, you defined a module-info.java and so Java started expecting that you would tell which all packages are to be visible to the outside world (and to TestNG since TestNG also would be part of the outside world). Since nothing was visible and since TestNG is trying to access your packages, Java flags this as a problem.

from testng-eclipse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.