0

We are using some library that doesn't work for some reason if the WAR is expanded under the apps folder. When the eclipse tooling publishes the WAR to a remote server, the WAR is expanded. How do I prevent the server from unzipping the published WAR?

Randy Hudson
  • 1,600
  • 1
  • 12
  • 11
  • At first I'd thought the answer was to simply add this **** to your server.xml. I deleted that answer though after realizing there's probably more involved with the publish onto the remote server. – Scott Kurz May 25 '16 at 17:07

1 Answers1

0

If an app doesn't work when expanded, but the exact same app works as a binary, then that indicates something wrong in the server. I'm not aware of specific cases where we wouldn't support an expanded EAR instead of an EAR binary.

It sounds like you're this far already, but the first thing to check is if you're using resources inside of the workspace or inside of the server. You can check this by looking at the server on disk and seeing if the apps directory has either something like TestWar.war.xml or TestWar.war (directory).

To move the resources to the server, if you are using something like WDT (the Eclipse tooling you get from dragging the icon on wasdev.net into your Eclipse workspace) you can modify the Liberty server settings to do this.

In the Servers tab, double-click the WebSphere Application Server Liberty entry and you should see the Overview configuration screen. Uncheck Run applications directly from the workspace and now if you look at the server on disk you will see the files directly inside of the server.

But, to answer your question, it's not so much that we're unzipping the published WAR so much as we're not zipping it to begin with. If you right-click the EAR project and go to Export that's a one-off way to make an EAR binary, but otherwise you may want to look at a simple build description system through Ant or Gradle or Maven along with similar standards to build the archives.

ewhoch
  • 341
  • 2
  • 7
  • Erik, "Run applications directly from the workspace" is not supported for remote servers. There is no EAR involved, only a WAR. Based on the console it definitely is getting unzipped: `[INFO ] CWWKX7908I: Archive /.../XYZ_original.war was successfully expanded to /.../XYZ.war` – Randy Hudson May 25 '16 at 18:31
  • When developing with eclipse, I can modify my code and have it recompiled in milliseconds, republished in seconds, or even hot-swapped into a running JRE. I don't know of any teams that have used Ant/Gradle/Maven to provide a similar development experience. – Randy Hudson May 25 '16 at 18:40
  • In that case I misunderstood the question. In the implementation it's using a FileTransferMBean with a "expandOnCompletion" flag set. I'm looking into if this is configurable from the Eclipse tools. – ewhoch May 25 '16 at 18:58
  • The Eclipse tools do it that way in order to support incremental update. There isn't a flag to turn that off, and if there was you would likely lose the fast publish speeds. – ewhoch May 25 '16 at 19:16