-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 class is not being called in executable jar #1660
Labels
Comments
tagging this as |
@rohit1212s are you sure you uploaded the right zip file ? your instructions don't match what I am seeing. please try again |
Hi Peter,
Thanks for your quick turnaround. I resolved the issue yesterday night
itself. The method which was throwing an exception I put in the try-catch
block then it started working again. But the only weird thing was that it
throws an exception when it runs from a jar file but if I run it with maven
test or from the Junit or from feature then it doesn't throw any exception.
Only if I run from the jar then only it throws an exception. Though your
help was much appreciated. without your help I could not have created the
jar file. Thanks a ton!
Thanks and Regards,
Rohit Kumar
…On Wed, Jun 23, 2021 at 8:22 PM Peter Thomas ***@***.***> wrote:
@rohit1212s <https://github.com/rohit1212s> are you sure you uploaded the
right zip file ? your instructions don't match what I am seeing. please try
again
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1660 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJYEKQ47VK3M36DNCHMTCVDTUIQ65ANCNFSM47EEYXIQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When we use executable jar and run the feature file then the java class which we called from different package inside the feature file is not getting executed and giving below error:-
I have attached a sample jar file which demonstrates this behaviour directly (i.e. by showing the content is empty when run from a jar)
Instructions.
unzip the karate-sample.zip jar file and open up the project in your ide.
Run the file TestApplication as a java app in the IDE.
The output of the test will indicate content:
19:27:29.878 [main] INFO com.intuit.karate - [print] Request body---> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
SOAP-ENV:Header/
SOAP-ENV:Body
<ns3:GetShareholderMeetingRequest xmlns="http://syntel.nl/Epos/Common/ServiceContext" xmlns:ns2="http://www.able.eu/Epos/Common/SharedObjects" xmlns:ns3="http://syntel.nl/Epos/Custody/GetShareholderMeeting/Request">
2b14dd4f29ea8ba6
2
nl
RK88YA
1234
abcdef
ns3:shareholderMeeting
ns3:id12345</ns3:id>
</ns3:shareholderMeeting>
</ns3:GetShareholderMeetingRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
19:27:30.617 [main] INFO com.intuit.karate - [print]
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
SOAP-ENV:Header/
SOAP-ENV:Body
SOAP-ENV:Fault
SOAP-ENV:Server
An unexpected error occurred
<ns2:faultResponseMessage xmlns:ns2="http://syntel.nl/Epos/Common">
ns2:responses
ns2:response
ns2:code5054</ns2:code>
ns2:domainGetInternalIdByExternalId</ns2:domain>
ns2:parameter
ns2:descriptionEPOS Version</ns2:description>
ns2:id-1</ns2:id>
ns2:value08.03.04.00</ns2:value>
</ns2:parameter>
ns2:parameter
ns2:descriptionEPOS RequestID</ns2:description>
ns2:id-2</ns2:id>
ns2:valuedc2d8bf0-5bde-446a-9b40-d67a934c334b</ns2:value>
</ns2:parameter>
ns2:parameter
ns2:descriptionConversationID</ns2:description>
ns2:id-3</ns2:id>
ns2:value2b14dd4f29ea8ba6</ns2:value>
</ns2:parameter>
ns2:serviceAuthorisationLogDA</ns2:service>
ns2:severityERROR</ns2:severity>
ns2:shortDescriptionInvalid ExternalIdentificationId: abcdef for type: EXTERNAL_1</ns2:shortDescription>
</ns2:response>
</ns2:responses>
ns2:version8030400</ns2:version>
</ns2:faultResponseMessage>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
feature: src/main/resources/features/Test2.feature
scenarios: 1 | passed: 1 | failed: 0 | time: 3,3617
19:27:31.622 [main] INFO com.intuit.karate.Suite - <> feature 1 of 1 (0 remaining) src/main/resources/features/Test2.feature
Karate version: 1.0.1
elapsed: 8,86 | threads: 1 | thread time: 3,36
features: 1 | skipped: 0 | efficiency: 0,38
scenarios: 1 | passed: 1 | failed: 0
[======================================================]
Now run the maven clean install
karate-sample.zip
build, this will build out an executable jar called: sample-test-jar-with-dependencies.jar
Run this as a java jar file: java -Depos.environment=testbe2 -Depos.version=320 -Dkarate.env=develop
ment -jar target\sample-test-jar-with-dependencies.jar
The output of the test now is :
karate-sample.zip
The text was updated successfully, but these errors were encountered: