Creation of GlassFish domain for CONNECT deployment error - windows

Running ant -Dglassfish.home=%AS_HOME% -f deploy.xml recreate.glassfish.domain
Generates the following error.
Execute failed: java.io.IOException: Cannot run program "%AS_HOME%\bin\asadmin.bat": CreateProcess error=2, The system cannot find the file specified
Any Ideas?

The actual problem is, in the bin-directory there are two files:
asadmin.bat and asadmin (Linux-Executable).
Just rename or delete the Linux-Executable and the deployment works fine.

Related

Issue in jmeter with adopopenjdk 8

I am trying to execute one jar having few parameter as well in apache-jmeter-5.1.1. I am running Thread Plan -> OS Process Sampler. But getting below error always :
Response message: Exception occurred whilst executing system call: java.io.IOException: Cannot run program "java -jar /User/wasim/Desktop/My_Jar/RunTask.jar " (in directory "/User/wasim/Desktop/jMeter/apache-jmeter-5.1.1/bin"): error=2, No such file or directory
I tried to run jar directly and with full path.
I have passed java_home as parameter as well.
This is the request in jmeter interface :
Working Directory: /User/wasim/Desktop/jMeter/apache-jmeter-5.1.1/bin
Environment: {JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home}
Executing: java -jar /User/wasim/Desktop/My_Jar/RunTask.jar update 20180401
i solved the issue after doing below changes :
In command section put only "java"
then put all your command after java into Command parameter section like below :
-jar
RunTask.jar
update
20180401
Make sure all remaining command should be in separate line without any space in the end.
Happy learning.

Docker Windows build fails with error: "The system cannot find the path specified"

I tried to create a directory junction on Docker Windows to create 8.3 . But it failed with the error message below.
D:\data\docker\sample>docker build -t sample .
Sending build context to Docker daemon 1.272GB
Step 1/4 : FROM microsoft/windowsservercore
---> 2cddde20d95d
Step 2/4 : RUN fsutil.exe behavior set disable8dot3 0
---> Running in ec6e7cc09ec6
The registry state is now: 0 (Enable 8dot3 name creation on all volumes).
---> 53805bc21858
Removing intermediate container ec6e7cc09ec6
Step 3/4 : RUN mklink /J "C:\PROGRA~1" "C:\Program Files"
---> Running in 2116f2070e6a
Junction created for C:\PROGRA~1 <<===>> C:\Program Files
re-exec error: exit status 1: output: time="2017-10-03T16:15:54+09:00" level=error msg="hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) layerId=\\?\C:\ProgramData\Docker\windowsfilter\5234d5f7cd7c2669db1818d9227a4be2822eeb72fc30071a495de78cd578b9f3 flavour=1 folder=C:\WINDOWS\TEMP\hcs088640839"
hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) layerId=\\?\C:\ProgramData\Docker\windowsfilter\5234d5f7cd7c2669db1818d9227a4be2822eeb72fc30071a495de78cd578b9f3 flavour=1 folder=C:\WINDOWS\TEMP\hcs088640839
The Dockerfile was below:
FROM microsoft/windowsservercore
RUN fsutil.exe behavior set disable8dot3 0
RUN mklink /J "C:\PROGRA~1" "C:\Program Files"
CMD [ "powershell" ]
How can I create a directory juction on Docker Windows?
I'm guessing your issue is actually not related to creating a directory junction (note that your build did complete that step), but is related to exceeding the base size of docker containers (I see you're pulling from windowsservercore, which is about 10GB, and web browsing tells me the default container base size is 10GB).
Try changing the size to 20GB in the docker daemon config by adding this json:
"storage-opts": [
"size=20G"
]
I was experiencing the same error message, tried all manner of troubleshooting, and resolved it with that daemon setting.
For Docker Enterprise this can be configured here C:\ProgramData\docker\config\daemon.json
"storage-opts":["size=20G"]
If this file does not exist created it
Link here
I was not able to resolve this with other methods; what worked for me was deleting and re-pulling the base image. So, it is apparently possible to get this error from a corrupt image.
check if the project is Running or not ! if it is running finish it. then check the command again
It seems that junctions and and hardlinks are not supported by docker for windows.
I had similar problem trying to create a container with Cygwin inside. Cygwing uses hardlinks a lot. It all went wwll until Docker tried to commit an image and it failed with "hcsshim::ImportLayer - cannot find the path" error. When I got rid of the hardlinks in the container I was able to commit the image without problems.

Run a command shell in jenkins

I'm trying to execute a command shell in Jenkins, I'm working on Windows 7. In the console output I have this:
Building in workspace C:\Program Files (x86)\Jenkins\workspace\test
[test] $ sh -xe C:\Windows\TEMP\hudson6299483223982766034.sh
The system cannot find the file specified
FATAL: L'exécution de la commande a échoué.
java.io.IOException: Cannot run program "sh" (in directory "C:\Program Files (x86)\Jenkins\workspace\test"): CreateProcess error=2, Le fichier spécifié est introuvable
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:244)
at hudson.Proc$LocalProc.<init>(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
at hudson.Launcher$ProcStarter.start(Launcher.java:382)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Caused by: java.io.IOException: CreateProcess error=2, Le fichier spécifié est introuvable
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 16 more
Build step 'Exécuter un script shell' marked build as failure
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: FAILURE
Any idea?
For Windows slave, please use Execute Windows batch command.
For Unix-like slave like linux or Mac, Execute shell is the option.
As far as I know, Windows will not support shell scripts out of the box. You can install Cygwin or Git for Windows, go to Manage Jenkins > Configure System Shell and point it to the location of sh.exe file found in their installation. For example:
C:\Program Files\Git\bin\sh.exe
There is another option I've discovered. This one is better because it allowed me to use shell in pipeline scripts with simple sh "something".
Add the folder to system PATH. Right click on Computer, click properties > advanced system settings > environmental variables, add C:\Program Files\Git\bin\ to your system Path property.
IMPORTANT note: for some reason I had to add it to the system wide Path, adding to user Path didn't work, even though Jenkins was running on this user.
An important note (thanks bugfixr!):
This works. It should be noted that you will need to restart Jenkins in order for it to pick up the new PATH variable. I just went to my services and restated it from there.
Disclaimer: the names may differ slightly as I'm not using English Windows.
This is happens because Jenkins is not aware about the shell path.
In Manage Jenkins -> Configure System -> Shell, set the shell path as
C:\Windows\system32\cmd.exe
Error shows that script does not exists
The file does not exists. check your full path
C:\Windows\TEMP\hudson6299483223982766034.sh
The system cannot find the file specified
Moreover, to launch .sh scripts into windows, you need to have CYGWIN installed and well configured into your path
Confirm that script exists.
Into jenkins script, do the following to confirm that you do have the file
cd C:\Windows\TEMP\
ls -rtl
sh -xe hudson6299483223982766034.sh
Go to Jenkins -> Manage Jenkins -> Configure System -> Global properties
Check the box 'Environment variables' and add the JAVA_HOME path = "C:\Program Files\Java\jdk-10.0.1"
*Don't write bin at the end
I was running a job which ran a shell script in Jenkins on a Windows machine. The job was failing due to the error given below. I was able to fix the error thanks to clues in Andrejz's answer.
Error :
Started by user james
Running as SYSTEM
Building in workspace C:\Users\jamespc\.jenkins\workspace\myfolder\my-job
[my-job] $ sh -xe C:\Users\jamespc\AppData\Local\Temp\jenkins933823447809390219.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:478)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
Caused: java.io.IOException: Cannot run program "sh" (in directory "C:\Users\jamespc\.jenkins\workspace\myfolder\my-job"): CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
at hudson.Proc$LocalProc.<init>(Proc.java:250)
at hudson.Proc$LocalProc.<init>(Proc.java:219)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:937)
at hudson.Launcher$ProcStarter.start(Launcher.java:455)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
at hudson.model.Build$BuildExecution.build(Build.java:206)
at hudson.model.Build$BuildExecution.doRun(Build.java:163)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1853)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:427)
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Solution :
1 - Install Cygwin and note the directory where it gets installed.
It was C:\cygwin64 in my case. The sh.exe which is needed to run shell scripts is in the "bin" sub-directory, i.e. C:\cygwin64\bin.
2 - Tell Jenkins where sh.exe is located.
Jenkins web console > Manage Jenkins > Configure System > Under shell, set the "Shell executable" = C:\cygwin64\bin\sh.exe > Click apply & also click save.
That's all I did to make my job pass. I was running Jenkins from a war file and I did not need to restart it to make this work.

TeamCity installed successfully, but unable to restart after shutdown

I have managed to install TeamCity successfully, with a BuildAgent running.
However, after running runall stop, followed by runall start, I get the following error:
error in script file line: 41 file input/output errorerror java.io.FileNotFoundException: C:\ProgramData\JetBrains\TeamCity\system\buildserver.data (Access is denied) opening file - file C:/ProgramData/JetBrains/TeamCity/system/buildserver.data
SQL exception: error in script file line: 41 file input/output errorerror java.io.FileNotFoundException: C:\ProgramData\JetBrains\TeamCity\system\buildserver.data (Access is denied) opening file - file C:/ProgramData/JetBrains/TeamCity/system/buildserver.data
The file exists in the directory What could be the issue?
I am using TeamCity 8.1
Looks like the problem is one of folder permissions which causes me to suspect that the user that the TeamCity Windows service runs as doesn't have read/write access to the folder where you chose to store your TeamCity data.
I had the same problem for my local windows installation. The solution is easy run startup.but script as administrator.
The answer is the oldest trick in the book..
After restarting the computer, it works.

TeamCity error 'tscon.exe' is not recognized as an internal or external command

I'm using tscon.exe to unlock a remote machine locally before I can run automation tests. When I run my command via RDC it works as expected and unlocks the remote machine locally:
C:>tscon.exe %sessionname% /dest:console
But I need this to run as my first TeamCity build step. Doing so either as a direct TeamCity Custom Script or starting a .bat file, both return the error:
[16:50:22][Step 1/11] in directory: C:\BuildAgent\work\e4249c2d6a4e9e8d
[16:50:22][Step 1/11] 'tscon.exe' is not recognized as an internal or external command,
Why is tscon.exe not recognised when used via TeamCity?
I just had same issue and moving the exe out of System32 is not an option for me.So I have to dig deeper.
Turns out the problem is not Teamcity. It's windows.
"The windows filesystem redirection forces 32-bit application attempts to be installed into or accessed from %windir%\System32, been intercepted and get redirected or re-pointed to %windir%\SysWOW64 instead."
The solution is to use an alias name ( %windir%\Sysnative ) for that directory which windows will not redirected.
Try this :
C:\Windows\Sysnative\tscon.exe %sessionname% /dest:console
For more detailed Reference : http://www.tipandtrick.net/how-to-suppress-and-bypass-system32-file-system-redirect-to-syswow64-folder-with-sysnative/
Here is the solution:
Copy tscon.exe to any location other than %windir%\System32\
i.e. C:\TeamCity\tscon.exe
Add TC build step as below (ensure to include Working Dir):
Now the remote machine will login locally before completing the TC steps

Resources