I am new to WildFly and I am trying to know more on deployment scanner process.
There are two deployment mode in WildFly auto deploy mode and manual.
If I restart WildFly, my ear files are deploying again. As per WildFly forum it should deploy again if there is a change in file(based on time-stamp).
I am running my WildFly in standalone mode.
When I run the following command:
sh standalone.sh -b 0.0.0.0
and its started within 2 minutes. Again if I restart server is taking same time.
It is re-deployed using timestamp only in a running instance. An application needs to be deployed to 'run' thus when the servcer starts it deploys the applications and stops aka undeploys them when it stops.
Whenever you deploy anything on wildfly manually ( I mean using admin console ) , it put a entry in standalone.xml ( or other xml if you configure to use them ). You will find an entry referring to it. With this during next restart it knows what to re-deploy.
In scanner mode , it know location of scanner directory and during startup , it picks content from it.
Now for >>>>> As per WildFly forum it should deploy again if there is a change in file(based on time-stamp).
Ans : If autodeployed is true ; then while server is running and you update any file , it will be picked up and wildfly will re-deploy app.
Hope this helps
Related
I've been using http://commons.apache.org/proper/commons-daemon/ to create a windows service for the Wildfly startup (using exe mode as proposed in some blogs). The problem is, that the service is immediately marked as running. I have some other services that are only allowed to start once Wildfly is up and running. Making these services depend on the Wildfly service won't work, because the startup takes between 20-60 sec.
Is there a way to make procrun wait for a return value or at least for a fixed time, before the service is marked as running?
I don't use that service wrapper but the one that ships with wildfly (in the docs\contrib\scripts\service folder. (See http://www.mastertheboss.com/jboss-server/jboss-configuration/run-jboss-as-service-howto for details).
But I suspect the problem is one I see as well. wildfly starting is a quick process process - 1 or 2 seconds - but what then takes the time is deploying your ear or war files so it can actually do something useful. You can tell when that's happened by the
myEar.ear.deployed file turning up. With the wildfly service wrapper, everything is done in the service.bat script, and starting the wildfly service basically means running the code at the :commandStart label.
:cmdStart
if /I "%~1"=="/name" (
if not "%~2"=="" (
set SHORTNAME="%~2"
)
)
%PRUNSRV% start %SHORTNAME%
echo Service %SHORTNAME% starting...
goto cmdEnd
after the echo of Service starting, you could put in a sleep for 30 s
timeout /t 30 /nobreak
or you could try looking for the .deployed file and looping until its there or a .failed file is there. (A simple timeout is easier!)
Can someone please give detailed way to monitor JBOSS app server ?
The production application running on JBOSS server starts working fine after restarting the server. How do I identify what is the cause behind it?
To see what is "hung", try getting a thread dump from your JBoss instance by running it in the foreground from a command shell. Then on Linux, send a kill -3 [PID] to JBoss to dump its thread state to stdout. On Windows, you would type Control-Break in the CMD shell running JBoss. Alternatively, use a monitoring tool like VisualVM.
as mentioned from the title i have a problem stopping the wildfly windows service.
When i tried to stop the wildfly service via the server manager - services window the status of the wildfly service doens't change to stop from stop pending. But wildfly isn't running anymore (my web service is not reachable and also the server log says that wildfly was successfully stopped). to start the service again i have to restart the windows server.
i've tested this with different scenarios:
Windows Server 2008 R2 Datacenter + Wildfly 9
Windwos Server 2012 Datacenter + Wildfly 10
Windows 7 + Wildfly 10
I also tried to make changes in the service.bat like Chris French mentioned on https://developer.jboss.org/thread/238135?tstart=0 but there is no change.
Interessting is that the problem doens't exists on any of the scenarios when i added the service without adding any deployments to wildfly (so just the blank server). What means that i am able to start and stop the wildfly service successfully from the server manager services window when the wildfly server is "blank" and without any changes (for e.g. in standalone.xml).
So i think the problem must be my java ee project which contains a web service and a simple persistent project to access different my sql databases. In the standalone.xml i just added the mysql driver and the databases and i do some edits in the interface section (ip adress changes).
Any Ideas? Do i have to made changes in different config files (for e.g. the service.bat) when im deploying something to wildfly?
Sorry for my english and thanks a lot!
When installing the WildFly service, make sure you have the following parameters specified:
In WildFly 8: /user <username> /password <password>
in WildFly 10: /jbossuser <username> /jbosspass <password>
In the services.bat the documentation reads:
/user: username for the shutdown command
/password: password for the shutdown command
According to my experience, without these parameters, WildFly will move to status "stopping", but will not stop.
That works for me:
1. Always run the CMD as admin first.
2. If your JBOSS_HOME environment is not set, get sure that you navigate to WildFly home directory before you execute the script.
For example: cd "C:\Program Files\wildfly
It's matter, because the service.bat takes your current dir (%CD%) as JBOSS_HOME, if it's not set.
3. You’ve to install the service with a special parameter. /controller
It’s important that you tell wildfly service on which port your wildfly admin console is running.
Take a look in standalone.xml, search for “management-http”, get sure that you use the same port in parameter.
Example: (Default port is 9990)
./bin/service/service.bat install /controller localhost:9990
Done. Now start the service and wait until you can reach the wildfly console page.
After try to stop or restart the service in service.msc or with service.bat (service.bat start/stop/restart).
I had similar issue but it turned out I needed a JAVA_HOME in standalone.conf.bat under bin folder. Simply uncomment the line that sets the JAVA_HOME variable and update its value with the desired path.
set "JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121"
Above solution worked for me.
I had the "stopping" problem, when JAVA_HOME was set directly in jboss_cli.bat, pointing to the older jdk version previously installed on my machine. Check jboss_cli.bat for correct path of JAVA_HOME or simply use the JAVA_HOME environment variable (you might have to delete set JAVA_HOME line in jboss_cli.bat).
I have followed this guide to install a jenkins slave on windows 8 as a service:
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+as+a+Windows+service#InstallingJenkinsasaWindowsservice-InstallSlaveasaWindowsservice%28require.NET2.0framework%29
I need to run a job that interact with the desktop (run an application that opens a browser etc.). So after I have installed the slave as a service (running jnlp downloaded from the master) I have changed the service "Log on" to "Allow to interact with display".
For some reason its only possible to enable this for the "Local System account" even though its recommended to run the service as a specified user, eg. jenkins.
But nothing happens when I execute the job, the browser is not opened. If I instead stop the service and just launch the slave through the jnlp file the job runs fine - the browser is opened.
Anybody had any luck interacting with the desktop when running a jenkins windows slave as a service?
Services run since Vista in Session 0 and the first user is now in Session 1. So you can't interact any longer. This is called Session 0 Isolation.
Microsoft explains this here and here. You have to use 2nd Program which uses IPC to communicate to the Service.
I had lots of issues running Jenkins in Windows using the service.
Instead I now disable the service and run it from CMD.
So open CMD.
cd C:\Program Files (x86)\Jenkins
java -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar
jenkins.war --httpPort=9091
To resolve it, first create Windows auto-logon as I explain here:
https://serverfault.com/questions/269832/windows-server-2008-automatic-user-logon-on-power-on/606130#606130
Then create a startup batch for Jenkins agent (place it in Jenkins directory). This will launch agent console on desktop, and should allow Jenkins to interact with Windows GUI:
java -jar slave.jar -jnlpUrl http://{Your Jenkins Server}:8080/computer/{Your Jenkins Node}/slave-agent.jnlp
(slave.jar can be download from http://{Your Jenkins Server}:8080/jnlpJars/slave.jar)
EDIT :
If you're getting black screenshots (when using Selenium or Sikuli, for example), create a batch file that disconnects Remote Desktop, instead of closing the RDP session with the regular X button:
%windir%\system32\tscon.exe %SESSIONNAME% /dest:console
Consider running the Java slave server directly at startup and then using something to monitor and restart should the server go down (e.g., Kiwi Restarter).
Please check the services (# TestNode) make sure the "Interactive Services Detection" service is STARTED, by default the startup type is set to Manual, you may like to set it to automatic as well.
After service started, when you run your test in the Test Node, you will see something like the below:
Click on it and choose view the message
You will see the activities happen there. Hope this helps :D
Note: If login with other account and cannot view the Interative Services Detection prompt, restart the service again.
My Jenkins Service runs as user "jenkins" and all I did was to create Desktop folders in: C:\Windows\system32\config\systemprofile\desktop and if 64 bit Windows also in C:\Windows\SysWOW64\config\systemprofile\desktop - then it runs perfectly.
Make sure that Desktop folders are created as such:
%WINDOWS%/System32/config/systemprofile/Desktop
%WINDOWS%/SystemWOW64/config/systemprofile/Desktop
Presence of those can sometimes be mandatory while running some Java software as a Service.
Problem
I need to integrate AspectJ code into an existing application running on Tomcat, but I think I am not setting JAVA_OPTS correctly.
Our vendor has created some AspectJ code that passes logged in user id information to the CONTEXT_INFO() object within MSSQLServer Connection. This is so that within an audit database trigger that we created, we can capture the user id that made the change.
What I have done
Added the following code to our database trigger
DECLARE #appUserID INT
SET #appUserID = ISNULL(REPLACE(CONVERT(VarChar(128), CONTEXT_INFO()),CHAR(0), ''), '0');
Added aspectjrt.jar to the web application WEB-INF\lib folder.
Added vendorAspectJCode.jar to the web application WEB-INF\lib folder.
Added aspectjweaver.jar to tomcat's lib folder \tomcat7.0.27\lib
Edited catalina.bat with the following:
there is a line of code that looks like this:
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
I have changed that to
set JAVA_OPTS=”%JAVA_OPTS% %LOGGING_CONFIG% -javaagent:D:\tomcat\tomcat7.0.27\lib\aspectjweaver.jar"
but it did not seem to work.
So then I have tried setting it like that, adding a new set JAVA_OPTS:
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
set JAVA_OPTS="-javaagent:D:\tomcat\tomcat7.0.27\lib\aspectjweaver.jar"
but that did not seem to do the trick either
After making the following changes and running a test through the web application front end, the user id that was inserted into the database was 0, so that tells me that something has not been done right and the part that I feel less comfortable with all of the steps above was Step 5.
Does anybody know if the syntax for setting JAVA_OPTS is correct?
or whether there is another place to put it?
After a lot of trial and error I found out how to integrate AspectJ in Tomcat running as a Service on a Windows server. I do not know why, but the bolded stuff was the cause to my problems.
Of course, as I mentioned in my question above you need the following prerequisites:
Add aspectjrt.jar to the web application WEB-INF\lib folder.
Add vendorAspectJCode.jar to the web application WEB-INF\lib folder.
Add aspectjweaver.jar to tomcat's lib folder \tomcat7.0.27\lib
Setting -javaagent:PathToMyAspectjweaver\aspectjweaver.jar in the service.bat did not work. So I had to set it in the registry along with uninstalling/installing the Tomcat service for changes to be picked up by doing as follows:
First I recommend turning UAC off and to make sure that you are an Administrator
Stop the Tomcat service if running.
Delete the tomcat service.
Verify in Windows Services that the service is no longer there.
Verify the Windows registry that everything related to the service got deleted. If not, do so manually.
Install the Tomcat service.
Verify in Windows Services that the service got created.
Find the service in the registry and edit the variable Options apppending the following:
-javaagent:PathToMyAspectjweaver\aspectjweaver.jar
I have created a couple of bat files for these steps. Steps 2 and 3 would look something similar to this below (TomcatServiceUninstall.bat):
echo OFF
ECHO Removing Tomcat Service...
sc stop YourServiceName
sc delete YourServiceName
ECHO Removing Registry Key containing config data for Tomcat7
REG DELETE "HKLM\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\YourServiceName" /f
REG DELETE "HKLM\SOFTWARE\Wow6432Node\Apache Software Foundation\Tomcat\7.0" /f
ECHO Uninstall Complete - File Directories remain intact.
Step 6 would look like that (TomcatServiceInstall.bat)
ECHO OFF
ECHO Running Service.bat to install the Tomcat 7 - YourServiceName - Service
cd "C:\Path to your tomcat\tomcat7.0.27\bin"
service.bat install