Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to access jarfile
#1
I had a java application which was testing servers.
We are migrating to python, and for a start we are making use of the jar from the java application.
I use the jar in my python script, and call the

subprocess.call(
    ['java', '-jar', 'XYZ.jar', '-url', 'opc.tcp://localhost:XXXX', '-check', 'AB', '-specVersion', '2.0', '-test', 'testclient.TestGeneral'])
This works perfect!
However, we plan to have a clear structure by using classes(OOP).

So I make some modifications and I write the below

`
class TestClient:

    def performTest(self):

        subprocess.call(['java', '-jar', 'XYZ.jar', '-url', 'opc.tcp://localhost:XXXX', '-check', 'AB', '-specVersion', '2.0', '-test', 'testclient.TestGeneral'])


if __name__ == "__main__":
    client = TestClient()
    client.performTest()
`

I get an error saying

`
Error:
Error: Unable to access jarfile XYZ.jar
`

How is it that the jar becomes unaccesable? Am i missing something here? Please let me know
Reply


Messages In This Thread
Unable to access jarfile - by Rakshan - Jul-27-2021, 11:48 AM
RE: Unable to access jarfile - by DeaD_EyE - Jul-27-2021, 01:20 PM
RE: Unable to access jarfile - by Rakshan - Jul-28-2021, 11:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to access the user input value given to daterangepicker klllmmm 1 2,269 May-26-2021, 09:16 PM
Last Post: nilamo
  Unable to read update access DB saaketh 1 1,939 Sep-24-2019, 11:37 AM
Last Post: Malt
  Passing Values of Dictionaries to Function & Unable to Access Them firebird 3 2,533 Aug-03-2019, 10:25 PM
Last Post: firebird

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020