Use weblogic admin console to manage custom configuration files? - java

Is there any way I create or upload a configuration file to weblogic server. The configuration file will be used by a java application deployed on the weblogic server. But I can use weblogic server admin console to update this configuration file and don't have to have someone go to the server and find this file and update it in an text editor.
Is this possible? If so, how can I do this.

You want Deployment Plans for your app. They allow you to customise an EAR or WAR's internal settings.
Bear in mind that early versions of WLS 11g had a bug where specifying a deployment plan at the same time as uploading an app didn't work through the console, and you had to upload, then apply the deployment plan in a separate step (or use WLST or a maven plugin to do it)

Related

osgi - How can I access an OSGi console specific to my EBA file on WebSphere Liberty?

I have deployed an EBA file, consisting of some OSGi bundles, on Websphere Liberty (It is simple example code, and works as expected, no issues there).
How do I access the OSGi console on which the bundles installed within my application would be displayed? I am not referring to the server's OSGi console, which I am able to access, but the console specific to my application.
If there is no such console by default, how do I add a console to my application?
If you pick up the latest Liberty profile beta you can configure the osgiAppConsole-1.0 feature which will make a web based console available for seeing the content of the OSGi application.
There is a blog post on how to use this on wasdev.net

How to reconfigure log4j of a war file from another war file deployed in same tomcat

I have two war files WARA and WARB deployed in a tomcat, both use same log4j properties file. How to reset the log4j configurations in both war files through another stand alone application deployed in same tomcat without disturbing WARA and WARB? Is it possible to do?
If polling is an option you can use PropertyConfigurator.configureAndWatch().
More here.
If you need to do it manually the process is bit longer. On a high level its as follows.
Configure JMX for your application server / servlet container.
Write an MBean to trigger full reconfiguration.
Register the MBean in WARA and WARB.
Connect to the MBean server from the other webapp.
Invoke the MBean in WARA and WARB.
If you can provide more details on what software stack your are using I may be able to provide specific details on how to do the above.
not the best way , but make a jar file that contains properties file ,and place it tomcat lib folder ,all applications use same propertyfiles.

Viewing Deployed Apps in Weblogic Server

I am new to weblogic and I would like to find out how my files are arrange in Weblogic?
I have used only Tomcat and this is the first time where I will deploy in a Weblogic Server.
In Tomcat, I could view the exploded view of my projects by looking at the Tomcat Home Directory
and the WebApps folder. There I could view how my application css/js/resource files are deployed.
%TOMCAT_HOME%\webapps
I am looking for a similar functionality in Weblogic? Can somebody tell me how? Thanks
I am using Weblogic 10.3.4 by the way
WebLogic supports several different ways of deploying applications, so the answer to your question is not very straightforward.
Typically, if you deploy a war/ear, then WebLogic will place them in the $WEBLOGIC_HOME/application directory. WebLogic will then explode your ear/war into a separate wl_stage folder that will be under your managedServer directory.
You can also use the ability of WebLogic to autodeploy ( not recommended for production apps ) where WebLogic will automatically explode the app.
In summary, you probably need to reach for the documentation to get all your questions answered.
http://download.oracle.com/docs/cd/E13222_01/wls/docs81/deployment/overview.html
I'm not quite sure if you want to find out where to deploy or where applications have been deployed.
But if you want to see where are the deployed applications in weblogic, you can go to its console (e.g. localhost:7001/console) after start the server. Then follow the following steps:
Find and click "Deployments" label
Find and click your application in the right panel
Click "Overview" tab, then you will see "Path" in the opened information table.

How a war file gets deployed in any application server?

I know that when a war file is created of my web application, i have to deploy it, that is if i am using JBoss i have to copy it to deploy folder and if using WAS i have to install it.
But i want to know, When i start the server from where the server starts deploying my application. that is which is the entry point to start loading my classes, properties ,DB connections etc..
Thanks.
It's the web.xml file, which is known as the deployment descriptor. This is where you configure your servlets and filters. In particular, you map urls to servlets, and this is the entry point into your application. The classes are loaded on startup, before any requests are handled.
Here is a link to more information about deployment descriptors.

How do I push an update to a war file to clients?

Assuming my clients are running my J2EE WAR application on their intranet, and I have an update for them... how do I push the updated war file to them?
I'd like it to be automatic and require no human interaction on the client's side.
Can this be done?
Any help would be appreciated.
Tomcat (if this is your target container...) offers a manager interface that will allow you to deploy/start/stop applications.
I have used both ant and maven tasks to great effect in deploying wars remotely all while being built-in to the build process.
Depending on your deployment process, this may not work for you, but for dev & qa: highly recommended.
Edit: of course apache has to be configured for this type of access to be allowed.
See: Deployer how-to
Glassfish has documentation on deployment here.
Ant tasks are also available here.
Glassfish uses Tomcat internally, but the Tomcat Manager is not available as it is a separate application.
If the glassfish admin console can be accessed, it can be used to upload and deploy war files.
I'm not sure if you're comfortable giving them access to your source code repository...even in read-only mode.
If you are, then you could script up something in ANT to check out the latest version of the source code (using CVS task) and then build the .war file (using WAR task).
The only trick would be automatically deploying it once the war has been built. Tomcat will automatically deploy applications copied into a certain directory. For Websphere, see this question and this question.
For other J2EE servers I don't know how it would be done.

Categories

Resources