microsoft / vsts-ibm-websphere-extension

VSTS Extension to integrate with IBM WebSphere Application Server
Other
8 stars 16 forks source link

java.io.FileNotFoundException on .fileTableLock (Access is denied.) #5

Closed adetrie closed 7 years ago

adetrie commented 7 years ago

Hi,

We are trying to implement continued deployment of a Java WebSphere application through the TFS Websphere plugin. We have a problem running the "Deploy to IBM WebSphere" step:

[command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\IBM\WebSphere\AppServer\bin\wsadmin.bat" -username MYUSER -password **** -host IPHOST -port 8879 -conntype SOAP -c "AdminConfig.getid('/Deployment:WAS9Migration/');"" (IP host and user are hidden).

An error is thrown. Here is the log: 2017-07-18T14:38:41.0491482Z Access is denied. 2017-07-18T14:38:41.0491482Z !SESSION 2017-07-18 16:38:40.533 ----------------------------------------------- 2017-07-18T14:38:41.0491482Z eclipse.buildId=M20060921-0945 2017-07-18T14:38:41.0491482Z java.fullversion=JRE 1.8.0 IBM J9 2.8 Windows Server 2012 R2 amd64-64 Compressed References 20170516_348050 (JIT enabled, AOT enabled) 2017-07-18T14:38:41.0491482Z J9VM - R28_20170516_1905_B348050 2017-07-18T14:38:41.0647715Z JIT - tr.r14.java_20170516_348050 2017-07-18T14:38:41.0647715Z GC - R28_20170516_1905_B348050_CMPRSS 2017-07-18T14:38:41.0647715Z J9CL - 20170516_348050 2017-07-18T14:38:41.0647715Z BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US 2017-07-18T14:38:41.0647715Z Framework arguments: -application com.ibm.ws.bootstrap.WSLauncher 2017-07-18T14:38:41.0647715Z Command-line arguments: -application com.ibm.ws.bootstrap.WSLauncher 2017-07-18T14:38:41.0647715Z !ENTRY org.eclipse.osgi 4 0 2017-07-18 16:38:41.017 2017-07-18T14:38:41.0647715Z !MESSAGE Error reading configuration: C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\configuration\org.eclipse.osgi.manager.fileTableLock (Access is denied.) 2017-07-18T14:38:41.0647715Z !STACK 0 2017-07-18T14:38:41.0647715Z java.io.FileNotFoundException: C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\configuration\org.eclipse.osgi.manager.fileTableLock (Access is denied.) 2017-07-18T14:38:41.0647715Z at java.io.RandomAccessFile.open0(Native Method) 2017-07-18T14:38:41.0647715Z at java.io.RandomAccessFile.open(RandomAccessFile.java:333) 2017-07-18T14:38:41.0647715Z at java.io.RandomAccessFile.(RandomAccessFile.java:257) 2017-07-18T14:38:41.0647715Z at org.eclipse.core.runtime.internal.adaptor.Locker_JavaNio.lock(Locker_JavaNio.java:33) 2017-07-18T14:38:41.0647715Z at org.eclipse.osgi.storagemanager.StorageManager.lock(StorageManager.java:389) 2017-07-18T14:38:41.0647715Z at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:702) 2017-07-18T14:38:41.0647715Z at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226) 2017-07-18T14:38:41.0647715Z at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160) 2017-07-18T14:38:41.0647715Z at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123) 2017-07-18T14:38:41.0647715Z at org.eclipse.osgi.framework.internal.core.Framework.(Framework.java:193) 2017-07-18T14:38:41.0647715Z at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:263) 2017-07-18T14:38:41.0647715Z at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 2017-07-18T14:38:41.0647715Z at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2017-07-18T14:38:41.0647715Z at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90) 2017-07-18T14:38:41.0647715Z at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) 2017-07-18T14:38:41.0647715Z at java.lang.reflect.Method.invoke(Method.java:508) 2017-07-18T14:38:41.0647715Z at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340) 2017-07-18T14:38:41.0647715Z at org.eclipse.core.launcher.Main.basicRun(Main.java:282) 2017-07-18T14:38:41.0647715Z at org.eclipse.core.launcher.Main.run(Main.java:981) 2017-07-18T14:38:41.0647715Z at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:412) 2017-07-18T14:38:41.0647715Z at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:173) 2017-07-18T14:38:41.0647715Z Not found app WAS9Migration, install.

However, the deployment is not stopped and attempts to execute the command:

2017-07-18T14:38:41.0961386Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\IBM\WebSphere\AppServer\bin\wsadmin.bat" -username MYUSER -password **** -host IPHOST -port 8879 -conntype SOAP -c "AdminApp.update('WAS9Migration', 'app', '[-operation update -contents C:/agent/work/8e9a63e47/WAS9-_MigrationWAS9_cleanpackage-P_prod/drop/MigrationWAS9EAR-1.0-SNAPSHOT.ear ]'); AdminConfig.save();""

And the following error appears: 2017-07-18T14:38:41.3460386Z Access is denied. 2017-07-18T14:38:42.1429541Z !SESSION 2017-07-18 16:38:41.674 ----------------------------------------------- 2017-07-18T14:38:42.1429541Z eclipse.buildId=M20060921-0945 2017-07-18T14:38:42.1429541Z java.fullversion=JRE 1.8.0 IBM J9 2.8 Windows Server 2012 R2 amd64-64 Compressed References 20170516_348050 (JIT enabled, AOT enabled) 2017-07-18T14:38:42.1429541Z J9VM - R28_20170516_1905_B348050 2017-07-18T14:38:42.1429541Z JIT - tr.r14.java_20170516_348050 2017-07-18T14:38:42.1429541Z GC - R28_20170516_1905_B348050_CMPRSS 2017-07-18T14:38:42.1429541Z J9CL - 20170516_348050 2017-07-18T14:38:42.1585668Z BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US 2017-07-18T14:38:42.1585668Z Framework arguments: -application com.ibm.ws.bootstrap.WSLauncher 2017-07-18T14:38:42.1585668Z Command-line arguments: -application com.ibm.ws.bootstrap.WSLauncher 2017-07-18T14:38:42.1585668Z !ENTRY org.eclipse.osgi 4 0 2017-07-18 16:38:42.142 2017-07-18T14:38:42.1585668Z !MESSAGE Error reading configuration: C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\configuration\org.eclipse.osgi.manager.fileTableLock (Access is denied.) 2017-07-18T14:38:42.1585668Z !STACK 0 2017-07-18T14:38:42.1585668Z java.io.FileNotFoundException: C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\configuration\org.eclipse.osgi.manager.fileTableLock (Access is denied.) 2017-07-18T14:38:42.1585668Z at java.io.RandomAccessFile.open0(Native Method) 2017-07-18T14:38:42.1585668Z at java.io.RandomAccessFile.open(RandomAccessFile.java:333) 2017-07-18T14:38:42.1585668Z at java.io.RandomAccessFile.(RandomAccessFile.java:257) 2017-07-18T14:38:42.1585668Z at org.eclipse.core.runtime.internal.adaptor.Locker_JavaNio.lock(Locker_JavaNio.java:33) 2017-07-18T14:38:42.1585668Z at org.eclipse.osgi.storagemanager.StorageManager.lock(StorageManager.java:389) 2017-07-18T14:38:42.1585668Z at org.eclipse.osgi.storagemanager.StorageManager.open(StorageManager.java:702) 2017-07-18T14:38:42.1585668Z at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initFileManager(BaseStorage.java:226) 2017-07-18T14:38:42.1585668Z at org.eclipse.osgi.internal.baseadaptor.BaseStorage.initialize(BaseStorage.java:160) 2017-07-18T14:38:42.1585668Z at org.eclipse.osgi.baseadaptor.BaseAdaptor.initializeStorage(BaseAdaptor.java:123) 2017-07-18T14:38:42.1585668Z at org.eclipse.osgi.framework.internal.core.Framework.(Framework.java:193) 2017-07-18T14:38:42.1585668Z at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:263) 2017-07-18T14:38:42.1585668Z at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 2017-07-18T14:38:42.1585668Z at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2017-07-18T14:38:42.1585668Z at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90) 2017-07-18T14:38:42.1585668Z at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) 2017-07-18T14:38:42.1585668Z at java.lang.reflect.Method.invoke(Method.java:508) 2017-07-18T14:38:42.1585668Z at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340) 2017-07-18T14:38:42.1585668Z at org.eclipse.core.launcher.Main.basicRun(Main.java:282) 2017-07-18T14:38:42.1585668Z at org.eclipse.core.launcher.Main.run(Main.java:981) 2017-07-18T14:38:42.1585668Z at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:412) 2017-07-18T14:38:42.1585668Z at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:173) 2017-07-18T14:38:42.1898344Z ##[debug]rc:15 2017-07-18T14:38:42.1898344Z ##[debug]success:false 2017-07-18T14:38:42.1898344Z ##[debug]task result: Failed 2017-07-18T14:38:42.1898344Z ##[error]Error: C:\Program Files\IBM\WebSphere\AppServer\bin\wsadmin.bat failed with return code: 15

If we execute both commands from the TFS release agent, they will work, our application will deploy correctly on our server.

Do you have an idea ?

Thank you

davidstaheli commented 7 years ago

Hi Alexis, is there a difference between user identities when you run this from the command line vs. as part of a release? If you are running the release agent as a service, it runs as a user that may not have the same access permissions as your logged-in user at the command line.

adetrie commented 7 years ago

Hi David,

Thank you for your help. Indeed a was made a mistake with my user right.

It's done for me :)

davidstaheli commented 7 years ago

Great, thanks Alexis!