How to start the installation of ear on WebSphere? - websphere

It is required to install the application on the WebSphere via jython using the AdminApp class.
I delete through the method AdminApp.uninstall
wsadmin.bat -user alex19 -password qwerty19 -c "AdminApp.uninstall('MK.MyApplicaiton')" -lang jython
I want to use the installation method to install the same ear, but I did not succeed using the IBM documentation. Please tell me how to use the wsadmin.bat and AdminApp to install the application?
I get such an error, but the problem is that I do not know how to transfer the file with the properties and the configuration file:
C:\WSAS\bin>wsadmin.bat -user alex19 -password qwerty19 -c "AdminApp.install('C:/ear/my-applicaiton.ear')" -lang jython
WASX7209I: Connected to process "adminagent" on node KSDD using SOAP connector; The type of process is: AdminAgent
WASX7015E: Exception running command: "AdminApp.install('C:/ear/my-applicaiton.ear')"; exception information:
com.ibm.websphere.management.exception.AdminException
javax.management.MBeanException
com.ibm.websphere.management.exception.AdminException
com.ibm.websphere.management.exception.AdminException: ADMA0043E: C:\Users\Administrator\AppData\Local\Temp\app9157482086909190098.ear does not exist for installation.

WASX7209I: Connected to process "adminagent"
You ran wsadmin against an admin agent, which cannot run applications. You should install applications to a deployment manager (ND) or an individual application server (base/standalone application servers)

Related

Wsadmin connect to remote Profile, ADMA0043E exception

I am trying to install an application on websphere using wsadmin:
AdminApp.install('D:\work\my.ear',['-cluster', 'Vivaldi', '-MapWebModToVH', [['.*', '.*', 'default_host']]])
and get en error: ADMA0043E: /ibm/WebSphere/AppServer/profiles/AppSrv02/config/temp/upload/my5776587604736184411.ear does not exist for installation
Websphere is running as user1, wsadmin script from user2
it is possible to install the application via wsadmin from another user?
Thanks!
User2 doesn't have write permissions to /ibm/WebSphere/AppServer/profiles/AppSrv02/config/wstemp.
You'll need to allow user2 to write to this directory and subdirectories.
Additionally, the script may fail because user2 doesn't have permissions to the OSGI configuration. If so, you'll need to set a system property for wsadmin:
/ibm/WebSphere/AppServer/profiles/AppSrv02/bin/wsadmin.sh -lang jython -javaoption "-Dosgi.configuration.area=/home/user2/.eclipse" ...
It should be noted that IBM assumes that wsadmin.sh will always be run as the installation user, in this case user1. The official, supported way to do what you want is to install an "adminstrative client" as user2 either on this server on on another server. (and then specify the host and soap port) This will avoid the permissions issues.
Does the AdminApp.install comman work if you run WebSphere and install the app?

Application Issues in Migrating Websphere from 8.0.0.10 to Liberty profile

i'm trying to migrate WAS server 8.0.0.10 to Liberty Profile. So I downloaded the Migration Tool using the "Install New Software" option in the "Help" Menu just a week ago. I selected the "Migration Tools" -> "Websphere Application Server Migration" -> "Configuration Manager" -> "Websphere Configuration Migration Toolkit for Websphere". Followed below link steps http://www.ibm.com/developerworks/websphere/library/techarticles/1404_vines2/1404_vines2.html . But while executing comments in command prompt:
wsadmin -lang jython -c "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"
Getting Below error message :
C:\Users\DSIVARAM\WAS-profiles\8.0\SFQ\bin>wsadmin(.sh/.bat) -lang jython -c "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"
WASX7209I: Connected to process "SFQ" on node SFQNode using SOAP connector; The type of process is: UnManagedProcess
WASX7411W: Ignoring the following provided option: [(.sh/.bat)]
WASX7015E: Exception running command: "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"; exception information:
com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.websphere.management.exception.AdminException:
ADMA0144E: Application SourcingForQuality20031104 is installed with the zero binary copy option. Applications are installed using this option in a Rational unit test environment or using AppManagement MBean API.
When an application is installed using this option it is not possible to perform any operation on this application using wsadmin or administrative console that involves accessing the application metadata or EAR file.
Such operations include view/edit application information, export, export DDL etc. The only possible operations using wsadmin or admin console are start, stop and uninstall.
If this application is installed using WSAD unit test environment then use WSAD to view/edit application information.
Please help me to sort out the issue.
If you are running your server from development tool (Eclipse/Rad), change your server publishing settings from run resources from workspace to run from server , restart and redeploy application. You should be able to export then.
You won't be able to extract application information with extractConfigProperties if you have a zero-binary installed application. I think you can limit the extent of the extract using the -filterMechanism or -configData options to just extract the configuration needed by the application without extracting the application information itself.
See http://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/txml_7extractprops.html for examples.

Deploying ear file to IBM WEBSPHERE8 with wsadmin.sh

I am new to Websphere and I found many answers for *.ear file deployment. Most of them use format similar to "
./wsadmin.sh -host vmllkb056933n.myspace.com -port 5000 -c '$AdminApp> install /apps/test-app.ear'
I am always getting errors like:
WASX8011W: AdminTask object is not available. WASX7015E: Exception running command: "$AdminApp install /apps/cdm-fi.ear"; exception
information: com.ibm.ws.scripting.ScriptingException: WASX7206W: The
application management service is not running. Application management
commands will not run.
I am in a RHEL 6 Environment and runing IBM Websphere 8.5.5.3
What is the easiest way to deploy ear file to IBM Websphere 8.5.5
Make sure your are using the deployment manager wsadmin.sh and that the dmgr process is running. Also the port you reference should be the SOAP_CONNECTOR_ADDRESS of the dmgr. Referencing the cluster or server name in a federated environment tells the dmgr where to put the code, as in the two examples below.
$AdminApp install "myapp.ear" {-cluster clusterName}
or
$AdminApp install app_server_root/installableApps/DynaCacheEsi.ear
{-appname MyApp -cell myCell -node myNode -server server1
-filepermission .*\\.jsp=777#.*\\.xml=755}
Don't forget to save and syncnodes. As in the jython below.
AdminConfig.save()
AdminNodeManagement.syncActiveNodes()
Try this.
Syntax :
installApp $earFile $appName $destinationDir $serverName $nodeName $cellName $wasprofile

uncheck debug mode in Websphere Application Server through script

i need to uncheck Websphere Aplication Server debug mode through script,I'm WAS 7.0 server running on Windows 2008R2 64bit.
You should run wsadmin in your profile bin directory:
wsadmin.bat -lang jython -user *** -password ***
and in wsadmin promt:
AdminTask.setJVMProperties('[-nodeName node01 -serverName server1 -debugMode false]')
AdminConfig.save()
substituting node and server name, and select true of false.
And you can run this script as a file. Just add this two lines to, e.g. debugOff.py and call it as
wsadmin.bat -lang jython -user *** -password *** -f [real-path-to]/debugOff.py
You can disable debug mode even if Websphere is shut down. Open this file:
/usr/IBM/AppServer/profiles/<my profile>/config/cells/<my cell>/nodes/<my node>/servers/<server>/server.xml
Search for node jvmEntries, attribute debugMode="true" and set it to false. Start Websphere.

How to enable JMX on tomcat7 running as Windows service?

I have googled this extensively before posting it here. I've been trying to find out a way to enable JMX Access on a Tomcat instance installed as Windows service. Its quite straightforward when Tomcat is invoked via the startup.bat script, one just needs to set the CATALINA_OPTS environment variable to something like "-Dcom.sun.management.jmxremote.port=1234 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
But how do i get the Tomcat Windows service to read these options? I tried this:
C:>tomcat\server\bin> service.bat install #install the Tomcat7 windows service
C:>tomcat\server\bin> tomcat7.exe //US//Tomcat7 ++JvmOptions "-Djava.io.tmpdir=$INSTDIR\server\temp;-XX:MaxPermSize
=256m;-Dcom.sun.management.jmxremote.port=8090;-Dcom.sun.management.jmxremote.au
thenticate=false;-Dcom.sun.management.jmxremote.ssl=false" --JvmMs 256 --JvmMx 1
024 #update the installed service using the //US switch; set tmpdir, JMX access and heap size
When i start the service from Services panel, the service fails to start and i get the following error on the logs\tomcat7-stderr-yyyy-mm-dd.log file:
yyyy-mm-dd hh:mm:ss Commons Daemon procrun stderr initialized
Error: Invalid com.sun.management.jmxremote.port number: 8090 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
I don't have a Java background, am i trying to achieve something outlandish here? Please advise.
Answering my own question; turned out to be easier than i thought.
Following needs to be done, for enabling JMX access for Tomcat installed as a Windows service, that has a name "ApacheTomcatWindowsServer" for example:
Install Tomcat as Windows service, either using the command (first cd into \bin\ )
service.bat install
or your custom scripts.
Enable Apache Service Manager for the installed service using the following command:
tomcat7w.exe //MS//ApacheTomcatWindowsServer
This should start Apache Service Monitor program on your system tray. Click on its icon. select 'Configure', click on the 'Java' tab and append the following on the 'Java Options' text box, one option per line:
-Dcom.sun.management.jmxremote.port=8090
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
Save and exit and restart the service.
To connect to the JMX console, fire jconsole from your JDK installation, click 'New Connection', specify 'Remote Process' and enter hostname:8090.
you can also uninstall the service by
service.bat remove
then edit the service.bat and add the parameters in your StartPath and add the options
-Djavax.management.builder.initial=;-Dcom.sun.management.jmxremote.port=8090;-Dcom.sun.management.jmxremote.authenticate=false;-Dcom.sun.management.jmxremote.ssl=false
here is the sample StartPath in my file
--StartPath "C:\tomcat7\" --Startup auto --JvmOptions "-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-Djava.rmi.server.hostname=;-Djavax.management.builder.initial=;-Dcom.sun.management.jmxremote.port=8090;-Dcom.sun.management.jmxremote.authenticate=false;-Dcom.sun.management.jmxremote.ssl=false" %JAVA_OPTS% ^
re-install the service by
service.bat install
then start Tomcat to apply changes

Resources