War file unpacking incorrectly in unix (bad directory permissions)

I'm having a very odd problem. So far I've only noticed it in one of my projects, though I haven't tried some others yet.

I have a war file that IDEA is creating when it compiles and packages my module that, when copied over to a solaris 10 machine (our application server) and unzipped, leaves some, but not all, directories without the X bit set, which in unix means the directory isn't able to be transversed into.

The program is being created on a Windows XP machine, which of course doesn't even have the same file permission setup as unix. The only way I can make the application usable on the solaris machine is to copy the war file to it, extract it manually, chmod -R o+X * the directory, and deploy it as an exploded war. It's really annoying.

I can't seem to find anywhere of people having this issue. Where are things like directory permissions set? Is there a way for me to change it? The odd thing is I have other projects that work just fine, no problems at all.

Any help would be appreciated.

Thanks,
~Colin

3 comments

Maybe it is caused by your copy machine. If you are using WinSCP3, there is an option to set the default permissions.

0

Hey Norris, thanks for the response.

I've tried both weblogic 9.2's file uploading service along with filezilla. Both of those methods work fine for a different war file I have, but not this one.

The war file's permission itself doesn't seem to be the problem, it's the files inside of the war file after they're extracted. So if I just run "unzip module.war" on the solaris machine, it will extract all of the files out of the war file, but some of the directories (namely the /WEB-INF/classes directory and a /js directory) have permissions of 644 (drw-rr) rather than 755 (drwxr-xr-x). the /META-INF and /WEB-INF directories are set correctly however. The application server of course chokes on this because it can't see some of the files in the war.

0

Problem (mostly solved).

I ended up converting the project to use maven for the build process. This caused the war file to no longer have weird permissions in unix for whatever reason. It still did not work in weblogic, but I found that renaming the war file to something else (even just changing the first letter to lowercase) caused it to work fine. Must be some sort of residual config that never got cleaned up when weblogic deleted the app from its system.

I'm still not sure why the IDEA build gives me a war file that has odd directory permissions set, but since most of our projects are getting moved into a maven build environment, the point becomes less concerning. Thanks everyone.

~Colin

0

Please sign in to leave a comment.