Hello i would like ask how it is possible configure jboss server for something like live, hot deploment:
every time when i change some code of my jsp,html,js or css file i always need to clean and build project than deploy project to jboss and again, agian and again. That cost alot of my time. I waste time for that. It will be easy when i could work on files which already use a started jboss (deployed). But this files is in WAR file "project.war" and throught my IDE (Netbeans) i cant edit this files (jsp,css,html or js). Netbeans made this file uneditable.
I Would glad for solution step by step how it is possible to avoid this boring process.
Edit Standalone.xml,change development to "true"
<configuration>
<jsp-configuration development="true"/>
</configuration>
Start JBoss.
Go to ServerLocation-> standalone\tmp\vfs
Sort by "Date Modified" descending
Open the first folder(something like deployment*******)
There will be your complete exploded war.
Go to the jsps,js,css location,edit & save the changes.
changes will be displayed live.
Follow this procedure to enable hot deployment enable in JBOSS
It will work on JBoos AS 7.0.1 and should work on other versions with slight changes
Go to JBoss administrative panel (by default localhost:9990)
Now in profile settings open Core - Deployment Scanners
Turn on Autodeploy-Exploded (set to true)
You can set scanner time (by default 5000 ms) to appropriate as
according to you your (I prefer to set 2000, for more fast incremental
publishing when I make changes in projects)
That it.
Now JBoss make HOT deploy for almost all kind of files
I think that you're looking for something like JRebel. For those who haven't had the chance to hear about it, it's a magic tool made to get rid of such annoying redeploys after every modification made in your source files.
As you're using Netbeans IDE, this a dedicated tuto explaining how to set up JRebel.
I have the same problem. My solution is to run the program on debug mode without editing config file. Once you are done, you can see the result without restarting.
If you are running JBoss EAP 7.x, add the following to your standalone XML:
<subsystem xmlns="urn:jboss:domain:undertow:7.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other">
...
<servlet-container name="default">
<jsp-config development="true" />
<websockets />
</servlet-container>
...
</subsystem>
Deploy the app as exploded (project.war folder), add in your web.xml:
<web-app>
<context-param>
<param-name>org.jboss.weld.development</param-name>
<param-value>true</param-value>
</context-param>
Copy class/jsp/etc,
update the web.xml time stamp every-time you deploy(append blank line):
set PRJ_HOME=C:\Temp2\MyProject\src\main\webapp
set PRJ_CLSS_HOME=%PRJ_HOME%\WEB-INF\classes\com\myProject
set JBOSS_HOME= C:\Java\jboss-4.2.3.GA-jdk6\server\default\deploy\MyProject.war
set JBOSS_CLSS_HOME= %JBOSS_HOME%\WEB-INF\classes\com\myProject
copy %PRJ_CLSS_HOME%\frontend\actions\profile\ProfileAction.class %JBOSS_CLSS_HOME%\frontend\actions\profile\ProfileAction.class
copy %PRJ_CLSS_HOME%\frontend\actions\profile\AjaxAction.class %JBOSS_CLSS_HOME%\frontend\actions\profile\AjaxAction.class
ECHO.>>%JBOSS_HOME%\WEB-INF\web.xml
I am using JBOSS AS 7.2
in http://127.0.0.1:9990/console/index.html#deployment-scanner
Configuration
⇒
Subsystems⇒
Subsystem
⇒
Deployment Scanners
Click on Edit, turn "Auto Deploy Exploded" to true.
You can change to JBoss see the deployments folder each ten seconds
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir"
scan-interval="10000"/>
</subsystem>
Related
We are new to Weblogic (12c). We try to choose how we're going to pass some configurations to the application depending on the environment it is running on (dev / staging /prod).
I'm currently trying to use a deployment plan. In WEB-INF/web.xml, I have :
<context-param>
<param-name>test</param-name>
<param-value>11111</param-value>
</context-param>
And I use a plan.xml for my application in Weblogic.
Some parts :
<variable-definition>
<variable>
<name>test</name>
<value xsi:nil="false">22222</value>
<description>some description</description>
</variable>
</variable-definition>
and
<module-descriptor external="false">
<root-element>web-app</root-element>
<uri>WEB-INF/web.xml</uri>
<variable-assignment>
<name>test</name>
<xpath>/web-app/context-param/[param-name="test"]/param-value</xpath>
<origin>planbased</origin>
<operation>replace</operation>
</variable-assignment>
</module-descriptor>
This works!
But I heard it could be possible to change the value of the variable from the administration console, is that true?
When I browse my application in the console (in the Deployment Plan tab or in the Configuration tab), I do not see any field which I could use to change the test variable... Am I missing something or must the values of overriding variables be set in the plan.xml file itself?
I do not think you can change the variable directly, I believe this is because it's a fundamental change to the deploy that requires a "hot update" BUT you can easily "redeploy/update" with a new plan. This is how you would do it in a production environment:
From the Weblogic admin console, click Deployments, click the checkbox next to your ear/war
Click Update
The next screen will ask you for the source path and the deployment plan path, you can change just the deployment plan path to set your new value(s)
You can also call java weblogic.Deployer with the update option if you want to do it from the command line.
It is also possible to do the same via WLST scripting - see these Oracle Docs
It seems to me the thread-max is always 128 no matter what I set:
Below is my config.
<server-default>
<jvm-arg-line>-Xmx2048m</jvm-arg-line>
<thread-max>64</thread-max>
</server-default>
<server id="" address="127.0.0.1" port="6800">
<-- More settings -->
<!-- Maximum number of threads. -->
<thread-max>20</thread-max>
</server>
Am I missing something about this? How do I get the config work?
I can set the value in by code:
com.caucho.util.ThreadPool.setThreadMax(6);
Had another problem with the com.caucho.util.ThreadPool.setThreadMax(6). If I debug or run through Eclipse, it is OK. However, when I run in the Cmd with ant, it reports: [java] java.lang.NoClassDefFoundError: com/caucho/util/ThreadPool exception.
I am using Resin 4.0.32 with Java 1.6_16. Eclipse version is 4.2 if this matters.
Any suggestion or comments are appreciated.
I found the problem,
The reason I get the exception when run with ant but didn't get it while in Eclipse IDE is because in the project, I am referring the resin.jar of version 3.0.21 and the API has been changed in resin 4.0.32 for ThreadPool related functions. It is no longer in com.caucho.util. When I debug using Eclipse, resin 3.0.21 is in the class path. But when I ran with ant, we are using resin 4.0.32.
I guess it is the same reason for the first question. I am not using the right function to read the stats.
Hope this helps.
I downloaded JBoss Application Server 5 and successfully deployed a war file. I copypasted the Hello.war which has a simple index.jsp file into
\jboss-5.1.0.GA-jdk6\jboss-5.1.0.GA\server\default\deploy
and it worked fine.
However when I used JBoss AS 7 and deployed the war file here, it did not get executed.
jboss-as-7.0.0.Final\jboss-as-7.0.0.Final\standalone\deployments
How to deploy it?
EDIT: I googled it but was not able to find info as JBoss AS 7 is relatively new.
Actually, for the latest JBOSS 7 AS, we need a .dodeploy marker even for archives. So add a marker to trigger the deployment.
In my case, I added a Hello.war.deployed file in the same directory and then everything worked fine.
Hope this helps someone!
Read the file $AS/standalone/deployments/README.txt
you have two different modes : auto-deploy mode and manual deploy mode
for the manual deploy mode you have to placed a marker files as described in the others posts
for the autodeploy mode : This is done
via the "auto-deploy" attributes on the deployment-scanner element in the
standalone.xml configuration file:
<deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir"
path="deployments" auto-deploy-zipped="true" **auto-deploy-exploded="true"**/>
I built the following ant-task for deployment based on the jboss deployment docs:
<target name="deploy" depends="jboss.environment, buildwar">
<!-- Build path for deployed war-file -->
<property name="deployed.war" value="${jboss.home}/${jboss.deploy.dir}/${war.filename}" />
<!-- remove current deployed war -->
<delete file="${deployed.war}.deployed" failonerror="false" />
<waitfor maxwait="10" maxwaitunit="second">
<available file="${deployed.war}.undeployed" />
</waitfor>
<delete dir="${deployed.war}" />
<!-- copy war-file -->
<copy file="${war.filename}" todir="${jboss.home}/${jboss.deploy.dir}" />
<!-- start deployment -->
<echo>start deployment ...</echo>
<touch file="${deployed.war}.dodeploy" />
<!-- wait for deployment to complete -->
<waitfor maxwait="10" maxwaitunit="second">
<available file="${deployed.war}.deployed" />
</waitfor>
<echo>deployment ok!</echo>
</target>
${jboss.deploy.dir} is set to standalone/deployments
Can you provide more info on the deployment failure? Is the application's failure to deploy triggering a .war.failed marker file?
The standalone instance Deployment folder ships with automatic deployment enabled by default. The automatic deployment mode automates the same functionality that you use with the manual mode, by using a series of marker files to indicate both the action and status of deployment to the runtime. For example, you can use the unix/linux "touch" command to create a .war.dodeploy marker file to tell the runtime to deploy the application.
It might be useful to know that there are in total five methods of deploying applications to AS7. I touched on this in another topic here : JBoss AS7 *.dodeploy files
I tend to use the Management Console for application management, but I know that the Management CLI is very popular among other uses also. Both are separate to the deployment folder processes. See how you go with the other methods to fit your needs.
If you search for "deploy" in the Admin Guide, you can see a section on the Deployment Scanner and a more general deployment section (including the CLI): https://docs.jboss.org/author/display/AS7/Admin+Guide
Just copy war file to standalone/deployments/ folder, it should deploy it automatically. It'll also create your_app_name.deployed file, when your application is deployed. Also be sure that you start server with bin/standalone.sh script.
open up console and navigate to bin folder and run
JBOSS_HOME/bin > stanalone.sh
Once it is up and running just copy past your war file in
standalone/deployments folder
Thats probably it for jboss 7.1
I am using JSF2 with Websphere 7 . I have created a shared lib successfully and have pointed application using Webpsphere Admin Console and it works successfully . But what we really want to do is to not have to point to that Shared Lib via WAS Admin Console but have some sort of application level configuration e.g in deployment.xml etc which we can point to the name of that Shared Isolated Lib and use it . I have gone through SO and google but not found any thing doing that . I however know that there are commercial application doing it but do not know how . This question from How can I specify a shared library reference at the web module level in Websphere 6.1 deployment descriptors? is closely what I am after but I not want to specify version numbers or jar names as the answer states
I found a way by simply following what WAS Admin Console was actually doing.
Create a deployment.xml in your EAR file if you do not have one already .
You will find a reference to class loader like below
<classloader xmi:id="Classloader_1311552732281" mode="PARENT_FIRST">
Modify it and add reference to the shared Liberary created on server like below
<classloader xmi:id="Classloader_1311552732281" mode="PARENT_FIRST">
<libraries libraryName="JSF2_SHARED_LIB" sharedClassloader="true"/>
</classloader>
#dbreaux has also shown a way .Accpeting my own answer as fits my needs better but big thanks to dbreaux too for advice.
Is the issue just that you don't want to have to configure each application separately, or that you don't want to use the admin console at all? You can associate a shared library with an entire server, which might be preferable to doing it for each app.
The other way to create those application associations is in the WebSphere-specific .xmi deployment files. These are created when you deploy but can also be included in WAR/EAR files. I don't know if that would help you at all. If it would, the official way to create them ahead of time is using one of the Deployment Tools, but since they're just XML, you may feel comfortable creating them manually.
To append extra details to Shahzeb's answer:
My environment: Websphere 8.5; Windows 7;(Eclipse Luna to generate testing .war file)
I have installed the war file exported from eclipse on websphere server by websphere console.
Then exported it again and unpack it to see what websphere automatically add to it to generate EAR.
[folder]META-INF
[folder]ibmconfig
[file]application.xml
[file]ibm-application-bnd.xmi
[file]ibm-application-runtime.props
[file]MANIFEST.MF
[file]was.module
[file]was.policy
[file]was.webmodule
[file]myWAR.war
And the file deployment.xml is placed in
..\ibmconfig\cells\defaultCell\applications\defaultApp\deployments\defaultApp\
whose content in form of
<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1417052686904">
<deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1417052686904" deploymentId="0" startingWeight="1" binariesURL="$(APP_INSTALL_ROOT)/[server service name]Cell/myWAR.ear" useMetadataFromBinaries="false" enableDistribution="true" createMBeansForResources="true" reloadEnabled="false" appContextIDForSecurity="href:[server service name]Cell/myWAR" filePermission=".*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755" allowDispatchRemoteInclude="false" allowServiceRemoteInclude="false" asyncRequestDispatchType="DISABLED" standaloneModule="true" enableClientModule="false">
<targetMappings xmi:id="DeploymentTargetMapping_1417052686904" enable="true" target="ServerTarget_1417052686904"/>
<classloader xmi:id="Classloader_1417052686904" mode="PARENT_FIRST"/>
<modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1417052686904" deploymentId="1" startingWeight="10000" uri="myWAR.war" containsEJBContent="0">
<targetMappings xmi:id="DeploymentTargetMapping_1417052686905" target="ServerTarget_1417052686904"/>
<classloader xmi:id="Classloader_1417052686905"/>
</modules>
<properties xmi:id="Property_1417052686904" name="metadata.complete" value="true"/>
</deployedObject>
<deploymentTargets xmi:type="appdeployment:ServerTarget" xmi:id="ServerTarget_1417052686904" name="server1" nodeName="[server service name]"/>
</appdeployment:Deployment>
(Since I have no reputation, I have to do it all in text.. )
I m trying to deploy a web application using netbeans to glassfish 3.01 but i m not able to do so
Glassfish says
Inconsistent Module State
the web app has some jars and a ejb jar for a local ejb
Open the domain.xml file that you will find in this folder:
"your glassfish installation"/domains/"your domain"/config
In this file look for your application deployment configuration to manually remove it:
1) Remove the web-module tag
<applications>
...
<web-module availability-enabled="false" context-root="yourapplicatoinContext" ... />
...
</applications>
2) Also remove the application-ref to your application:
<server config-ref="server-config" lb-weight="100" name="server">
...
<application-ref ... ref="your application name" ... />
...
</server>
Just try this:
undeploy
stop Glassfish
start Glassfish
deploy
If you can't undeploy, try the other steps anyway. If you don't have any luck, you could try it this way:
stop Glassfish
edit domain.xml (probably in domains/domain1/config)- back it up first; remove all references to your app (probably under application / application-ref); just make sure it's still valid xml
start Glassfish
deploy
It should have solved it. If still no luck anyway, remove every file or directory related to your app, probably under domains/domain1/generated and domains/domain1/applications/....
You could always recreate a new domain, but above steps will solve your problem.
You could be in such a situation after stopping Glassfish middle in a deploiyment, for example.
The other answers are really extreme. There is no need to create a new domain or re-install if you cannot redeploy your web application during development.
If you app is very complex, then consider scripting any clean up needed in a Production environment. The below steps will keep you up and working in the short term.
To re-deploy a web app to a single domain on Glassfish 3.1, do the following:
Stop Glassfish from the command line.
Delete all the files in the following directories:
glassfish\domains\domain1\generated
glassfish\domains\domain1\applications
Start Glassfish from the command line.
Deploy your app via the Admin Tool or command line.
In Glassfish 5, I searched for my app name in the domain.xml and deleted all the tags mentioning it. There was one occurence in the beginning (<system-applications>) and one at the end at approx. line 460 (<applications>). Then redeploy worked!