Friday Sep 05, 2008

Closest Matching Commands are now in GlassFish v3

asadmin's closest matching commands is a popular feature in GlassFish v2 but it wasn't working in v3 for the remote commands.  Since GlassFish v3 is based on modularization, commands are now modularized.  If a module is installed, the commands for that module are available in asadmin.  For example if you have JBI module installed, commands relating to JBI are available in asadmin.  Yes, that means commands in asadmin are extensible and pluggable.  It also means that it's harder for the users to know which commands are available to use.

There is a list-commands command that lists all the commands in asadmin but it's not easy to find the commands that you want if there are 50 or more commands.  With the closest matching commands feature in GlassFish v3, it's easy to search for commands.

To search for "jdbc" commands:

Using regular expression to search for commands that start with "list": 

asadmin will also catch typos: 

This feature is available in GlassFish v3 promoted b23 build

Thursday May 31, 2007

Ant support in GlassFish

During JavaOne I was told that people were asking if GlassFish has ant tasks support.  

The answer is YES, GlassFish provides an ant utility called "asant".  "asant" is a wrapper script that calls ant.  ant 1.6.5 is included in GlassFish V2.  Using "asant" will allow you to use the built-in ant tasks to administer/configure/deploy application to GlassFish Application Server. 

Following are the supported built-in ant tasks:

Following tasks are new in GlassFish V2:

asant is located in your <GlassFish-install-dir>/bin or <GlassFish-build-dir>/public/glassfish/bin.  It's in the same directory as asadmin.

Thursday May 10, 2007

Who's behind Admin CLI and GUI?

Here we are.... Jane (me on the left) and Anissa, the Admin CLI and GUI Team in JavaOne 2007:
 

 
 

Tuesday May 01, 2007

Blog about GlassFish for a chance to Win a 52-Inch LCD HD TV

Not only is GlassFish V2 the first OpenSource AppServer with clustering and loadbalancing support, it also includes the following:

Since I work on the Command Line Interface module of GlassFish, I would also like to add that GlassFish has the best CLI support.  Yes, you can say I'm biased, but let me give you my reasons:

  • User Friendly (asadmin is CLIP compliant so commands/options are simple, intuitive and resemble  Unix commands)
  • Environment Variable Support for Option Values (set AS_ADMIN_<option_name>=<option_value> in the OS environment and you don't need to specify it on the command line.   This feature does not support password option)
  • Comprehensive manpage built-in (asadmin <command> --help or asadmin help <command> will display Unix like manpage of the command)
  • Password  Security (passwords are not visible on commad line)
  • Finding Closest Matching Commands (see previous blog

I'd love to have a new TV but I am not qualified to participate in this contest :-(  so I encourage you all to blog about GlassFish for a chance to win a 52-inch LCD HD TV.  

BTW:  This contest is open to outside of US.  See contest disclosures for list of countries.

 

Fish for a Flat Screen TV
Blog about GlassFish for a chance to win a 52" LCD HD TV. ยป More

Wednesday Apr 04, 2007

New and Improved CLI Monitoring in GlassFish V2

Before GlassFish V2, the only way to monitor attributes in CLI is using the "dotted-name" get command.
asadmin get --monitor (-m) dotted name...

The output looks like this for jvm uptime:

>asadmin get -m server.jvm.update-time
server.jvm.uptime-count = 1115738
(in millisec)

If user would like to monitor multiple attributes,  they would have to provide the "dotted-names" as operands:  "asadmin get --monitor <dotted-name1> <dotted-name2>...

This is rather cumbersome since user will need to find out the dotted-names for the attributes plus the output is difficult to read for multiple attributes.  In addition,  the output cannot be saved to a file for further analysis.

In GlassFish V2, there is a new command called monitor.
The output of the monitor command models Unix's vmstat.

The syntax of the monitor command is as follow:

monitor --type monitor_type --user admin_user [--terse=false] [--echo=false] [--interactive=true] [--host localhost] [--port 4848|4849] [--secure | -s] [--passwordfile file_name] [--interval 30] [--filter filter] [--filename filename] instance_name

To monitor jvm in server instance:

>asadmin monitor --type jvm --interval=5 server

The filename option allows user to save the monitoring attributes to a file in comma separated format.

The type option can have the following values:  httplistener, keepalive, filecache, connectionqueue, jdbcpool, jvm, threadpool, servlet, connecton, connectorpool, endpoint, entitybean, messagedriven, statefulsession, statelesssession, httpservice, webmodule.

The filter option is used to filter out multiple elements.  For example if --type is httplistener and there are two httplisteners in server instance (admin-server), the --filter option is used to specify the httplistener you'd like to monitor.

i.e.
>asadmin  monitor --type httplistener --filter http-listener-1 --interval=5 server


The heading may look a bit crypted, but when you type the "h" key a legend is displayed:

 


To exit from the monitor command, press the "q" key.

<<>>Hope this new feature can help user monitor GlassFish and ensure that your application is running efficiently.>

Download GlassFish V2 and give this feature a try.

<script type="text/javascript" src="http://www.google-analytics.com/urchin.js"> </script> <script type="text/javascript"> _uacct = "UA-1759290-1"; urchinTracker(); </script>

Thursday Nov 30, 2006

Finding CLI commands in GlassFish is now easier and better

Have you ever stumbled upon what commands to use in asadmin?
Have you ever mistyped a command and the following message is displayed?

Use "help" command for a list of valid commands.
CLI001 Invalid Command, list-component.

And when you execute "asadmin help",  the manpage scrolls down the screen with 200 commands.
Finding the right command is not easy, especially searching through the 200 commands listed in the manpage. 

For those who fall in the above scenario, I have good news to bring to you.
Starting in GlassFish V2 build 26, asadmin will search for the closest matched commands if the command cannot be found.

Let me give you some  examples.
Say that you mistyped "create-domain":

asadmin create-domian  options...

returns:

CLI001 Invalid Command, create-domian.
Closest matched command(s):
    create-domain

Use "help" command for a list of valid commands.

asadmin is able to figure out the command that you're trying to execute is "create-domain", not "create-domian".  

Now, say that you want find the commands associated "jdbc".

On the command prompt, type:

asadmin jdbc

returns all the commands with "jdbc":

CLI001 Invalid Command, jdbc.
Closest matched command(s):
    create-jdbc-connection-pool
    create-jdbc-resource
    delete-jdbc-connection-pool
    delete-jdbc-resource
    list-jdbc-connection-pools
    list-jdbc-resources

Use "help" command for a list of valid commands.

You can even use regular expression to search for the commands.

asadmin "resource$"

returns all the commands that ends with "resource":

CLI001 Invalid Command, resource$.
Closest matched command(s):
    create-connector-resource
    create-custom-resource
    create-javamail-resource
    create-jdbc-resource
    create-jms-resource
    create-jndi-resource
    create-persistence-resource
    delete-connector-resource
    delete-custom-resource
    delete-javamail-resource
    delete-jdbc-resource
    delete-jms-resource
    delete-jndi-resource
    delete-persistence-resource

Use "help" command for a list of valid commands.

You can narrow down the search by adding more regular expressions:

 asadmin "\^create.\*resource$"

returns all the commands that begins with "create"and ends with "resource":

CLI001 Invalid Command, \^create.\*resource$.
Closest matched command(s):
    create-connector-resource
    create-custom-resource
    create-javamail-resource
    create-jdbc-resource
    create-jms-resource
    create-jndi-resource
    create-persistence-resource

Use "help" command for a list of valid commands.

This feature also applies to the "help" command.  When a manpage cannot be found for a command, a list of closest matched commands is displayed.

If you find this feature interesting and want to give it a try, download the latest GlassFish V2. 

Click here... 

<script type="text/javascript" src="http://www.google-analytics.com/urchin.js"> </script> <script type="text/javascript"> _uacct = "UA-1759290-1"; urchinTracker(); </script>
About

janeyoung

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
News
Blogroll

No bookmarks in folder