redhat-developer / vscode-rsp-ui

A unified UI for all RSP servers and RSP server-providers to integrate with
Eclipse Public License 2.0
38 stars 21 forks source link

Publish incremental not copy to correct deploy directory #293

Closed darkpastiurs closed 10 months ago

darkpastiurs commented 1 year ago

Hello, I'm reporting this issue with the plugin, the action Publish Server (Incremental) is not working even though I have configured everything for It. I'm sharing the information about configurations I've made.

Server configuration:

{
  "args.override.boolean": "true",
  "args.program.override.string": "-mp \"c:\\servers-app\\jboss-eap-7.4\\modules\" org.jboss.as.standalone -b localhost --server-config=standalone-full-siap.xml",
  "args.vm.override.string": "\"-Dprogram.name=rsp:JBoss EAP 7.4\" -server -Xms1303m -Xmx1303m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true \"-Dorg.jboss.boot.log.file=c:\\servers-app\\jboss-eap-7.4\\standalone\\log\\boot.log\" \"-Dlogging.configuration=file:c:\\servers-app\\jboss-eap-7.4\\standalone\\configuration\\logging.properties\" \"-Djboss.home.dir=c:\\servers-app\\jboss-eap-7.4\" -Dorg.jboss.logmanager.nocolor=true -Djboss.http.port=\"8080\"",
  "id": "JBoss EAP 7.4",
  "id-set": "true",
  "jboss.server.host": "localhost",
  "jboss.server.port": "8080",
  "org.jboss.tools.rsp.server.typeId": "org.jboss.ide.eclipse.as.eap.74",
  "server.autopublish.enabled": "false",
  "server.autopublish.inactivity.limit": "1000",
  "server.home.dir": "c:\\servers-app\\jboss-eap-7.4",
  "server.timeout.shutdown": "120000",
  "server.timeout.startup": "120000",
  "vm.install.path": "c:\\java\\jdk8u382-b05",
  "wildfly.publish.restart.pattern": "\\.class$|\\.jar$",
  "wildfly.server.config.file": "standalone.xml",
  "wildfly.server.deploy.directory": "c:\\servers-app\\jboss-eap-7.4\\standalone\\deployments",
  "deployables": {
    "Sample": {
      "label": "Sample APP",
      "path": "c:\\proyectos\\sample",
      "options": {
        "option": {
          "deployment.output.name": "sample.ear"
        }
      }
    }
  }
}

.rsp.assembly.json:

{
    "mappings": [
        {
            "source-path": "sample-ear\\src\\main\\application\\",
            "deploy-path": "\\"
        },
        {
            "source-path": "sample-ear\\target\\sample\\",
            "deploy-path": "\\"
        },
        {
            "source-path": "sample-ejb\\target\\classes\\",
            "deploy-path": "\\sample-ejb.jar"
        },        
        {
            "source-path": "sample-web\\target\\classes\\",
            "deploy-path": "\\sample-web.war\\WEB-INF\\classes"
        },
        {
            "source-path": "sample-web\\src\\main\\webapp\\",
            "deploy-path": "\\sample-web.war"
        }
    ]
}

Exception message:

10:55:42.247 [pool-1-thread-2] ERROR o.j.t.r.s.s.p.AbstractFilesystemPublishController:386 - Error publishing module sample-ear to server JBoss EAP 7.4:
Unable to copy c:\projects\sample\sample-web\src\main\webapp\secure\profile.xhtml to c:\sample-web.war\secure\profile.xhtml

VS Code environment:

vscode-server-connector version 0.26.12
vscode-rsp-ui version 0.24.8 

Version of Java in use:

java version "17.0.8" 2023-07-18 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14, mixed mode, sharing)

NOTE: That project is an multi-module EAR, and the configuration works fine with Publish Server (Full), which is working correctly

If the issue is with the configuration , I would greatly appreciate it if you could guide me on the correct way to set them up.

robstryker commented 1 year ago

Do you have an example github repo I can replicate with? Perhaps a minimal example with none of your actual source code?

darkpastiurs commented 11 months ago

I deeply apologize; I overlooked the notification about my post. As you suggested, I created a new project where the reported issue can be replicated. I apologize again for not providing the proper follow-up.

Repo link: https://github.com/darkpastiurs/sample-project

robstryker commented 11 months ago

I'll look into this.

If it works correctly with publish server (full) but fails with publish server (incremental) then it's most likely a bug. I'll dig in.

robstryker commented 10 months ago

Sorry for the long delay. I was otherwise assigned on some tasks.

I've just dug deeper into this. I was unable to replicate on linux. I did replicate the issue on windows.

The bug is here: https://github.com/redhat-developer/rsp-server/blob/725ceafd40d3ac52cece43361d000ca91307f6be/framework/bundles/org.jboss.tools.rsp.server/src/main/java/org/jboss/tools/rsp/server/model/internal/publishing/DeployableDelta.java#L102

It seems that when a file is registered as changed by the file watcher, we add this changed file's relative path to a map to be used on the next publish. This line of code here ensures that the paths being added to this map are relative paths. However, the separator character being explicitly tested here is incorrect for windows.

I'll find a solution asap.

robstryker commented 10 months ago

This was fixed over here: https://github.com/redhat-developer/rsp-server/pull/713

I forgot to reference the actual issue because I didn't realize I was in a different repo :X oops.