OpenLiberty / liberty-tools-vscode

Visual Studio Code extension for Liberty Tools
https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext
Eclipse Public License 2.0
17 stars 34 forks source link

SVT: Application start from VSCode Liberty Dashboard fails reporting Access is denied #300

Closed hanczaryk closed 10 months ago

hanczaryk commented 11 months ago

SVT: Application start from VSCode Liberty Dashboard fails reporting Access is denied

On my Windows 11 laptop, I've installed VSCode 1.83.1 with the 10/21 liberty-dev-vscode-ext-23.0.12-SNAPSHOT.vsix extension from box folder installed.

I installed maven 3.9.5 on my laptop. Under the Liberty Dashboard, I right clicked my application, MPProShop, and clicked 'Start' but the application failed with the following message reported in the Terminal.

PS C:\Users\XXXXXXX\git\MPProShop> mvn io.openliberty.tools:liberty-maven-plugin:dev -f "c:\Users\XXXXXXX\git\MPProShop\pom.xml"
Program 'mvn.cmd' failed to run: Access is deniedAt line:1 char:1
+ mvn io.openliberty.tools:liberty-maven-plugin:dev -f "c:\Users\XXXXX ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ mvn io.openliberty.tools:liberty-maven-plugin:dev -f "c:\Users\XXXXX ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

image

cherylking commented 11 months ago

@hanczaryk Two requests:

1) Try with Maven 3.9.2 and see if it still happens. 2) Run with -X and put the details in a Box folder for us to see the details of the exception. I think it is complaining about the pom.xml itself, but cannot tell with the images provided.

hanczaryk commented 11 months ago

First, in my Windows command prompt, the command mvn io.openliberty.tools:liberty-maven-plugin:dev -f "C:/Users/XXXXXX/git/MPProShop/pom.xml" executes successfully.

Then, my attempt to execute using Maven 3.9.2 yielded the same error.

The java version is as follows

java version "17.0.6" 2023-01-17
IBM Semeru Runtime Certified Edition 17.0.6.0 (build 17.0.6+10)
Eclipse OpenJ9 VM 17.0.6.0 (build openj9-0.36.0, JRE 17 Windows 11 amd64-64-Bit Compressed References 20230117_329 (JIT enabled, AOT enabled)
OpenJ9   - e68fb241f
OMR      - f491bbf6f
JCL      - e248569a781 based on jdk-17.0.6+10)
hanczaryk commented 11 months ago

The Start... prompted the following where I added -X but I got the same failure, just with the -X flag.

PS C:\Users\XXX\git\MPProShop> mvn io.openliberty.tools:liberty-maven-plugin:dev -X -f "c:\Users\XXX\git\MPProShop\pom.xml"
Program 'mvn.cmd' failed to run: Access is deniedAt line:1 char:1
+ mvn io.openliberty.tools:liberty-maven-plugin:dev -X -f "c:\Users\XXX ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ mvn io.openliberty.tools:liberty-maven-plugin:dev -X -f "c:\Users\XXX ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed
cherylking commented 11 months ago

Possible solution (provided by Scott Kurz): https://stackoverflow.com/a/73700326/1499766

hanczaryk commented 11 months ago

I was able to change the Default Profile from PowerShell to CMD using VSCode 'Select Default Profile' as shown in the screenshot below. image

After making that change, I was able to successfully use Liberty Dashboard to start the MPProShop application. image

TrevCraw commented 11 months ago

TODO: Add this scenario to https://github.com/OpenLiberty/liberty-tools-vscode/wiki/Common-Issues

hanczaryk commented 11 months ago

Given that this issue will be added to common issues and I'm able to successfully use CMD, I can probably close this issue. I'll wait for confirmation from dev before I close.

hanczaryk commented 11 months ago

I added bug back as a label because SVT issues are tracked using SVT and bug labels. I agree that documenting this to common issues is sufficient and that no code change is required.

TrevCraw commented 10 months ago

Added to wiki page here: https://github.com/OpenLiberty/liberty-tools-vscode/wiki/Common-Issues