Automatic cleanup for tmp/_WL_User in weblogic - weblogic

We have weblogic 10.3.6.0 installed on windows server. We have stagging deployments enabled.Deployment process consists of undeployment for the old application and deployment for the new application vie python script. Each deployment consists of several .war files.
All .war files are versioned, ex:
application-a-123.war
applicatiom-b-222.war
The problem is that following directory is not cleaned after deployment:
C:\oracle\middleware\user_projects\domains\myApp\servers\SERVER-xy\tmp_WL_user
As the result there are many directories left from older deployments.These directories take to much disk space on server.
Is there a possibility to force weblogic to delete non-used folders in this directory? Or maybe modify deployment process, so older folders will be deleted after deployment?

Related

Hot Swapping Webapp Files

I am running my application in production mode (war is not exploded) on a Glassfish server and I want to know if it's possible to hot swap my front end files?
Currently when I do a hot swap, it only does it in the backend (it being Java). Is it possible to also do it for files under the webapp directory?
The Run/Debug Configuration window for Glassfish-within-IntelliJ supports hot deployment:
For exploded artifacts, the available options are:
Update resources. All changed resources are updated (HTML, JSP, JavaScript, CSS and image files).
Update classes and resources. Changed resources are updated; changed Java classes (EJBs, servlets, etc.) are recompiled.
etc
Looks like you need to choose the Update Resources option.
More details in the docs.
Update 1: for packed (i.e. unexploded) artifacts the available options are:
Hot swap classes. Changed classes are recompiled and reloaded at runtime. This option works only in the debug mode.
Redeploy. The application artifact is rebuilt and redeployed.
Restart server. The server is restarted. The application artifact is rebuilt and redeployed.
There is no support for hot deploying 'front end files' in a unexploded artifact.

How can I backup .wlapp?

When I install (upload) new .wlapp file in application's console, I would like to make backup of the existing application set up. I am not sure where unZIPed wlapp files located after they uploaded via console, so I don't know, which folder to backup.
Also, is .wlapp makes modification of database and filesystem backup is not enough in this case?
Or, rephrase question: what can I do to backup current wlapp before trying new wlapp install. So I can safely back out if anything went wrong?
The .wlapp is located in the following location inside of your workspace:
/"WORKSPACE_NAME"/"PROJECT_NAME"/bin
On a successful build of your project the .wlapp for your environments will be found in the above location. You will see environment specific .wlapps as well as one that includes all of the environments. If you wish to backup these files you can simply copy them to another location after a successful build. Also as a note if you update the version of application environments inside of your applicationDescriptor these wlapps should manage each specific version in the bin folder as well. For example:
FormBasedAuthApp-iphone-1.0.wlapp
FormBasedAuthApp-iphone-2.0.wlapp
Once the wlapp is deployed it is actually stored in the database and it is much harder to guarantee exporting this resource. Please look Idan's post here for suggestions on this topic:
IBM Worklight - How to retrieve an already-deployed .wlapp file?
The wlapp file once uploaded to Server becomes a part of Database and can not be retrieved as a normal file for backup.
The best practice is to keep the wlapp file in a separate backup and also making sure that you change the version before building a new wlapp (especially for the production environment)

Worklight console app, update

We're using Worklight 6.1.0.0 / WebSphere 8.0.0.2 (ND/aix).
This seemed pretty close to my question too, but for version 6.0.
I've successfully done uninstall/install to our worklight console war package. However, there is some extra work on re-deploying adapters and such. I was looking for a way to just update the console. Among the ant tasks there is a target 'minimal-update', which sounds like what I'm looking for (is it?). However when all other pieces fell into place, I have an error for mapping the datasources:
ADMA0007E: A validation error occurred in task Mapping resource references to resources. The Java Naming and Directory Interface (JNDI) name is not specified for resource reference jdbc/WorklightDS in module Worklight with EJB name .
Contents of the 'minimal-update' task is pretty much the same as for 'install'.
I tried that as update from websphere admin console (but i should use the ant task - right?), that gave me a wizard screen to map jdbc/WorklightDS from package to jdbc/WorklightDS on server. This left me wondering how could I tell this using the ant task.
The ant target minimal-update of the sample configuration files documented at http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/topic/com.ibm.worklight.deploy.doc/devref/c_ant_tasks_sample_config_files.html is meant to update a WAR file already deployed (and not uninstalled). In particular, on WAS, it assumes that the JNDI datasources are in place.
If you have uninstalled the WAR file, you should use the target install instead, provided that your databases were created for Worklight 6.1.
If they were created for a previous version of worklight you must upgrade their schema as well running the target 'databases' (and if it's a production installation, you might want to read all the steps in detail at http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/topic/com.ibm.worklight.upgrade.doc/devenv/c_upgrade_to_srvr610_in_production_env.html )

Where Jboss7.1 take war application to deploy

I've deployed the jboss-as-helloworld-errai application in my standalone jboss7.1 instance, and I deleted it later ( in the */standalone/deployments folder). But every time I restart my server it redeploys that application.
Is there another place where jboss reads the application to deploy?
Best regard
Did you delete the file while the server was running?
Probably, JBoss still finds a deployment information in one your /standalone/configuration/standalone*.xml files (at the end of the file). JBoss unpacks its deployments in one of the /standalone/tmp/vfs/temp* folders. As long as it finds a deployment in your configuration file, it will start the application.
The deployment binaries are located under the standalone/data/content. These would also need to be deleted. The best solution is to properly undeploy the application via CLI, the maven plug-in or the web console.
This does not sound like expected behaviour. Can you please confirm the steps that you are taking when using the deployment folder? For example:
Deploy
Copy application file to /standalone/deployments folder
Deployment Scanner creates a .dodeploy marker file
Deployment Scanner picks up application and creates a .deployed marker file
Application confirmed as deployed (checking the Management Console to confirm)
Undeploy
Application deleted from /standalone/deployments folder
Delete application (or) delete .deployed marker file
Deployment scanner undeploys the application and creates .undeployed marker file
Confirm application removed in console
Restart server
Confirmed removal is persistent
The README.txt file in the deployments folder shows the simple undeployment workflow in one easy step in the command line.
rm $AS/standalone/deployments/example.war.deployed
Documentation
You can read more about the deployment scanner in the official docs. There's a topic about the scanner marker files, as well as a parent topic about the scanner and deployments in general. If you are finding issues with the scanner, it's a bug. You might like to test the expected behaviour, and also try the Management Console.
Red Hat Docs - Reference for Deployment Scanner Marker Files
Red Hat Docs - About Application Deployment
Potential Issues
Don't confuse the Deployment Scanner subsystem (which watches the Deployments folder for the Standalone server instance) with the Management Console or Management CLI deployments process. You might be better off using one of the Management tools instead of the hot deployment capability to allow for more control over the state and presence of your application.

When a class file change, Can I make the glassfish server not restart but still reflect the change?

When a class file change, Can I make the glassfish server not restart but still reflect the change ?
I mean the glassfish sever doesn't redeployment(or publish) the application, but only redeployment the class that has changed.
There are a number of ways to redeploy an application onto GlassFish 3.1 that do not require that you restart the server.
The method I would recommend is 'asadmin redeploy --name foo --keepstate=true foo.war' (or use directory deployment for the web app...)
You can look at the man page for the redeploy subcommand of asadmin to learn more about the details.
I hardly ever create a deployable archive file.... I usually do directory deployment, which eliminates the time that would get used up creating and then exploding the archive file.
By using directory deployment I can also apply tweaks to jsp files and other static content to test them without a rebuild/redeploy step.
I like to use the keepstate option while I am doing development.
Another important step that you should take to avoid unnecessary restarts is to move to an open-source OS like Linux or Solaris (away from Windows) which has few file locking problems.
If this is meant to be done while development, you can give a shot to JRebel.