Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to write jacl script?

 
Nitin Jawarkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Anybody have idea about how to write jacl script in WebSphere Application Server? I am trying to this for wsadmin.


Thanks
Nitin...
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some documentation is available here. The Jacl home page is here.
 
Steve Wink
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nitin Jawarkar:
Hi,

Anybody have idea about how to write jacl script in WebSphere Application Server? I am trying to this for wsadmin.


Thanks
Nitin...


One piece of advice about JACL - don't use it unless you really have to. We've found that it adds a significant amount of effort to a project, and other people on an IBM course with me had similar experiences.
 
Scott Selikoff
author
Bartender
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you recommend aside from JACL?
 
Nitin Jawarkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks
But i have to use jacl script for installing,updating EAR files as well as to change the configuaration files. And right now i want know how that jacl script write. So please send me the links which would be helpful for me.
 
Steve Wink
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Scott Selikoff:
What do you recommend aside from JACL?


I'd recommend looking at the design to see if there is a need for JACL. And if you have to use it, be aware of how long tasks may take when estimating. Sometimes there is no escape, just mitigation of its effects on productivity. Other people have used Jython or JMX. I'm pretty sure they use the same underlying wsadmin object model. I don't know how they affect productivity compared to JACL.

There are samples here:
http://www-128.ibm.com/developerworks/websphere/library/samples/SampleScripts.html
 
Nitin Jawarkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve,

Could you tell me is possible to use the jacl script for production server.
Beco'z suppose admin console is disable then, i belive wsadmin is the only way to control the WAS server, so there could be some repeatative task that i need to put in script, at that jscl comes into picture, so can i do the same task through script?
 
Steve Wink
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nitin Jawarkar:
Thanks Steve,

Could you tell me is possible to use the jacl script for production server.
Beco'z suppose admin console is disable then, i belive wsadmin is the only way to control the WAS server, so there could be some repeatative task that i need to put in script, at that jscl comes into picture, so can i do the same task through script?


Yes it is possible. However, we've found some customers don't like 3rd party scripts accessing their production servers for security reasons.
 
Bryan Mac
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wsadmin is the tool for updating WebSphere administered objects as well as any MBeans that you register with WebSphere.
jacl and Jython are 2 scripting languages that wsadmin understands;

Here is the jacl script i use to invoke a method on an MBean i registered to allow dynamic update of Log4jLogLevels

set objNameString [$AdminControl completeObjectName type=Log4jConfigUpdater,process=server1,*]
set objName [java::new javax.management.ObjectName $objNameString]
set parms [java::new {java.lang.Object[]} 2 {org.kp.wpp.is DEBUG}]
set signature [java::new {java.lang.String[]} 2 {java.lang.String java.lang.String}]
$AdminControl invoke_jmx $objName updateLogLevel $parms $signature

the bean is registered using spring;
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter"
lazy-init="false">
<property name="beans">
<map>
<entry key="Log4jConfigUpdaterMBean" value-ref="log4jConfigUpdater" />
</map>
</property>
<property name="namingStrategy" ref="websphereNamingStrategy" />
</bean>

<bean id="websphereNamingStrategy" class="org.kp.wpp.util.spring.WebspherObjectNamingStrategy">
<property name="domainName">
<value>WebSphere</value>
</property>
<property name="cellName">
<value>fvm64-1Node06Cell</value>
</property>
<property name="nodeName">
<value>fvm64-1Node06</value>
</property>
<property name="processName">
<value>server1</value>
</property>
</bean>

<bean id="log4jConfigUpdater" class="org.kp.wpp.is.ws.log.Log4jConfigUpdater">
</bean>
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!