Why sikuli desktop operation not working while running jar with ec2 startup script? - windows

I have created windows AMI and in user data I am running command to run jar file, but jar running as a service when instance starts and jar unable to perform desktop click with sikuli. Same jar run perfectly fine if I manually start cmd on instance and run command for jar file.
Please suggest solution.

You need to have active UI to perform UI actions. Service is headless.
This is not a Sikuli specific problem

Related

Cannot build using gradle when using clearcase

I have been trying to build my Java web application using gradle. Everything work fine in the local drive and the build goes through as expected. However, when I switch to using the clearcase MVFS File system (G:), the build seems to behave erratically. From the windows 10 command line, if I change directory to the G:\ drive location, and execute "gradle war", it works fine the first time. After that, I run the same command again - the already created war file gets deleted and the classes are removed. It's bizarre. I did the following and still the behavior is the same.
disabled daemon
disabled file watching
Its the same behavior with Gradle 7 and gradle 6.8.
When I delete the .gradle folder, everything works fine again.
So - Does gradle not support the NFS and MVFS File System ? What is the solution to this problem ? Any help is appreciated.
Does gradle not support the NFS and MVFS File System ?
That is why I proposed in 2018 to use gradle only in snapshot views.
Especially considering a "gradle --no-daemon build" does defeat the purpose of having the daemon at all.
A build is better served in a local filesystem than a mounted one (MVFS dynamic views) which relies on where your view server is.

Trying to debug an application that starts up via an "exec" gradle task

I have a gradle task (type - exec). In this task I start a WildFly server using a standart bat file (standalone.bat). The war file is already in deployments beforehand, so the server starts up and everything works fine.
The problem appears when I need to debug the actual application on the server. Running the gradle task in a debug mode doesn't help, as it can only debug the actual gradle task itself and not the application that it starts.
I know, there is a solution to this problem using an additional configuration that would allow me to debug a remote java application. However, the goal for me right now is to move eveything onto gradle tasks and not have any configurations set up in my IDE.
I need to be able to run a gradle exec task that would start up my server and than to debug whatever application it deploys. Is there a way to do this? Thank you in advance.
Note: I've never used Wildfly
Ultimately you'll want to edit standalone.bat so that you include an additional arguments to the java.exe invocation. Take a look inside standalone.bat many applications include a line commented out that you can uncomment to enable debugging.
Eg sample argument to add to the java.exe call
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044
You may wish to take a copy of standalone.bat which you call standalone-debug.bat which you invoke via gradle

Running Spring application outside of an IDE (preferably OS shell)

https://www.pegaxchange.com/2018/01/24/java-web-project-with-spring-framework/ has instructions for creating a Java Web Project with Spring, without Maven. I am able to get it working in an Eclipse environment. It works as expected by doing “Run As” --> “Run on Server”.
When I kill Eclipse I get the Status 404 error (“The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.”). I have verified that the Tomcat Server is running from the XAMPP Control Panel.
How do I launch the application from an OS shell (Windows & Linux) so that I don't see the 404 error?
Its been a long time I haven't used java web projects without maven but if my memory serves me right, you should first export your project as .war file. Then deploy it to tomcat.
In eclipse right click your project select export and then select WAR file.
Copy your WAR file into webapps directory which is located in tomcat installation directory.
Rename the WAR file as you like if you want to serve you web app with a specific context name something like http://localhost:8080/myapp. If you do want to serve as root without a context name just rename it as "ROOT".
Run tomcat by command line <your-tomcat-installation-dir>\bin\startup.sh or it will be a .bat file for windows so you should end your command with .bat.
Or if you can start and stop by XAMPP panel this should do the same as well.
Also you can see this article for details on how to deploy a war file to tomcat.
I hope this helps. Cheers!

Maven Selenium project Execution Not visible with Jenkins build Now

I am using selenium maven project with Jenkins and when I run build now, execution is running in background for which I am able to see output in consol but my browser and all execution on browser is NOT visible.
I tried searching around and change Jenkins service by checking allow window interaction checkbox but still not able to view it. I m running on window 10 and running with local(http://localhost:8080). I tried with Chrome, firefox & IE and all have same behavior of Not visible.
I used command "mvn clean test" in Build - Execute Windows batch command.
Same project is running with Eclipse & CMD very well with visible execution.
I am using Jenkins version 2.46.3.
Anyone experienced this? Any idea ?
Run Jenkins or slave from command line using war or jar provided, other option to try: check 'Allow service to interact with desktop' in Services.
After lots of search & troubleshoot, I found solution as I installed Jenkins as Window version (.exe) so I uninstalled it and downloaded Jenkins from official jenkins website(https://jenkins.io/download/) by clicking on Generic Java Package(.war) and then went into Command prompt and went to path where my Jenkins.war file dowloaded and install using java -jar jenkins.war and reregister with different accountname and password (created new account so it won't pull up the old account) and the Execution started DISPLAYING ON BROWSER. Hope this helps.

Jenkins Websphere Deployment doesnt retain application configurations

I am using Jenkins version 1.644 and trying to deploy a web application to Websphere 8.5 application server. Jenkins job completed successfully and application is visible through admin console. After the first install, i manually configured Three application configurations namely,
1. Virtual Host
2. Context Root and
3 Modules
after these setup application comes up fine.
Now when i run the Jenkins Job again (option used is Install/Update application), it overrides all the configurations.
Please Let me know how to keep the configurations after each build from Jenkins.
Websphere Plugin Configuration
You can create a build deploy job which will call wsadmin tool and there you can pass parameter in key value pairs
Here is an article which talks about how to build job with parameterized configuration.
http://www.touchdownconsulting.nl/2011/03/building-and-deploying-websphere-applications-with-jenkins-ci/
I have not tried this but looks like it suits your requirement.
Hope this helps!
Current Jenkins Websphere deploy plugin (1.3.4) version does not allow to pass
1. Virtual Host
2. Context Root and
3. Modules
I created a Jython script using AdminApp WAS Utility and updated these parameters
AdminApp.edit("appname", ['-MapWebModToVH', [["appname", "appname.war,WEB-INF/web.xml", "api_host"]]])
AdminApp.edit("appname", ['-CtxRootForWebMod', [["appname", "appname.war,WEB-INF/web.xml", "/appname"]]])
AdminApp.edit("appname",['-MapModulesToServers', [["appname","appname.war,WEB-INF/web.xml","WebSphere:cell=appcell01,node=node12v,server=web2+WebSphere:cell=Cell01,node=node11v,server=web1+WebSphere:cell=Cell01,cluster=api-cluster"]]])
AdminConfig.save()
Used Jenkins Remote SSH Plugin to invoke this script.

Resources