WebSphere Classes loaded with local class loader first (parent last) over ssh - bash

I am running 9.0.0.11 WebSphere. To install a war file I go through GUI installer and on the last stage press View administrative scripting command for last action to see the command line syntax that I can use in my ansible-playbook.
I also need to set WebSphere Classes loaded with local class loader first (parent last) option in my app. How to do it over ssh or in ansible-playbook?

See IBM KnowledgeCenter topic https://www.ibm.com/support/knowledgecenter/en/SSEQTP_8.5.5/com.ibm.websphere.base.doc/ae/txml_classloader.html for wsadmin scripting commands to "Modifying class loader modes for applications using wsadmin scripting"

Related

OSGi in saaj environment [duplicate]

This question already has an answer here:
Apache Felix shell with SSH
(1 answer)
Closed 5 years ago.
In my local environment I use the "start.bat" file to start application bundle.
This is like as follows:
java -jar -ea -Declipse.ignoreApp=true -Dosgi.clean=true -Ddebug=true plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -console -noExit
OSGi is starting on the command prompt by the way I can list existing plugins. However the production will be a saaj environment and I think to start OSGi as a background process by installing a process manager package. Then my question is how to monitor it? How to start or stop the bundles? Do I need to use some monitoring tools such as Apache Felix web console to be able to make telnet connection? Is there an easy way (or common usage) to do on a cloud server?
Can someone inform me about this issue because I am new to OSGi concept?
After some further researches, I've found a solution for my situation. "-console" option of eclipse equinox (which is equivalent to "osgi.console") takes host and port parameters. So I 've changed my start script as follows(just added port number):
java -jar -ea -Declipse.ignoreApp=true -Dosgi.clean=true -Ddebug=true plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar -console 5555 -noExit
However this additional configuration needs some extra libraries and OSGi config changes. I had to place following jar files on the same folder with "org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar". That is the plugins folder in my environment.
org.apache.felix.gogo.command_0.10.0.v201209301215.jar
org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar
org.apache.felix.gogo.shell_0.10.0.v201212101605.jar
org.eclipse.equinox.console_1.1.0.v20140131-1639.jar
Secondly I have configured my config.ini file. It should contain following key/values:
osgi.bundles=org.eclipse.equinox.console#start, org.apache.felix.gogo.command#start, org.apache.felix.gogo.shell#start, org.apache.felix.gogo.runtime#start
osgi.noShutdown=true
eclipse.ignoreApp=true
After these changes, I can pass commands to the OSGi runtime from the command line by simply using a telnet connection to the port given. A tricky point is OSGi is always up until you termşnate OSGi console by typing 'exit' even if you terminate your ssh connection.
Reference: OSGi Modularity - Tutorial

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.

WAS Starting applications with scripting, Which bat or sh file will be called

Start the application:
The following example invokes the startApplication operation on the MBean, providing the application name that you want to start.
Using Jacl:
$AdminControl invoke $appManager startApplication myApplication
Using Jython:
AdminControl.invoke(appManager, 'startApplication', 'myApplication')
I wanna know which bat or which sh file will get invoked as a result of the above script which is invoked implicitly by WAS Integrated Solution Console when anyone try to:
Navigate to http : // IP:PORT /ibm/console/login.do
Applications > Application Types > WebSphere enterprise applications
Highlight/Checkbox/Select Any Enterprise Application fro the list of Enterprise Applications listed.
Press Stop/Start
I was expecting this action to invoke %WAS_HOME%\profiles\AppSrv01\bin\startServer.bat
But I couldn't find the echo messages I put in that file in any log file
This is all implementation details, but the admin console doesn't actually use any scripts. Instead, it uses JMX directly to invoke the same MBean ApplicationManager start/stopApplication operation that the Jacl snippet does.

unable to start Websphere Application server from RAD

I am using WAS 6.1 for my application development. I have created profiles and configured the JDBC providers and datasource. When i was trying to start the WAS from RAD, i am getting a time out error along with the below information in the RAD console:
Usage: AppServer/java/bin/java [-options] class [args...]
(to execute a class)
or AppServer/java/bin/java [-jar] [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-? -help print this help message
-X print help on non-standard options
-assert print help on assert options*
anyone is having any idea?
Got the same error, it's a bug with RAD creating a buggy script to optimized Websphere server for development.
One workaround is to disable RAD script generation for Websphere.
Double click on your Websphere instance (in the server view), then on the bottom left, uncheck the select box:
Server
-> Optimize server start for development:
--> [ ] "Start server with a generated script".
Then you should be able to start your server in RAD.
More info on this issue on the IBM website.

How to stop/start specfic WebSphere-deployed EAR from command line?

I'm throwing a dependency jar into my exploded EAR on WebSphere app server. I need to stop/start the EAR to get WS to execute the new code. Is there a way to do this from command line?
Try running something like this:
/opt/ibm/websphere/appserver/profiles/<MyProfileName>/bin/wsadmin.sh -c "AdminControl.invoke(AdminControl.queryNames('type=ApplicationManager,process=<MyServerName>,*'),'stopApplication','MyAppName')" -lang jython
It will prompt you for a WAS Userid and password (in case you have enabled "Administrative Security") and when you enter them - provided your userid has at least been assigned the Operator Role - your application will be stopped.
In a similar way you may start the same application.
You should be able to manage that using the wsadmin command line tool provided as a part of your WAS installation. Pretty much any administration task can be scripted using this tool.
I don't know the specific command to do what you've asked but here is a link to the documentation that should help get you going.
http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Ftxml_script.html

Resources