Increasing the JTA Transaction Timeout value using WLST with property file - weblogic

I want to increase the JTA Transaction Timeout value using WLST and a property file with the key
domain.jta.timeout = 350
So I run this but nothing happens !
C:\wls12130\wlserver\server\bin>java weblogic.WLST -loadProperties increaseJtaTimeout.properties
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline>

I know of two ways.
1) from console you can change. login to weblogic console > Click on domain name > click on configuration > JTA > update "Timeout secounds" to whatever value you want.
2) you can set by wlst. for wlst you need to update in online mode.
For that you need to connect to Admin server using connect().
invoke wlst. run each command individually.
connect(d'omainuser', 'domainpassword','t3://adminhost:port')
edit()
startEdit()
cd('/JTA/domainname')
setTimeoutSecounds(value)
save()
activate()
you can put all individual commands in python script and run
it. invoke wlst and pass the python script as argument.

Related

Finalize wsadmin script task "createAuthDataEntry"

I have a follow-up question to this issue: is it possible to finalize the AdminTask.createAuthDataEntry task in one wsadmin script?
I need to invoke this task so that WAS can establish a connection to a datasource that I have defined in the same script.
Defining an auth entry from the web console does not require a restart. Typically I would not expect that a restart would be required for authentication changes.
I have tried to use the task AdminControl.invoke(AdminControl.queryNames('WebSphere:*,type=Server,node=%s,process=%s' % ('node', 'server')), 'restart') inside the script, but this stops the instance without booting it up again. Also, I cannot verify the datasource connection within the same script because of these limitations.
Creating or modifying authentication data entries from wsadmin requires a server restart. We have an RFE to allow wsadmin to make dynamic updates to them without a server restart which you can vote for. In order to stop and start your server using wsadmin, it's probably easiest for the OS-level (bat or sh) script that invokes wsadmin to call two scripts.

Stop weblogic server forcefully using command line

I want to shutdown weblogic server using command line FORCEFULLY. I have a specific scenario. I have written a batch file to do some stuff and then shutdown weblogic server using stopWebLogic.cmd as follows:
"%WEBLOGIC_DOMAIN_PATH%\bin\stopWebLogic.cmd"
I have gone through this document. But I can't follow the approach since I don't want to change stopWebLogic.cmd. Is there any way to achieve this?
A WLST script is probably the way to go. See the shutdown command which has an optional 'force' parameter.
N.B. On UNIX/Linux you can send a SIGTERM signal to the pid of a weblogic server which will perform a force shutdown. i.e. kill -term pid
You can use an existing file if you configure it to force the shutdown
head to bin/stopWebLogic.sh
Then modify the following line
echo "shutdown('${SERVER_NAME}','Server', ignoreSessions='true')" >>"shutdown.py"
to
echo "shutdown('${SERVER_NAME}','Server', ignoreSessions='true', force='true')" >>"shutdown.py"
Then execute the file using bash stopWeblogic.sh
The weblogic will be stopped, even if active sessions or listeners exist.

How to Test DataSource connection in JBoss EAP 6.2 Managed Domain

I am trying to port an application from WebLogic to JBoss EAP 6.2.
When running the standalone server in JBoss, in the admin console there is a button and in the command line interface there is a command line option to check the data source connection.
/subsystem=datasources/data-source=myds:test-connection-in-pool
These options do not appear to exist in either place when running the "domain" server. Am I missing something? Is there some further setting I must make to enable it? I tried a technique which is sometimes an analog in the domain server and it doesn't work here.
/profile=full/subsystem=datasources/data-source=myds:test-connection-in-pool
JBoss docs are much weaker for "domain" model than for "standalone".
You are absolutely correct that while running the standalone server in JBoss, in the admin console there is a button and in the command line interface there is a command line option to check the data source connection butThese options do not appear to exist in either place when running the "domain" server.
You still can use the command line of jboss-eap-6.x to test the configured data source connection in domain server. You need to navigate to $JBOSS_HOME/bin/ and execute script: jboss-cli.sh
Connect to the domain server controller with: connect :PORT_NO and execute the following commands:
For XA-DataSource:
/host=$Host_Controller_Name/server=$Server_Name/subsystem=datasources/xa-data-source=DataSource_JNDI_Name:test-connection-in-pool
For Non-XA-DataSource:
/host=$Host_Controller_Name/server=$Server_Name/subsystem=datasources/data-source=DataSource_JNDI_Name:test-connection-in-pool

wlstModule connection information lost

When using wlst with a WebLogic 10.3.5.0 release I am puzzled by the following situation and hoping for an answer.
Given a standard wlst command to connect to a server
connect('weblogic','welcome1','t3s://localhost:7002')
it connects as expected to the AdminServer in my domain and presents the following prompt:
Connecting to t3s://localhost:7004 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
wls:/base_domain/serverConfig>
However, if I perform the following command
import wlstModule as wlst
wlst.connect('weblogic','welcome1','t3s://localhost:7002')
I get the following response
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
wls:/offline>
The situation I have is I have a common module for connecting the AdminServer and whilst the connection is successful, any other functions revolving around requiring a serverRuntimeConfig(), etc, do not work as it thinks it is not connected.
Does anybody have any idea on the correct mechanism for using the second approach for connecting and what else needs to occur to retain the connection state when using the imported wlstModule.
After struggling with this very problem, I seem to have found the answer.
after you start with java org.python.util.jython, you get a prompt.
>>>
here you can do
import wlstModule as wlst
hencefort you should use the wlst all the time!!
wlst.connect()
a = wlst.cmo.getServers()
print (a)
greetings,
Saulius

WebLogic 10 WLST command to stop a deployment

Is there a WLST command to stop a Weblogig deployment? (i.e. the opposite of the nmStart() command)
If so, what is it?
I am changing database passwords and I want to shutdown all deployments so all connections will close. Currently I have to log into the console to shut everything down and I am looking for a quicker way.
I'd say nmKill but I'm not sure about the terminology you are using. The nmStart is used to start a server in the current domain using Node Manager, not to start a "deployment".
By the way, the WLS Console provides a recording feature that writes out the edits you make in the console to a WLST script. This can be very handy if you are not a WLST expert. To turn on recording, click 'Record' (in the the toolbar near the top of the page). Then, make your edits in the console. Finally, turn the recording off when you're done.
The more usual method, which is independant of whether you're using node manager or not, would be the shutdown command which is also able to work at the cluster level.