JBoss Developer Recent Posts for Project JBoss MicroContainer2016-12-09T22:03:16.261-05:00http://dcp2.jboss.org/v2/rest/feed/?sys_type=blogpost&sortBy=new-create&project=jbossmc&feed_title=JBoss%20Developer%20Recent%20Posts%20for%20Project%20JBoss%20MicroContainerSearchisko3 years of WildFly Gource Animation2013-10-18T06:44:20-04:00searchisko:content:id:jbossorg_blog-3_years_of_wildfly_gource_animation2013-10-18T05:53:00-04:00Kabir KhanIt is all the rage now at JBoss to generate <a href="https://code.google.com/p/gource/">Gource</a> videos of the source code repositories for our projects giving some very pretty results.<br /><br />The first was <a href="https://plus.google.com/114192299541163451069/posts">Clebert Suconic</a>, the <a href="http://www.jboss.org/hornetq">HornetQ</a> lead: <a href="http://www.youtube.com/watch?v=4QI2FuKntpk">http://www.youtube.com/watch?v=4QI2FuKntpk</a><br />Then Tom Jenkinson from the <a href="http://www.jboss.org/narayana">Naranaya</a> (transactions) team: <a href="http://jbossts.blogspot.co.uk/2013/10/the-narayana-project-visualized-by.html">http://jbossts.blogspot.co.uk/2013/10/the-narayana-project-visualized-by.html</a><br /><br />Then finally we have <a href="http://wildfly.org">WildFly</a> for which all credit goes to Clebert both for running the Gource analysis and providing the cool backing track, showing the three years of WildFly development in about 3 minutes. Enjoy :-)<br /><br /><iframe allowfullscreen="" frameborder="0" height="344" src="//www.youtube.com/embed/vKRtfhCwDI4" width="459"></iframe><br /><br />I expect several more JBoss projects will do the same over the next few weeks. If Clebert is as helpful for others as he has been for us they will show up in his <a href="http://www.youtube.com/user/clebertsuconic?feature=watch">YouTube page</a>.It is all the rage now at JBoss to generate Gource videos of the source code repositories for our projects giving some very pretty results. The first was Clebert Suconic, the HornetQ lead: http://www.youtube.com/watch?v=4QI2FuKntpk Then Tom Jenkinson from the Naranaya (transactions) team: http://jbossts.blogspot.co.uk/2013/10/the-narayana-project-visualized-by.html Then finally we have WildFly for...Simpler Audit Logging Example for WildFly 8.0.0.Alpha42013-08-14T11:37:58-04:00searchisko:content:id:jbossorg_blog-simpler_audit_logging_example_for_wildfly_8_0_0_alpha42013-08-14T11:12:00-04:00Kabir KhanTomaz on the WildFly team pointed out that my <a href="http://kabir-khan.blogspot.co.uk/2013/08/setting-up-secure-audit-logging-to.html">previous blog post on secure audit logging in WildFly 8.0.0.Alpha4</a> was a bit too scary :-) So I'd like to point out that that was probably the most complicated setup possible, and to walk through a few simpler examples here while explaining a bit more what goes on. These features are available in WildFly 8.0.0.Alpha4 and later. You can get it from <a href="http://www.wildfly.org/download/">here</a>.<br /><br />WildFly out of the box comes preconfigured for audit logging to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$WILDFLY_HOME/standalone/data/audit-log.log.</span>, the only thing you need to do is to enable it. There is a section in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$WILDFLY_HOME/standalone/configuration/standalone.xml</span> which contains the configuration for the audit log:<br /><pre class="xml" name="code"> &lt;audit-log&gt;<br /> &lt;formatters&gt;<br /> &lt;json-formatter name="json-formatter"&gt;<br /> &lt;/json-formatter&gt;&lt;/formatters&gt;<br /> &lt;handlers&gt;<br /> &lt;file-handler formatter="json-formatter" name="file" path="audit-log.log" relative-to="jboss.server.data.dir"&gt;<br /> &lt;/file-handler&gt;<br /> &lt;/handlers&gt;<br /> &lt;logger enabled="false" log-boot="true" log-read-only="false"&gt;<br /> &lt;handlers&gt;<br /> &lt;handler name="file"&gt;<br /> &lt;/handler&gt;&lt;/handlers&gt;<br /> &lt;/logger&gt;<br /> &lt;/audit-log&gt;<br /></pre>This config contains the only audit log formatter we have at the moment, the JSON formatter which formats the audit log records.<br />It also contains a file-handler called <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">file</span> which points to the file which it should log to. <br />The <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">file</span> file-handler references the 'json-formatter' which means this handler uses 'json-formatter' to format its log records. <br />Finally the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">logger</span> entry references the 'file' handler which means that the 'file' handler will be used for logging audit log records. <br />The attributes of the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">logger</span> element mean that we will audit log the operation that happen on boot, that we will not log read-only operations, and that audit logging is not enabled. The not enabled part takes precedence, so we don't log anything at all.<br /><br />Now if you start up WildFly by running (of course change <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">~/Downloads/wildfly-8.0.0.Alpha4</span> to wherever you have installed WildFly)<br /><pre>$cd ~/Downloads/wildfly-8.0.0.Alpha4/bin/<br />$./standalone.sh<br /></pre>you will see no <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$WILDFLY_HOME/standalone/data/audit-log.log.</span> file. This is because we need to enable audit logging.<br /><br /><br /><br /><h2>Enable audit logging</h2>In another terminal window go to WildFly's <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bin</span> directory, start our command-line interface and execute the operation to change the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">enabled</span> attribute to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">true</span>:<br /><br /><pre>$cd ~/Downloads/wildfly-8.0.0.Alpha4/bin/<br /><br />[~/Downloads/wildfly-8.0.0.Alpha4/bin]<br />$./jboss-cli.sh <br />You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.<br />[disconnected /] connect <br />[standalone@localhost:9990 /] /core-service=management/access=audit/logger=audit-log:write-attribute(name=enabled,value=true){"outcome" => "success"}<br />[standalone@localhost:9990 /] <br /></pre>If you look in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$WILDFLY_HOME/standalone/configuration/standalone.xml</span> again, you will see that the value of the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">enabled</span> attribute we saw earlier is now <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">true</span>.<br /><br />Now, if you look, you will see that <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$WILDFLY_HOME/standalone/data/audit-log.log</span> has been created, and it contains the following:<br /><pre class="json" name="audit1">$more data/audit-log.log<br />2013-08-14 15:26:16 - {<br /> "type" : "core",<br /> "r/o" : false,<br /> "booting" : false,<br /> "user" : "$local",<br /> "domainUUID" : null,<br /> "access" : "NATIVE",<br /> "remote-address" : "127.0.0.1/127.0.0.1",<br /> "success" : true,<br /> "ops" : [{<br /> "address" : [<br /> {<br /> "core-service" : "management"<br /> },<br /> {<br /> "access" : "audit"<br /> },<br /> {<br /> "logger" : "audit-log"<br /> }<br /> ],<br /> "operation" : "write-attribute",<br /> "name" : "enabled",<br /> "value" : true,<br /> "operation-headers" : {"caller-type" : "user"}<br /> }]<br />}<br /></pre><br />The actual contents of the fields is explained in the <a href="https://sso.jboss.org/login?service=https%3A%2F%2Fdocs.jboss.org%2Fauthor%2Fdisplay%2FWFLY8%2FAudit%2Blogging&gateway=true">documentation</a> but a few things worth pointing out is that <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">access=NATIVE</span> means it came from the native management interface, and <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ops</span> contains the operation that we executed to enable audit logging.<br /><br /><h2>Enable syslog logging</h2>First you need a syslog server which can accept connections via UDP or TCP/IP. I am on OS X, so I enabled my local syslog server to accept UDP connections on port 514 by following these <a href="http://superuser.com/questions/131578/how-do-you-enable-syslogd-to-accept-incoming-connections-on-snow-leopard-from-re">tips</a>. If you are on linux you probably have <a href="http://www.rsyslog.com">rsyslog</a> installed, so you would typically modify <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/etc/rsyslog.conf</span> to include the following directives<br /><pre>...<br />$ModLoad imudp.so<br />$UDPServerRun 514<br />...<br /></pre><br />Then restart the syslog service. I think the OS X link shows you how to do that, and for linux you need to restart the rsyslogd service. In the worst case reboot, and start up wildfly and the command-line interface again ;-)<br /><br />Then in the command-line interface window, execute these following commands to add a syslog handler called <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">mysyslog</span>:<br /><pre>[standalone@localhost:9990 /] batch <br />[standalone@localhost:9990 / #] /core-service=management/access=audit/syslog-handler=mysyslog:add(formatter=json-formatter)<br />#1 /core-service=management/access=audit/syslog-handler=mysyslog:add(formatter=json-formatter)<br />[standalone@localhost:9990 / #] /core-service=management/access=audit/syslog-handler=mysyslog/protocol=udp:add(host=localhost,port=514)<br />#2 /core-service=management/access=audit/syslog-handler=mysyslog/protocol=udp:add(host=localhost,port=514)<br />[standalone@localhost:9990 / #] run-batch <br />The batch executed successfully<br /></pre>Then add a reference to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">mysyslog</span> to the logger:<br /><pre>[standalone@localhost:9990 /] /core-service=management/access=audit/logger=audit-log/handler=mysyslog:add<br />{"outcome" => "success"}<br /></pre><br />You should now see the executed commands logged in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$WILDFLY_HOME/standalone/data/audit-log.log.</span>, e.g.:<br /><pre>2013-08-14 15:55:20 - {<br /> "type" : "core",<br /> "r/o" : false,<br /> "booting" : false,<br /> "user" : "$local",<br /> "domainUUID" : null,<br /> "access" : "NATIVE",<br /> "remote-address" : "127.0.0.1/127.0.0.1",<br /> "success" : true,<br /> "ops" : [{<br /> "operation" : "composite",<br /> "address" : [],<br /> "steps" : [<br /> {<br /> "address" : [<br /> {<br /> "core-service" : "management"<br /> },<br /> {<br /> "access" : "audit"<br /> },<br /> {<br /> "syslog-handler" : "mysyslog"<br /> }<br /> ],<br /> "operation" : "add",<br /> "formatter" : "json-formatter",<br /> "operation-headers" : {"caller-type" : "user"},<br /> "max-length" : null,<br /> "syslog-format" : null,<br /> "truncate" : null,<br /> "max-failure-count" : null<br /> },<br /> {<br /> "address" : [<br /> {<br /> "core-service" : "management"<br /> },<br /> {<br /> "access" : "audit"<br /> },<br /> {<br /> "syslog-handler" : "mysyslog"<br /> },<br /> {<br /> "protocol" : "udp"<br /> }<br /> ],<br /> "operation" : "add",<br /> "port" : 514,<br /> "host" : "localhost",<br /> "operation-headers" : {"caller-type" : "user"}<br /> }<br /> ],<br /> "operation-headers" : {"caller-type" : "user"}<br /> }]<br />}<br />2013-08-14 15:56:34 - {<br /> "type" : "core",<br /> "r/o" : false,<br /> "booting" : false,<br /> "user" : "$local",<br /> "domainUUID" : null,<br /> "access" : "NATIVE",<br /> "remote-address" : "127.0.0.1/127.0.0.1",<br /> "success" : true,<br /> "ops" : [{<br /> "address" : [<br /> {<br /> "core-service" : "management"<br /> },<br /> {<br /> "access" : "audit"<br /> },<br /> {<br /> "logger" : "audit-log"<br /> },<br /> {<br /> "handler" : "mysyslog"<br /> }<br /> ],<br /> "operation" : "add",<br /> "operation-headers" : {"caller-type" : "user"}<br /> }]<br />}<br /></pre>And if you look at syslog,<br /><ul><li>On OS X, open the Console.app and go to 'All Messages'<br /></li>On Linux, look in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/var/log/messages</span> </ul>In any case you should see the logger handler reference add in syslog<br /><pre>14/08/2013 15:56:35.000 2013-08-14T15: 56:35.529+01:00 localhost WildFly 2348 - - ﻿2013-08-14 15:56:34 - {<br /> "type" : "core",<br /> "r/o" : false,<br /> "booting" : false,<br /> "user" : "$local",<br /> "domainUUID" : null,<br /> "access" : "NATIVE",<br /> "remote-address" : "127.0.0.1/127.0.0.1",<br /> "success" : true,<br /> "ops" : [{<br /> "address" : [<br /> {<br /> "core-service" : "management"<br /> },<br /> {<br /> "access" : "audit"<br /> },<br /> {<br /> "logger" : "audit-log"<br /> },<br /> {<br /> "handler" : "mysyslog"<br /> }<br /> ],<br /> "operation" : "add",<br /> "operation-headers" : {"caller-type" : "user"}<br /> }]<br /></pre>(The reason you did not see the add of the handler is that the audit log subsystem does not actually start using it until the logger handler reference is added). If you execute the following command in the command-line interface<br /><pre>[standalone@localhost:9990 /] /system-property=test123:add(value=testing)<br />{"outcome" => "success"}<br /></pre>You should see the operation get logged in both syslog and the file.<br /><br />Finally, if you look at <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$WILDFLY_HOME/standalone/configuration/standalone.xml</span> again you will see that the syslog handler and reference have been persisted:<br /><br /><pre class="xml" name="code"> &lt;audit-log&gt;<br /> &lt;formatters&gt;<br /> &lt;json-formatter name="json-formatter"/&gt;<br /> &lt;/formatters&gt;<br /> &lt;handlers&gt;<br /> &lt;file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/&gt;<br /> &lt;syslog-handler name="mysyslog" formatter="json-formatter"&gt;<br /> &lt;udp host="localhost" port="514"/&gt;<br /> &lt;/syslog-handler&gt;<br /> &lt;/handlers&gt;<br /> &lt;logger log-boot="true" log-read-only="false" enabled="true"&gt;<br /> &lt;handlers&gt;<br /> &lt;handler name="file"/&gt;<br /> &lt;handler name="mysyslog"/&gt;<br /> &lt;/handlers&gt;<br /> &lt;/logger&gt;<br /> &lt;/audit-log&gt;<br /></pre>Tomaz on the WildFly team pointed out that my previous blog post on secure audit logging in WildFly 8.0.0.Alpha4 was a bit too scary :-) So I'd like to point out that that was probably the most complicated setup possible, and to walk through a few simpler examples here while explaining a bit more what goes on. These features are available in WildFly 8.0.0.Alpha4 and later. You can get it from here...Setting up Secure Audit Logging to a Remote Rsyslog Instance in WildFly 8.0.0.Alpha42013-08-14T11:16:00-04:00searchisko:content:id:jbossorg_blog-setting_up_secure_audit_logging_to_a_remote_rsyslog_instance_in_wildfly_8_0_0_alpha42013-08-13T09:09:00-04:00Kabir Khan<a href="http://www.wildfly.org/">WildFly</a> is the new name for JBoss Application Server. It builds on the same architecture as JBoss Application Server 7. WildFly is the upstream for <a href="http://www.redhat.com/products/jbossenterprisemiddleware/application-platform/">JBoss Enterprise Application Platform 6</a>, which is our supported middleware offering at Red Hat. Some of our larger customers have asked for additional security features when it comes to managing their installations, and one of the pieces for this is to implement audit logging of the management layer. The initial implementation of audit logging will be part of the WildFly 8.0.0.Alpha4 release, which was released today. <p/><b>Note that this is a pretty advanced topic, for a simpler overview of audit logging see my <a href="http://kabir-khan.blogspot.co.uk/2013/08/simpler-audit-logging-example-for.html">follow-up post</a>.</b><br /><br /></p>The <a href="https://docs.jboss.org/author/display/WFLY8/Admin+Guide">WildFly Admin Guide</a> covers the reference for the configuration of audit logging framework, but I thought it would be a good idea to show step by step how to configure WildFly to log to a remote syslog server over TLS. I will also throw client certificate authentication into the mix. I have used <a href="http://www.rsyslog.com">rsyslog</a> for my experiments since that comes with nice documentation for how to set it up to use TLS. You need to install the rsyslog-gnutls package for the following to work. <p/>I do my main work on OS X but have a linux server with rsyslog installed so I will use that as the syslog server. It's address is <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">kabirlinux</span>. Wherever you see the name <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">kabirlinux</span> you should replace it with the host name of your machine running rsyslog. <h2>Generating the server certificates</h2>First I ssh into <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">kabirlinux</span> and generate the keys we need to set up rsyslog to accept remote connections over TLS (taken from <a href="http://www.rsyslog.com/tag/tls/">http://www.rsyslog.com/tag/tls/</a> and <a href="http://www.rsyslog.com/doc/rsyslog_tls.html">http://www.rsyslog.com/doc/rsyslog_tls.html</a>). The first thing we need to do is to generate the ca certificate that will be used for signing the other certificates. Please note that wherever I have used <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">sudo</span>, it is very important that you do so too, otherwise rsyslog might not recognise your keys. <pre>$ssh kabirlinux<br />Last login: Mon Aug 12 16:15:28 2013 from 192.168.1.102<br /><br />[kabirlinux ~]<br />$mkdir tmp<br /><br />[kabirlinux ~]<br />$cd tmp<br /><br />[kabirlinux ~/tmp]<br />$sudo certtool --generate-privkey --outfile ca-key.pem<br />[sudo] password for kabir: <br />Generating a 2560 bit RSA private key...<br /></pre>Then we generate the ca certificate using the private key: <pre>[kabirlinux ~]<br />$sudo certtool --generate-self-signed --load-privkey ca-key.pem --outfile ca.pem<br />Generating a self signed certificate...<br />Please enter the details of the certificate's distinguished name. Just press enter to ignore a field.<br />Country name (2 chars): UK<br />Organization name: Red Hat<br />Organizational unit name: JBoss<br />Locality name: London<br />State or province name: London<br />Common name: kabirlinux<br />UID: <br />This field should not be used in new certificates.<br />E-mail: me@redhat.com<br />Enter the certificate's serial number in decimal (default: 1376387226): <br /><br /><br />Activation/Expiration time.<br />The certificate will expire in (days): 3650<br /><br /><br />Extensions.<br />Does the certificate belong to an authority? (y/N): y<br />Path length constraint (decimal, -1 for no constraint): <br />Is this a TLS web client certificate? (y/N): <br />Will the certificate be used for IPsec IKE operations? (y/N): <br />Is this also a TLS web server certificate? (y/N): <br />Enter the e-mail of the subject of the certificate: <br />Will the certificate be used to sign other certificates? (y/N): y<br />Will the certificate be used to sign CRLs? (y/N): <br />Will the certificate be used to sign code? (y/N): <br />Will the certificate be used to sign OCSP requests? (y/N): <br />Will the certificate be used for time stamping? (y/N): <br />Enter the URI of the CRL distribution point: <br />X.509 Certificate Information:<br /> Version: 3<br />.........<br /><br />Is the above information ok? (y/N): y<br /><br /><br />Signing certificate...<br /></pre>Next we generate a certificate request, and the server certificate that will be used to secure TLS. <pre>[kabirlinux ~/tmp]<br />$sudo certtool --generate-privkey --outfile server-key.pem --bits 2048<br />** Note: Please use the --sec-param instead of --bits<br />Generating a 2048 bit RSA private key...<br /><br />[kabirlinux ~/tmp]<br />$sudo certtool --generate-request --load-privkey server-key.pem --outfile request.pem<br />Generating a PKCS #10 certificate request...<br />Country name (2 chars): UK<br />Organization name: Red Hat<br />Organizational unit name: JBoss<br />Locality name: London<br />State or province name: London<br />Common name: kabirlinux<br />UID: <br />Enter a dnsName of the subject of the certificate: kabirlinux<br />Enter a dnsName of the subject of the certificate: <br />Enter the IP address of the subject of the certificate: <br />Enter the e-mail of the subject of the certificate: me@redhat.com<br />Enter a challenge password: <br />Does the certificate belong to an authority? (y/N): <br />Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (y/N): <br />Will the certificate be used for encryption (RSA ciphersuites)? (y/N): <br />Is this a TLS web client certificate? (y/N): y<br />Is this also a TLS web server certificate? (y/N): y<br /><br />[kabirlinux ~/tmp]<br />$sudo certtool --generate-certificate --load-request request.pem --outfile server-cert.pem --load-ca-certificate ca.pem --load-ca-privkey ca-key.pem<br />Generating a signed certificate...<br />Enter the certificate's serial number in decimal (default: 1376387546): <br /><br /><br />Activation/Expiration time.<br />The certificate will expire in (days): 3650<br /><br /><br />Extensions.<br />Do you want to honour the extensions from the request? (y/N): <br />Does the certificate belong to an authority? (y/N): <br />Is this a TLS web client certificate? (y/N): y<br />Will the certificate be used for IPsec IKE operations? (y/N): <br />Is this also a TLS web server certificate? (y/N): y<br />Enter a dnsName of the subject of the certificate: kabirlinux<br />Enter a dnsName of the subject of the certificate: <br />Enter the IP address of the subject of the certificate: <br />Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (y/N): <br />Will the certificate be used for encryption (RSA ciphersuites)? (y/N): <br />X.509 Certificate Information:<br /> Version: 3<br /><br />.....<br /><br />Is the above information ok? (y/N): y<br /><br /><br />Signing certificate...<br /><br />[kabirlinux ~/tmp]<br />$rm request.pem <br /></pre>We then need to protect the ca private key <pre>[kabirlinux ~/tmp]<br />$sudo chmod 400 ca-key.pem<br /></pre><pre></pre>Now move the generated files across to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/etc/pki/rsyslog</span>, keeping a copy of the server certificate in the tmp directory: <pre>[kabirlinux ~/tmp]<br />$sudo mv ca-key.pem ca.pem server-cert.pem server-key.pem /etc/pki/rsyslog/<br /><br />[kabirlinux ~/tmp]<br />$sudo cp /etc/pki/rsyslog/server-cert.pem .<br /></pre>Then modify the rsyslog configuration file at <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/etc/rsyslog.conf</span> to allow TLS. In a vanilla installation this is just after the initial <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ModLoad</span> directives. <pre>....<br />#### MODULES ####<br />$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)<br />$ModLoad imklog # provides kernel logging support (previously done by rklogd)<br />#$ModLoad immark # provides --MARK-- message capability<br /><br /># Provides TLS syslog reception<br />$ModLoad imtcp #Load tcp driver<br />$DefaultNetstreamDriver gtls # Sets the gtls driver as the default<br /># Certificates<br />$DefaultNetstreamDriverCAFile /etc/pki/rsyslog/ca.pem<br />$DefaultNetstreamDriverCertFile /etc/pki/rsyslog/server-cert.pem<br />$DefaultNetstreamDriverKeyFile /etc/pki/rsyslog/server-key.pem<br /># run driver in TLS-only mode<br />$InputTCPServerStreamDriverMode 1<br />$InputTCPServerStreamDriverAuthMode anon <br />$InputTCPServerRun 514 # start up listener at port 514<br />....<br /></pre><b>Make sure the syslog server's firewall is open to TCP requests on port 514.</b> A simple way to get rid of all rules is to run this when ssh'ed into the syslog server (you will of course want to set this up properly once done experimenting): <pre>[kabirlinux ~]<br />$sudo iptables -F<br /></pre>Then restart the rsyslog daemon: <pre>[kabirlinux ~]<br />$sudo service rsyslog restart<br />[sudo] password for kabir: <br />Redirecting to /bin/systemctl restart rsyslog.service<br /></pre>In the syslog you should then see messages indicating that the service has been restarted <pre>[kabirlinux ~]<br />$sudo tail -f /var/log/messages<br />.....<br />Aug 12 16:50:32 kabir systemd[1]: Stopping System Logging Service...<br />Aug 12 16:50:32 kabir systemd[1]: Starting System Logging Service...<br />Aug 12 16:50:32 kabir systemd[1]: Started System Logging Service.<br /></pre><h2>Importing the server certificate into a Java truststore</h2>Since the server certificate is not signed by a trusted certificate authorization authority, in my local machine where I will be running WildFly, I need to import the server certificate into a truststore. First I copy it down to my local machine: <pre>[~]<br />$mkdir test<br /><br />[~]<br />$cd test<br /><br />[~/test]<br />$sftp kabirlinux<br />Connected to kabirlinux.<br />sftp> cd tmp<br />sftp> ls<br />server-cert.pem<br />sftp> get server-cert.pem<br />Fetching /home/kabir/tmp/server-cert.pem to server-cert.pem<br />/home/kabir/tmp/server-cert.pem 100% 1529 1.5KB/s 00:00 <br />sftp> exit<br /><br />[~/test]<br /></pre>Then I import the certificate into a trustore file using the keytool command, and 'test123' as the password: <pre>[~/test]<br />$keytool -import -trustcacerts -file server-cert.pem -alias CA_ALIAS -keystore truststore<br />Enter keystore password: <br />Re-enter new password: <br />...<br /><br />Trust this certificate? [no]: yes<br />Certificate was added to keystore<br /></pre><h2>Set up WildFly to use syslog with TLS for audit logging</h2>Make sure you are using WildFly 8.0.0.Alpha4 or later! Out of the box wildfly's audit log configuration in its <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">standalone/configuration/standalone.xml</span> will look like this <pre>&lt;audit-log&gt;<br /> &lt;formatters&gt;<br /> &lt;json-formatter name="json-formatter"/&gt;<br /> &lt;/formatters&gt;<br /> &lt;handlers&gt;<br /> &lt;file-handler name="file" formatter="json-formatter" relative-to="jboss.server.data.dir" path="audit-log.log"/&gt;<br /> &lt;/handlers&gt;<br /> &lt;logger log-boot="true" log-read-only="false" enabled="false"&gt;<br /> &lt;handlers&gt;<br /> &lt;handler name="file"/&gt;<br /> &lt;/handlers&gt;<br /> &lt;/logger&gt;<br /> &lt;/audit-log&gt;<br /></pre>Change this to <pre>&lt;audit-log&gt;<br /> &lt;formatters&gt;<br /> &lt;json-formatter name="json-formatter"/&gt;<br /> &lt;/formatters&gt;<br /> &lt;handlers&gt;<br /> &lt;syslog-handler name="syslog-tls" formatter="json-formatter" syslog-format="RFC5424"&gt;<br /> &lt;tls host="kabirlinux" port="514" message-transfer="NON_TRANSPARENT_FRAMING"&gt;<br /> &lt;truststore path="/Users/kabir/test/truststore" keystore-password="test123"/&gt;<br /> &lt;/tls&gt;<br /> &lt;/syslog-handler&gt;<br /> &lt;/handlers&gt;<br /> &lt;logger log-boot="true" log-read-only="true" enabled="true"&gt;<br /> &lt;handlers&gt;<br /> &lt;handler name="syslog-tls"/&gt;<br /> &lt;/handlers&gt;<br /> &lt;/logger&gt;<br /> &lt;/audit-log&gt;<br /></pre>If having the keystore password hard wired in the xml worries you, please take a look at how to use our <a href="https://community.jboss.org/wiki/JBossAS7SecuringPasswords">vault</a> for sensitive information like that. Now if you stop and start WildFly and look in <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/var/log/messages</span> on the server running rsyslog, you should see audit logged messages on bootup. Also, when executing operations, for example from the CLI you should see those added to the syslog. <h2>Client certificate authentication</h2>Rsyslog supports full blown client certificate authentication, however I have not tried setting that up. However, it also has a slightly more permissive mode which simply checks that the client has a certificate signed by the server's ca. So first we generate the client certificate, I do this on my syslog server: <pre>[~/test]<br />$ssh kabirlinux<br />Last login: Mon Aug 12 18:02:25 2013 from 192.168.1.102<br /><br />[kabirlinux ~]<br />$cd tmp/<br /><br />[kabirlinux ~/tmp]<br />$certtool --generate-privkey --outfile client-key.pem<br />Generating a 2560 bit RSA private key...<br /><br />[kabirlinux ~/tmp]<br />$certtool --generate-request --load-privkey client-key.pem --outfile client-request.pem<br />Generating a PKCS #10 certificate request...<br />Country name (2 chars): UK<br />Organization name: Red Hat<br />Organizational unit name: JBoss<br />Locality name: London<br />State or province name: London<br />Common name: client <br />UID: <br />Enter a dnsName of the subject of the certificate: kabirlinux<br />Enter a dnsName of the subject of the certificate: <br />Enter the IP address of the subject of the certificate: <br />Enter the e-mail of the subject of the certificate: me@redhat.com<br />Enter a challenge password: <br />Does the certificate belong to an authority? (y/N): N<br />Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (y/N): <br />Will the certificate be used for encryption (RSA ciphersuites)? (y/N): <br />Is this a TLS web client certificate? (y/N): y<br />Is this also a TLS web server certificate? (y/N): y<br /><br />[kabirlinux ~/tmp]<br />$sudo certtool --generate-certificate --load-request client-request.pem --outfile client-cert.pem --load-ca-certificate /etc/pki/rsyslog/ca.pem --load-ca-privkey /etc/pki/rsyslog/ca-key.pem<br />[sudo] password for kabir: <br />Generating a signed certificate...<br />Enter the certificate's serial number in decimal (default: 1376327802): <br /><br /><br />Activation/Expiration time.<br />The certificate will expire in (days): 3650<br /><br /><br />Extensions.<br />Do you want to honour the extensions from the request? (y/N): <br />Does the certificate belong to an authority? (y/N): <br />Is this a TLS web client certificate? (y/N): y<br />Will the certificate be used for IPsec IKE operations? (y/N): <br />Is this also a TLS web server certificate? (y/N): y<br />Enter a dnsName of the subject of the certificate: kabirlinux<br />Enter a dnsName of the subject of the certificate: <br />Enter the IP address of the subject of the certificate: <br />Will the certificate be used for signing (DHE and RSA-EXPORT ciphersuites)? (y/N): <br />Will the certificate be used for encryption (RSA ciphersuites)? (y/N): <br />X.509 Certificate Information:<br />...<br /><br />Is the above information ok? (y/N): y<br /></pre>We then need to combine the client certificate and key to pkcs12 format to copy across to the client, using 'test123' as the export password <pre>[kabirlinux ~/tmp]<br />$openssl pkcs12 -export -in client-cert.pem -inkey client-key.pem -out client.p12 -name "Whatever"<br />Enter Export Password:<br />Verifying - Enter Export Password:<br /><br />[kabirlinux ~/tmp]<br />$rm -rf client*.pem<br /></pre>Now on my Mac I get the client.p12 file and import it into a jks keystore <pre>[~/test]<br />$sftp kabirlinux<br />Connected to kabirlinux.<br />sftp> cd tmp <br />sftp> get client.p12<br />Fetching /home/kabir/tmp/client.p12 to client.p12<br />/home/kabir/tmp/client.p12 100% 3094 3.0KB/s 00:00 <br />sftp> exit<br /><br />[~/test]<br />$keytool -v -importkeystore -srckeystore client.p12 -srcstoretype PKCS12 -destkeystore client.jks -deststoretype JKS<br />Enter destination keystore password: <br />Re-enter new password: <br />Enter source keystore password: <br />Entry for alias whatever successfully imported.<br />Import command completed: 1 entries successfully imported, 0 entries failed or cancelled<br />[Storing client.jks]<br /></pre>Again, I use 'test123' as the keystore password. Then on the rsyslog server we change <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/etc/rsyslog.conf</span> to use 'x509/certvalid' instead of 'anon' for the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">InputTCPServerStreamDriverAuthMode</span> directive, e.g: <pre>$InputTCPServerStreamDriverAuthMode x509/certvalid<br /></pre>Next we add the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">client-certificate-store</span> information to the syslog handler in the audit logging section of <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">standalone/configuration/standalone.xml</span> in the WildFly installation so it looks like: <pre>&lt;audit-log&gt;<br /> &lt;formatters&gt;<br /> &lt;json-formatter name="json-formatter"/&gt;<br /> &lt;/formatters&gt;<br /> &lt;handlers&gt;<br /> &lt;syslog-handler name="syslog-tls" formatter="json-formatter" syslog-format="RFC5424"&gt;<br /> &lt;tls host="kabirlinux" port="514" message-transfer="NON_TRANSPARENT_FRAMING"&gt;<br /> &lt;truststore path="/Users/kabir/test/truststore" keystore-password="test123"/&gt;<br /> &lt;client-certificate-store path="/Users/kabir/test/client.jks" keystore-password="test123"/&gt;<br /> &lt;/tls&gt;<br /> &lt;/syslog-handler&gt;<br /> &lt;/handlers&gt;<br /> &lt;logger log-boot="true" log-read-only="true" enabled="true"&gt;<br /> &lt;handlers&gt;<br /> &lt;handler name="syslog-tls"/&gt;<br /> &lt;/handlers&gt;<br /> &lt;/logger&gt;<br /> &lt;/audit-log&gt;<br /></pre>Now if you restart the rsyslog daemon and WildFly you should see the log messages come through again. So this means that you can host rsyslog on a machine not accessible by the people who have access to your WildFly installation. Communication between the WildFly installation and rsyslog is encrypted since it goes over TLS, and only users who have the correct certificate are able to send data to rsyslog. <p/>WildFly is the new name for JBoss Application Server. It builds on the same architecture as JBoss Application Server 7. WildFly is the upstream for JBoss Enterprise Application Platform 6, which is our supported middleware offering at Red Hat. Some of our larger customers have asked for additional security features when it comes to managing their installations, and one of the pieces for this is to...Transylvania Java User Group Roundup2012-12-03T06:42:55-05:00searchisko:content:id:jbossorg_blog-transylvania_java_user_group_roundup2012-03-14T14:09:00-04:00Kabir KhanI just got back from the presenting <a href="http://www.jboss.org/jbossas">JBoss Application Server 7</a> at the <a href="http://www.jugevents.org/jugevents/event/44389">Transylvania User Group</a> last night. I didn't know much about Romania before I went, but I was impressed by the friendly people and enthusiastic crowd at the event, and was taken very well care of by Gabriel Pop, the organiser, and the other locals. Everything was great apart from that the only direct flights between Cluj and London mean getting up at 4am both going there and coming back :-) The centre of Cluj was pretty, and the restaurants I got taken to were excellent.<br /><br />We covered why JBoss AS 7 is so fast and had a demo introducing Java EE 6. A majority of the crowd were Spring users but the feedback I got indicated that they were impressed by the simplified programming model introduced in Java EE 6. I got a few chuckles when I complained that the initial start of the application server during the demo was slow, since it started in 2 seconds. Restarting it it started in the 1.3s I am used to on my laptop.<br /><br />I then went on to explain and demo the JBoss 7 management model, and then revisited the original EE 6 demo and tested it using Arquillian before adding JAX-RS features to it and deploying it to OpenShift using a mobile HTML 5 client to interact with the server via JAX-RS. <br /><br />The feedback was very good after the event, I had lots of people using JBoss AS 5.x, WebLogic, WebSphere etc. coming up to me saying they now wanted to move to AS 7. And thanks to the people who hung around for dinner afterwards, it was fun - and yes I did manage to get up for my flight after 3 hours of sleep!I just got back from the presenting JBoss Application Server 7 at the Transylvania User Group last night. I didn't know much about Romania before I went, but I was impressed by the friendly people and enthusiastic crowd at the event, and was taken very well care of by Gabriel Pop, the organiser, and the other locals. Everything was great apart from that the only direct flights between Cluj and Lon...JBoss AS 7 at Transylvania JUG2012-03-02T05:26:35-05:00searchisko:content:id:jbossorg_blog-jboss_as_7_at_transylvania_jug2012-03-02T05:22:00-05:00Kabir KhanI'll be going to Transylvania to present at the <a href="http://www.transylvania-jug.org/events/future-meetings">Transylvania Java User Group</a> on 13 March.<br /><br />I'll be talking about the recently released <a href="http://dandreadis.blogspot.com/2012/02/introducing-jboss-as-71-final.html">JBoss AS 7</a>. I'll cover the road to Java EE 6 certification, how we did the performance improvements and our brand new management layer. There will be plenty of demos taking a basic EE application, testing it and getting it working in the cloud with a HTML 5 client.<br /><br />Hope to see you there!I'll be going to Transylvania to present at the Transylvania Java User Group on 13 March. I'll be talking about the recently released JBoss AS 7. I'll cover the road to Java EE 6 certification, how we did the performance improvements and our brand new management layer. There will be plenty of demos taking a basic EE application, testing it and getting it working in the cloud with a HTML 5 client. ...JBoss AS 7 at Devoxx2011-11-30T12:29:19-05:00searchisko:content:id:jbossorg_blog-jboss_as_7_at_devoxx2011-11-23T10:29:00-05:00Kabir KhanI just got back from my first ever Devoxx, and it is a really great conference - I was very pleasantly surprised! The auditoriums for the main talks were amazing.<br /><br />Dimitris, Pete, Carlo, Dan, Lincoln, Aslak, Andrew, Max and I (apologies if I forgot anybody, there were quite a few of us) did a BOF on JBoss AS 7 with good attendance and some great questions from the audience. In hindsight I wish I'd prepared some demos for anticipated questions though.<br /><br />It was a very nice experience to hang around the JBoss booth and finally meet some real AS 7 users after having worked on AS 7 the past year and a half. Users of older versions of the application server seemed to be impressed by the much improved configuration and domain management of AS 7. From the chats I had that seemed to be the thing people were most impressed by/disliked the most in previous versions.<br /><br />Then there were numerous other talks by the usual JBoss suspects, all of which were great and packed. Since I'm biased and work on AS 7 I loved Andrew Rubinger and Dan Allen's talk on AS 7, and of course Pete Muir's talk on OpenShift. There will be more blogs from the rest of the team on our <a href="http://www.jboss.org/events/">jboss.org events</a> page.I just got back from my first ever Devoxx, and it is a really great conference - I was very pleasantly surprised! The auditoriums for the main talks were amazing. Dimitris, Pete, Carlo, Dan, Lincoln, Aslak, Andrew, Max and I (apologies if I forgot anybody, there were quite a few of us) did a BOF on JBoss AS 7 with good attendance and some great questions from the audience. In hindsight I wish I'd ...Getting started with JBoss Application Server 7.0.0 CR1 in minutes2011-06-29T11:10:48-04:00searchisko:content:id:jbossorg_blog-getting_started_with_jboss_application_server_7_0_0_cr1_in_minutes2011-06-29T07:19:00-04:00Kabir KhanJBoss Application Server 7.0.0 CR1 was released this morning (GMT). I'm sure Jason Greene, the AS 7 lead will <a href="http://relation.to/Bloggers/Jason">post</a> more details in the next day or two. In the meantime, I'd like to give you a very quick overview of how to get this up and running in a few minutes.<br /><br />The most time-consuming step is to grab it from <a href="http://download.jboss.org/jbossas/7.0/jboss-7.0.0.CR1/jboss-7.0.0.CR1.zip">http://download.jboss.org/jbossas/7.0/jboss-7.0.0.CR1/jboss-7.0.0.CR1.zip</a> (later releases will be accessible from the main download page <a href="http://www.jboss.org/jbossas/downloads">http://www.jboss.org/jbossas/downloads</a>).<br /><br />Now go to your download directory and unzip it to somewhere, and then go to the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">jboss-7.0.0.CR1/bin folder</span>:<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">[kabir ~/Downloads]<br />$unzip -q jboss-7.0.0.CR1.zip -d ~/AS7<br /><br />[kabir ~/Downloads]<br />$cd ~/AS7/jboss-7.0.0.CR1/bin/<br /></span><br /><br /><br />Now that the slow part is done, let's start it up in single server mode:<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />[kabir ~/AS7/jboss-7.0.0.CR1/bin]<br />$./standalone.sh <br />=========================================================================<br /><br />JBoss Bootstrap Environment<br /><br />JBOSS_HOME: /Users/kabir/AS7/jboss-7.0.0.CR1<br /><br />JAVA: /Library/Java/Home//bin/java<br /><br />JAVA_OPTS: -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman<br /><br />=========================================================================<br /><br />11:55:25,759 INFO [org.jboss.modules] JBoss Modules version 1.0.0.CR4<br />11:55:26,009 INFO [org.jboss.msc] JBoss MSC version 1.0.0.CR2<br />11:55:26,077 INFO [org.jboss.as] JBoss AS 7.0.0.CR1 "White Rabbit" starting<br />11:55:26,955 INFO [org.jboss.as] creating http management service using network interface (management) port (9990) securePort (-1)<br />11:55:26,965 INFO [org.jboss.as.logging] Removing bootstrap log handlers<br />11:55:26,997 INFO [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)<br />11:55:27,101 INFO [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem<br />11:55:27,157 INFO [org.jboss.as.osgi] (Controller Boot Thread) Activating OSGi Subsystem<br />11:55:27,188 INFO [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem<br />11:55:27,208 INFO [org.jboss.as.naming] (MSC service thread 1-4) Starting Naming Service <br />11:55:27,215 INFO [org.jboss.remoting] (MSC service thread 1-3) JBoss Remoting version 3.2.0.Beta2<br />11:55:27,229 INFO [org.xnio] (MSC service thread 1-3) XNIO Version 3.0.0.Beta3<br />11:55:27,248 INFO [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.0.0.Beta3<br />11:55:27,518 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-2) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java<br />11:55:27,539 INFO [org.jboss.as.remoting] (MSC service thread 1-3) Listening on /127.0.0.1:9999<br />11:55:27,575 WARN [org.jboss.osgi.framework.internal.URLHandlerPlugin] (MSC service thread 1-2) Unable to set the URLStreamHandlerFactory<br />11:55:27,576 WARN [org.jboss.osgi.framework.internal.URLHandlerPlugin] (MSC service thread 1-2) Unable to set the ContentHandlerFactory<br />11:55:27,590 INFO [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem<br />11:55:27,593 INFO [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-4) Starting remote JMX connector<br />11:55:27,604 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080<br />11:55:27,732 INFO [org.jboss.as.connector] (MSC service thread 1-3) Starting JCA Subsystem (JBoss IronJacamar 1.0.0.CR2)<br />11:55:27,855 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) Bound data source [java:jboss/datasources/ExampleDS]<br />11:55:28,255 INFO [org.jboss.as.deployment] (MSC service thread 1-1) Started FileSystemDeploymentService for directory /Users/kabir/AS7/jboss-7.0.0.CR1/standalone/deployments<br />11:55:28,267 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.CR1 "White Rabbit" started in 2750ms - Started 91 of 146 services (55 services are passive or on-demand)!<br /></span><br />And that's it! JBoss Application Server 7.0.0 started in 2750ms. Leave it running for now.<br /><br />Go to <a href="http://localhost:8080/">http://localhost:8080/</a> for the welcome page which contains links to our admin console and documentation. Our documentation is being created online at <a href="https://docs.jboss.org/author/display/AS7/Documentation">https://docs.jboss.org/author/display/AS7/Documentation</a> and there is a fair bit of content already, but make sure you check in regularly since for our next release we will be focussing 100% on our documentation. The docs include a more extensive <a href="https://docs.jboss.org/author/display/AS7/Getting+Started+Developing+Applications+Guide">quick start guide</a> than this.<br /><br />To deploy applications one way to do it is to copy them to the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">jboss-7.0.0.CR1/standalone/deployments</span> folder. Since this is not a Java EE tutorial, let's use the first example war I could find online:<br /><br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />[kabir ~/AS7]<br />$curl http://gwt-examples.googlecode.com/files/Calendar.war > Calendar.war<br />% Total % Received % Xferd Average Speed Time Time Time Current<br />Dload Upload Total Spent Left Speed<br />100 529k 100 529k 0 0 312k 0 0:00:01 0:00:01 --:--:-- 356k<br /><br />[kabir ~/AS7]<br />$cp Calendar.war jboss-7.0.0.CR1/standalone/deployments/<br /></span><br /><br /><br />Now in the terminal window where you started AS 7 you should see that the application has been deployed:<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br />11:55:28,267 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.CR1 "White Rabbit" started in 2750ms - Started 91 of 146 services (55 services are passive or on-demand)<br />12:05:13,713 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "Calendar.war"<br />12:05:14,262 INFO [org.jboss.web] (MSC service thread 1-3) registering web context: /Calendar<br />12:05:14,290 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "Calendar.war"<br /></span><br /><br />If you go to <a href="http://localhost:8080/Calendar">http://localhost:8080/Calendar</a> you should see the deployed web app.<br /><br />See the <a href="https://docs.jboss.org/author/display/AS7/Documentation">docs</a> for more information about how to make JBoss AS 7 work for you! <br /><br />And please report any issues at our <a href="http://community.jboss.org/en/jbossas/as7_users?view=discussions">users forum</a>.JBoss Application Server 7.0.0 CR1 was released this morning (GMT). I'm sure Jason Greene, the AS 7 lead will post more details in the next day or two. In the meantime, I'd like to give you a very quick overview of how to get this up and running in a few minutes. The most time-consuming step is to grab it from http://download.jboss.org/jbossas/7.0/jboss-7.0.0.CR1/jboss-7.0.0.CR1.zip (later release...Microcontainer Inspector Tool Update2010-07-12T05:29:53-04:00searchisko:content:id:jbossorg_blog-microcontainer_inspector_tool_update2010-07-12T05:29:00-04:00Kabir Khan<span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: small;"><span class="Apple-style-span" style="font-size: 11px;">The <a href="http://kabir-khan.blogspot.com/2010/03/microcontainer-inspector-tool.html">Microcontainer Inspector Tool</a> build did not work following the move to our new Maven repository at JBoss. I have updated the build and also changed the packaging to create a client jar and a server jar to be deployed. The Installation section of the <a href="http://kabir-khan.blogspot.com/2010/03/microcontainer-inspector-tool.html">original post</a> have been updated with the new instructions.</span></span><div><span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: small;"><span class="Apple-style-span" style="font-size: 11px;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: small;"><span class="Apple-style-span" style="font-size: 11px;">This has made me wonder if the build will work for people who do NOT have the JBoss maven repositories set up as described <a href="http://community.jboss.org/wiki/MavenGettingStarted-Developers">here</a>. If you are trying to build it and it does not work for you please leave me a comment and I'll fix the build.</span></span></div>The Microcontainer Inspector Tool build did not work following the move to our new Maven repository at JBoss. I have updated the build and also changed the packaging to create a client jar and a server jar to be deployed. The Installation section of the original post have been updated with the new instructions. This has made me wonder if the build will work for people who do NOT have the JBoss mav...JBoss User Group Belgium2010-05-14T06:57:03-04:00searchisko:content:id:jbossorg_blog-jboss_user_group_belgium2010-05-14T06:57:00-04:00Kabir KhanI've been invited to talk at the <a href="http://jbug.be/">Belgian JBoss User Group</a>&nbsp;near Antwerp on 3rd June. The title of my talk will be "What's Cooking in JBoss AS 6" and I will talk about our current development model, ongoing optimizations and give a high-level overview of the new projects in AS 6 such as <a href="http://seamframework.org/Weld">Weld</a>, <a href="http://www.jboss.org/resteasy">RestEasy</a>, <a href="http://www.jboss.org/hornetq">HornetQ</a>&nbsp;and many more.<br /><br />Hope to see you there!I've been invited to talk at the Belgian JBoss User Group near Antwerp on 3rd June. The title of my talk will be "What's Cooking in JBoss AS 6" and I will talk about our current development model, ongoing optimizations and give a high-level overview of the new projects in AS 6 such as Weld, RestEasy, HornetQ and many more. Hope to see you there!JSR-330 and Qualifiers in the JBoss Microcontainer2010-05-04T15:29:37-04:00searchisko:content:id:jbossorg_blog-jsr_330_and_qualifiers_in_the_jboss_microcontainer2010-05-04T15:29:00-04:00Kabir KhanThe latest <a href="http://www.jboss.org/jbossmc">JBoss Microcontainer</a> <a href="http://anonsvn.jboss.org/repos/jbossas/projects/kernel/tags/2.2.0.Alpha9/">jboss-kernel 2.2.0.Alphas</a> contain support for the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@javax.inject.Inject</span> and <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@javax.inject.Qualifier</span> annotations from <a href="http://jcp.org/en/jsr/detail?id=330">JSR-330</a>.<br /><br />While most of the use of the JBoss Microcontainer in JBoss AS uses explicitly named injection, e.g.<br /><br /><pre class="xml" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;deployment xmlns="urn:jboss:bean-deployer:2.0"&gt;<br /> &lt;bean name="MyDependency" class="org.jboss.test.Dependency"/&gt;<br /> &lt;bean name="MyBean" class="org.jboss.test.Bean"&gt;<br /> &lt;property name="dependency"&gt;&lt;inject bean="MyDependency"/&gt;&lt;/property&gt;<br /> &lt;/bean&gt;<br />&lt;/deployment&gt;</pre><br />The above means that when deploying the <i>MyBean</i> bean bean it will look up the <i>MyDependency</i> bean by name and inject that instance into <i>MyBean</i>'s dependency property.<br /><br /><span class="Apple-style-span" style="font-size: x-large;">Contextual injection </span><br />We can also look up things by type, first let us see how to do this using xml. This has been supported by the Microcontainer for a while, so this might be familiar:<br /><br /><pre class="xml" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;deployment xmlns="urn:jboss:bean-deployer:2.0"&gt;<br /> &lt;bean name="MyDependency" class="org.jboss.test.Dependency"/&gt;<br /> &lt;bean name="MyBean" class="org.jboss.test.Bean"&gt;<br /> &lt;property name="dependency"&gt;&lt;inject/&gt;&lt;/property&gt;<br /> &lt;/bean&gt;<br />&lt;/deployment&gt;</pre><br />Now if the definition of <i>MyBean</i>'s class is: package org.jboss.test;<br /><pre class="xml" name="code">public class Bean{<br /> Dependency dependency;<br /><br /> public void setDependency(Dependency dependency){<br /> this.dependency = dependency;<br /> }<br />}</pre><br />When creating <i>MyBean</i> this time, we have not given the name of the bean to use when configuring the dependency property. Instead the Microcontainer will check the type of the property, and find which beans are installed in the Microcontainer that can be cast to that type. In this case it finds <i>MyDependency</i> and uses that. If there had been more beans that could be cast to this type, an error would have been thrown. We'll see later how qualifiers can be used to resolve the ambiguities.<br /><br /><span class="Apple-style-span" style="font-family: inherit;"><span class="Apple-style-span" style="font-size: x-large;">Using @javax.inject.Inject&nbsp;</span></span><br />Now let us do the same using annotations. We first need to install the beans into the MC, the simplest way is to use an xml file to define the beans:<br /><br /><pre class="xml" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;deployment xmlns="urn:jboss:bean-deployer:2.0"&gt;<br /> &lt;bean name="MyDependency" class="org.jboss.test.Dependency"/&gt;<br /> &lt;bean name="MyBean" class="org.jboss.test.Bean"/&gt; <br />&lt;/deployment&gt;</pre><br />Notice that we did not define any injection for the dependency property in this case, instead we use <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@javax.inject.Inject</span> on <i>MyBean</i>'s class to define the injection: <br /><br /><pre class="xml" name="code">package org.jboss.test; <br /><br />import javax.inject.Inject; <br /><br />public class Bean{<br /><br /> Dependency dependency;<br /><br /> @Inject<br /> public void setDependency(Dependency dependency){ <br /> this.dependency = dependency;<br /> } <br />} <br /></pre>What happens now is that when <i>MyBean</i> is deployed we find the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@javax.inject.Inject</span> annotation on the <i>dependency</i> property and this causes a lookup of the bean to be found. As in the last example it looks up the bean by type, and throws an error if more that one can be found. <br /><br /><span class="Apple-style-span" style="font-size: x-large;">Qualifiers to the rescue </span><br />If we deploy the following beans:<br /><pre class="xml" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;deployment xmlns="urn:jboss:bean-deployer:2.0"&gt;<br /> &lt;bean name="SomeDependency" class="org.jboss.test.SomeDependency"/&gt;<br /> &lt;bean name="TestDependency" class="org.jboss.test.TestDependency"/&gt;<br /> &lt;bean name="MyBean" class="org.jboss.test.Bean"/&gt;<br />&lt;/deployment&gt;</pre><br />with the following classes<br /><pre class="xml" name="code">package org.jboss.test;<br /><br />public class SomeDependency extends Dependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;<br /><br />public class TestDependency extends Dependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;</pre><pre class="xml" name="code">import javax.inject.Inject;<br /><br />public class Bean{<br /> Dependency dependency;<br /><br /> @Inject<br /> public void setDependency(Dependency dependency){<br /> this.dependency = dependency;<br /> }<br />}<br /></pre><br />Now we have an ambiguity since both <i>TestDependency</i> and <i>SomeDependency</i> can be cast to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.test.Dependency</span>. To give the Microcontainer a hint about which of these instances should be used we can use a qualifier. A qualifier is any annotation that has been annotated with the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@javax.inject.Qualifier</span> annotation. For example:<br /><pre class="xml" name="code">package org.jboss.test;<br /><br />import javax.inject.Qualifier;<br /><br />@Qualifier<br />@Retention(RUNTIME)<br />public @interface Test{<br />}<br /></pre><br />Now we can use this qualifier on our beans by adding it to <i>TestDependency</i>'s class and to the <i>Bean.dependency</i> injection point:<br /><br /><pre class="xml" name="code">package org.jboss.test;<br /><br />@Test<br />public class TestDependency extends Dependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;<br /><br />import javax.inject.Inject;<br /><br />public class Bean{<br /> Dependency dependency;<br /><br /> @Inject @Test<br /> public void setDependency(Dependency dependency){<br /> this.dependency = dependency;<br /> }<br />}</pre><br />Now the Microcontainer will look up all beans that can be cast to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.test.Dependency</span> AND that have the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@org.jboss.test.Test</span> annotation. In this case only <i>TestDependency</i> satisfies those criteria and is used for injection.<br /><br /><span class="Apple-style-span" style="font-size: x-large;">Qualifiers via xml</span><br />As part of implementing qualifiers in the Microcontainer we built in native support for qualifiers and came up with something somewhat more powerful that what is indicated by JSR-330. First let's deploy the classes from the previous example without any annotations:<br /><br /><pre class="xml" name="code">package org.jboss.test;<br /><br />public class SomeDependency extends Dependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;<br /><br />public class TestDependency extends Dependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;<br /><br />import javax.inject.Inject;<br /><br />public class Bean{<br /> Dependency dependency;<br /><br /> public void setDependency(Dependency dependency){<br /> this.dependency = dependency;<br /> }<br />}</pre><br />This time the injection and qualifier annotations are driven by xml:<br /><br /><pre class="xml" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;deployment xmlns="urn:jboss:bean-deployer:2.0"&gt;<br /> &lt;bean name="SomeDependency" class="org.jboss.test.SomeDependency"/&gt;<br /> &lt;bean name="TestDependency" class="org.jboss.test.TestDependency"&gt;<br /> &lt;qualifier content="Annotation"&gt;@org.jboss.test.Test&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br /> &lt;bean name="MyBean" class="org.jboss.test.Bean"&gt;<br /> &lt;property name="dependency"&gt;<br /> &lt;inject&gt;<br /> &lt;qualifier content="Annotation" type="Required"&gt;@org.jboss.Test&lt;/qualifier&gt;<br /> &lt;/inject&gt;<br /> &lt;/property&gt;<br /> &lt;/bean&gt;<br />&lt;/deployment&gt;</pre><br />Now, we're saying that <i>TestDependency</i> provides the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@org.jboss.test.Test</span> qualifier, and when injecting <i>Bean.dependency</i> we want to inject any bean that is of type <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Dependency</span> and that has the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@org.jboss.test.Test</span> qualifier. As when using "real" annotations it will pick out the <i>TestDependency</i> bean. The qualifier content is <i>Annotation</i> which means the parser will try to create an annotation from the body of the qualifier annotation. When qualifier annotations are applied in this way, they do not need to be annotated with <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">@javax.inject.Inject</span>.<br /><br />A qualifier does not have to be an annotation, simple strings can be used by omitting the content attribute:<br /><pre class="xml" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;deployment xmlns="urn:jboss:bean-deployer:2.0"&gt;<br /> &lt;bean name="SomeDependency" class="org.jboss.test.SomeDependency"/&gt;<br /> &lt;bean name="TestDependency" class="org.jboss.test.TestDependency"&gt;<br /> &lt;qualifier&gt;test&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br /> &lt;bean name="MyBean" class="org.jboss.test.Bean"&gt;<br /> &lt;property name="dependency"&gt;<br /> &lt;inject&gt;<br /> &lt;qualifier type="Required"&gt;test&lt;/qualifier&gt;<br /> &lt;/inject&gt;<br /> &lt;/property&gt;<br /> &lt;/bean&gt;<br />&lt;/deployment&gt;</pre><br />Qualifiers can also be used in other places supporting the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">inject</span>&nbsp;element, such as parameters to constructors and install methods.<br /><br /><span class="Apple-style-span" style="font-size: x-large;">Bean level qualifiers</span><br />In the previous example we applied qualifiers to a particular property. As a convenience you can choose default qualifiers that should be applied when doing injection at bean level. This is useful when you have a lot of properties that need injecting, here is an example:<br /><pre class="xml" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;deployment xmlns="urn:jboss:bean-deployer:2.0"&gt;<br /> &lt;bean name="SomeDependency" class="org.jboss.test.SomeDependency"/&gt;<br /> &lt;bean name="TestDependency" class="org.jboss.test.TestDependency"&gt;<br /> &lt;qualifier&gt;test&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br /> &lt;bean name="SomeOtherDependency" class="org.jboss.test.SomeOtherDependency"&gt;<br /> &lt;qualifier&gt;test&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br /> &lt;bean name="TestOtherDependency" class="org.jboss.test.TestOtherDependency"&gt;<br /> &lt;qualifier&gt;test&lt;/qualifier&gt;<br /> &lt;qualifier&gt;other&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br /> &lt;bean name="MyBean" class="org.jboss.test.Bean"&gt;<br /> &lt;qualifier type="Required"&gt;test&lt;/qualifier&gt;<br /> &lt;qualifier type="Optional"&gt;other&lt;/qualifier&gt;<br /> &lt;property name="dependency"&gt;&lt;inject/&gt;&lt;/property&gt;<br /> &lt;property name="otherDependency"&gt;&lt;inject/&gt;&lt;/property&gt;<br /> &lt;/bean&gt;<br />&lt;/deployment&gt;</pre><br />Now we are saying that when doing contextual injection into <i>MyBean</i>'s properties, the candidate beans MUST have the <i>test</i> qualifier, and that the <i>other</i> qualifier can be used to further strip out ambiguities. If we have the following bean classes:<br /><br /><pre class="xml" name="code">package org.jboss.test;<br /><br />public class SomeDependency extends Dependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;<br /><br />public class TestDependency extends Dependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;<br /><br />public class SomeOtherDependency extends OtherDependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;<br /><br />public class TestOtherDependency extends OtherDependency{<br />}<br />- - - - - - - - -<br />package org.jboss.test;<br /><br />import javax.inject.Inject;<br /><br />public class Bean{<br /> Dependency dependency;<br /><br /> OtherDependency otherDependency;<br /><br /> public void setDependency(Dependency dependency){<br /> this.dependency = dependency;<br /> }<br /><br /> public void setOtherDependency(OtherDependency otherDependency){<br /> this.otherDependency = otherDependency;<br /> }<br />}</pre><br />then <i>TestDependency</i> is used for <i>MyBean.dependency</i> and <i>TestOtherDependency</i> is used for injection into <i>MyBean.otherDependency</i>.<br /><br /><span class="Apple-style-span" style="font-size: x-large;">Custom qualifiers</span><br />If the above qualifiers are not enough to narrow down what you want to inject, you can create custom qualifiers as shown in this simple example. If we deploy the following beans we end up with <i>Dependency3</i> being injected into <i>MyBean.dependency</i>:<br /><pre class="xml" name="code">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;deployment xmlns="urn:jboss:bean-deployer:2.0"&gt;<br /> &lt;bean name="TestMatcherAndParser"<br /> class="org.jboss.test.kernel.qualifiers.support.TestMatcherAndParser"/&gt;<br /> &lt;bean name="QualifierMatchers" class="org.jboss.kernel.spi.qualifier.QualifierMatchers"&gt;<br /> &lt;constructor factoryMethod="getInstance"&gt;<br /> &lt;/constructor&gt;<br /> &lt;install method="addParser"&gt;<br /> &lt;parameter&gt;&lt;inject bean="TestMatcherAndParser"/&gt;&lt;/parameter&gt;<br /> &lt;/install&gt;<br /> &lt;install method="addMatcher"&gt;<br /> &lt;parameter&gt;&lt;inject bean="TestMatcherAndParser"/&gt;&lt;/parameter&gt;<br /> &lt;/install&gt;<br /> &lt;/bean&gt; <br /> &lt;bean name="Dependency1" class="org.jboss.test.SomeDependency"&gt;<br /> &lt;qualifier&gt;test&lt;/qualifier&gt;<br /> &lt;qualifier content="Test"&gt;Hello-xxx&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br /> &lt;bean name="Dependency2" class="org.jboss.test.Dependency"&gt;<br /> &lt;qualifier&gt;test&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br /> &lt;bean name="Dependency3" class="org.jboss.test.TestDependency"&gt;<br /> &lt;qualifier&gt;test&lt;/qualifier&gt;<br /> &lt;qualifier content="Test"&gt;Hola-xxx&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br /> &lt;bean name="MyBean" class="org.jboss.test.Bean"&gt;<br /> &lt;qualifier type="Required"&gt;test&lt;/qualifier&gt;<br /> &lt;qualifier type="Required" content="Test"&gt;xxx-Hola&lt;/qualifier&gt;<br /> &lt;/bean&gt;<br />&lt;/deployment&gt;</pre><br />The magic behind understanding <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">content="Test"</span> lives in the <i>TestMatcherAndParser</i> bean which is installed via the <i>QualifierParser</i> singleton:<br /><pre class="xml" name="code">package org.jboss.test.kernel.qualifiers.support;<br /><br />import java.util.Set;<br />import org.jboss.beans.metadata.api.model.QualifierContent;<br />import org.jboss.dependency.spi.ControllerContext;<br />import org.jboss.kernel.spi.qualifier.QualifierMatcher;<br />import org.jboss.kernel.spi.qualifier.QualifierParser;<br /><br />public class TestMatcherAndParser implements QualifierMatcher, QualifierParser{<br /> public TestMatcherAndParser(){<br /> }<br /><br /> //QualifierParser methods<br /> public QualifierContent getHandledContent(){<br /> return QualifierContent.getContent("Test");<br /> }<br /><br /> public Object parseSupplied(ClassLoader cl, Object rawQualifier){<br /> return new Supplied((String)rawQualifier);<br /> }<br /><br /> public Object parseWanted(ClassLoader cl, Object object){<br /> return new Wanted((String)object);<br /> }<br /><br /> //QualifierMatcher methods<br /> public Class getHandledType(){<br /> return Wanted.class;<br /> }<br /><br /> public boolean matches(ControllerContext context, Set&lt;Object&gt; suppliedQualifiers, Wanted qualifier){<br /> for (Object supplied : suppliedQualifiers){<br /> if (supplied instanceof Supplied)<br /> return qualifier.getString().equals(((Supplied)supplied).getString());<br /> }<br /> return false;<br /> }<br /><br /> private static class Supplied{<br /> String string;<br /><br /> public Supplied(String string){<br /> int i = string.indexOf("-xxx");<br /> if (i &gt;= 0)<br /> string = string.substring(0, i);<br /> this.string = string;<br /> }<br /><br /> public String getString(){<br /> return string;<br /> }<br /> }<br />}<br />- - - - - - - - -<br />package org.jboss.test.kernel.qualifiers.support;<br /><br />public class Wanted{<br /> String string;<br /> public Wanted(String string){<br /> this.string = string;<br /> if (string.startsWith("xxx-"))<br /> string = string.substring(4);<br /> this.string = string;<br /> }<br /><br /> public String getString(){<br /> return string;<br /> }<br />}</pre><br /><i>TestMatcherAndParser</i> implements the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">QualifierParser</span> and <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">QualifierMatcher</span> interfaces. The <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">getHandledContent()</span> method is what links this parser to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">content="Test"</span>. When parsing a qualifier with that content type supplied from from a bean (e.g. the qualifier entries in <i>Dependency1</i> and <i>Dependency3</i>) we end up in the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">parseSupplied()</span> method which creates an instance of <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Supplied</span>. Similarly when parsing a qualifier with that content type from a bean wanting to inject something we end up in the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">parseWanted()</span> method which creates an instance of <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Wanted</span>.<br /><br />So for <i>Dependency1</i> we end up with a <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Supplied</span> containing the string <i>Hello</i> and for <i>Dependency3</i> we end up with a <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Supplied</span> containing the string <i>Hola</i>. We end up with a <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Wanted</span> containing the string <i>Hola</i> for <i>MyBean</i>.<br />Next when checking the qualifiers when doing injection into <i>MyBean</i> and checking<br /><br /><pre class="xml" name="code">&lt;qualifier type="Required" content="Test"&gt;xxx-Hola&lt;/qualifier&gt;</pre><br />behind the scenes the microcontainer finds all the contexts that are of the correct type and which have supplied qualifiers where type <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">content="Test"</span>, i.e. the contexts <i>Dependency1</i> and <i>Dependency3</i>. Then for each of these contexts it calls <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">matches()</span> with all the qualifiers for the candidate bean along with the parsed <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Wanted</span> qualifier for MyBean.<br /><br />When checking <i>Dependency1</i> it calls <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">matches() </span>with the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Supplied</span> containing <i>Hello</i> and the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Wanted</span> containing <i>Hola</i> which does not match, and for <i>Dependency2</i> it calls <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">matches()</span> with the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Supplied</span> containing <i>Hello</i> and the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Wanted</span> containing <i>Hola</i> which matches, meaning that only <i>Dependency1</i> matches all the criteria. When calling <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">matches()</span> the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ControllerContext</span> (with information about the candidate bean's name, type, instance and other things) is passed in as well.<br /><br />In the provided example we are only doing a silly little check where the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Supplied</span> gets rid of the final <i>-xxx</i> and the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Wanted</span> gets rid of the leading <i>-xxx</i>. The point here is that it is simple to implement more advanced qualifier checking than is provided out-of-the-box, and this mechanism has already been used to provide support for matching OSGi properties.The latest JBoss Microcontainer jboss-kernel 2.2.0.Alphas contain support for the @javax.inject.Inject and @javax.inject.Qualifier annotations from JSR-330. While most of the use of the JBoss Microcontainer in JBoss AS uses explicitly named injection, e.g. The above means that when deploying the MyBean bean bean it will look up the MyDependency bean by name and inject that instance ...JBoss in Bossa and AOSD112010-05-03T18:18:01-04:00searchisko:content:id:jbossorg_blog-jboss_in_bossa_and_aosd112010-05-03T16:45:00-04:00Flavia RainoneAs the developer comunity grows in size and in expertise here in Brazil, it is natural that Brazil becomes host to new conferences.<br /><br />I'm proud to be part of two distinct efforts in that direction.<br /><br />To start, we are having the first edition of JBoss in Bossa, the Brazilian annual conference for the JBoss Brazil community, which is going to be hosted in Sao Paulo.<br />There is not too much time left to register, but you can still do it <a href="http://www.jbossinbossa.com.br/app/precosinscricoes.html">here</a>.<br /><br />The goal is to promote discussion around the news in the Java technology and in JBoss community projects. The agenda includes a presentation by Pete Muir, lead of JBoss Seam and Weld.<br /><br />If you are attending JBoss In Bossa, I invite you to my presentation, where I'm going to talk about the new JBoss AS 6! You can check the agenda <a href="http://www.jbossinbossa.com.br/2010/agenda.html">here</a>.<br /><br />Plus, I am also proud to announce that <a href="http://www.aosd.net/2011/">AOSD11</a> is going to be held in Brazil. As a committee chair of the Industry Track program, I encourage everybody involved with Aspect Oriented Software Development and related technologies to submit a paper. This is the perfect chance to get engaged with the AOSD community and to get to visit Brazil.<br /><br />AOSD11 is going to be held in Porto de Galinhas, a paradisiac beach in the northeastern region. Stay tuned, as I'll post here more information on the conference and on the main topics of interest!As the developer comunity grows in size and in expertise here in Brazil, it is natural that Brazil becomes host to new conferences. I'm proud to be part of two distinct efforts in that direction. To start, we are having the first edition of JBoss in Bossa, the Brazilian annual conference for the JBoss Brazil community, which is going to be hosted in Sao Paulo. There is not too much time left to re...Microcontainer Inspector Tool2010-07-12T05:23:30-04:00searchisko:content:id:jbossorg_blog-microcontainer_inspector_tool2010-03-08T12:33:00-05:00Kabir KhanFor those of you familiar with the Twiddle application, which&nbsp;allows you to inspect the JMX MBeans in JBoss Application Server, I have created a similar tool for use with the <a href="http://www.jboss.org/jbossmc">JBoss Microcontainer</a>. This means that you can now manage and inspect ALL the beans in the JBoss Application Server (or in a standalone Microcontainer application). I'll briefly outline the existing functionality below and how to use it. The functionality supported so far is quite basic, but hopefully it will be useful to somebody. I'll be adding more commands to it when I have the time.<br /><br />Implementing commands to extend the feature set is very easy. If you would like to be a Microcontainer committer, this is a great opportunity to get involved by implementing something simple while you get to know the code and the team. If you are interested please contact me <a href="mailto:kabir.khan@jboss.com">privately</a> or via our <a href="http://community.jboss.org/en/jbossmc/dev?view=discussions">forums</a>.<br /><br /><span class="Apple-style-span" style="font-size: x-large;">Installation</span><br />If you want to run this in a standalone environment you simply create an instance of <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.microcontainer.mcinspector.bean.McInspector</span> and pass it your bootstrapped kernel as shown in the test cases. To install it into a JBoss Application Server installed to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">~/jbossas/</span>:<br /><br /><br /><ul><li>Check out the source from <a href="http://anonsvn.jboss.org/repos/jbossas/projects/mc-tools/mcinspector/trunk/">http://anonsvn.jboss.org/repos/jbossas/projects/mc-tools/mcinspector/trunk/</a>&nbsp;</li><li>Build it by going to the checkout directory and run <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">mvn install</span></li><li>Copy <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">target/mcinspector-server.jar</span> to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">~/jbossas/server/default/deploy</span></li><li>Copy <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">target/mcinspector.jar</span> to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">~/jbossas/bin</span></li><li>Copy <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">src/main/resources/mcinspector.sh</span> to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">~/jbossas/bin</span></li><li><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">chmod 755 ~/jbossas/bin/mcinspector.sh</span></li></ul><br />That's all, now start up JBoss as normal, and in another terminal:&nbsp;<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">cd ~/jbossas/bin</span>. This last terminal is the one we will be using to try out the commands in the rest of this demo.<br /><br /><span class="Apple-style-span" style="font-size: x-large;">Help</span><br />To get help you enter: <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">./mcinspector.sh help</span>, which gives you an overview of the commands available. The command and its output are shown below:<br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh help</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Available commands:</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;help &nbsp; Prints the list of available commands.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;list &nbsp; Lists all the available contexts.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;change Changes the state of the context.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;bean &nbsp; Inspect a particular bean.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">For more information about a particular command, enter 'help '.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Handled in 1026ms</span><br /><br />You can also get more information about a particular command, e.g.:<br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh help list</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Lists all the contexts in the controller.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Usage: list [-o | -v] [ []*]</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">If no state arguments are passed in all states will be checked for contexts. Otherwise</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">only the passed in states will be checked</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Options:</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-o Overview. Show all the states in the controller with the number of contexts in each</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp; Normally only states with contexts will be shown</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-e Error. Show only the contexts which are in the error state. Can not be used in combination &nbsp;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp; with state arguments.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-v Verbose. Show extra information for each context. Contexts with unresolved dependencies</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp; will&nbsp;have a '*' after their name. Additional information is in the format&nbsp;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp; (ControllerMode, Current state)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Handled in 523ms</span><br /><br /><span class="Apple-style-span" style="font-size: x-large;">List</span><br />Let's try out the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">list</span> command. As promised in the help section, it lists all the states, in ascending order, in the Application Server's main controller and displays the number of beans found in each state:<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh list -o</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">NOT INSTALLED: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">PREPARSE: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">PARSE: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">POSTPARSE: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">PREDESCRIBE: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">DESCRIBE: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">CLASSLOADER: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">POSTCLASSLOADER: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">PREREAL: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">REAL: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">PREINSTALL: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">DESCRIBED: 33 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">INSTANTIATED: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">CONFIGURED: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">CREATE: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">START: 0 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">INSTALLED: 997 contexts</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Handled in 509ms</span><br /><br />To view which beans are in the different states we execute <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">./mcinspector.sh list</span>. Since there are lot of beans in the Application Server I have deleted most of the output below:<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">DESCRIBED: </span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">JBossLogManagerContextSelectorService</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.nio.NioDatagramChannelFactory</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.oio.OioClientSocketChannelFactory</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.oio.OioServerSocketChannelFactory</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.oio.OioDatagramChannelFactory</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.local.DefaultLocalClientChannelFactory</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.local.DefaultLocalServerChannelFactory</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ModClusterListener</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ModClusterService</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">...</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">INSTALLED: </span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">JBossServer</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ClassLoaderSystem</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ClassLoaderDomain</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ClassLoading</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bootstrap-classloader:0.0.0$MODULE</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bootstrap-classloader:0.0.0</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">stdio-classloader:0.0.0$MODULE</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">stdio-classloader:0.0.0</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">JBossStdioSystemOutStream</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">JBossStdioSystemErrStream</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">…</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">McInspectorCommands</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">McInspector</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.kernel:service=McInspector</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">McInspectorHelpCommand</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">McInspectorListCommand</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">McInspectorChangeCommand</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">McInspectorBeanCommand</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">file:///Users/kabir/sourcecontrol/jbossas/trunk/subversion/build/target/jboss-6.0.0-SNAPSHOT/server/default/deploy/mcinspector.jar</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Handled in 596ms</span><br /><br />To get more information about the contexts for a given state, you can do <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">./mcinspector.sh list -v DESCRIBED</span>. The verbose output currently shows the controller mode of the beans' contexts, along with the current state of the bean. The * means that the context has unresolved dependencies.<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh list -v DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">DESCRIBED: </span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">JBossLogManagerContextSelectorService* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.nio.NioDatagramChannelFactory* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.oio.OioClientSocketChannelFactory* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.oio.OioServerSocketChannelFactory* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.socket.oio.OioDatagramChannelFactory* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.local.DefaultLocalClientChannelFactory (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">org.jboss.netty.channel.local.DefaultLocalServerChannelFactory (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ModClusterListener* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ModClusterService* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">HAModClusterService* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ModClusterConfig* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">DynamicLoadBalanceFactorProvider* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">AverageSystemLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">OperatingSystemLoadMetricSource (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">BusyConnectorsLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ThreadPoolLoadMetricSource* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">SimpleLoadBalanceFactorProvider* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">SystemMemoryUsageLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">HeapMemoryUsageLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">RequestCountLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ReceiveTrafficLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">SendTrafficLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">RequestProcessorLoadMetricSource* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ActiveSessionsLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">SessionLoadMetricSource* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ConnectionPoolUsageMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">ConnectionPoolLoadMetricSource* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">MBeanAttributeLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">MBeanAttributeRatioLoadMetric* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">MBeanQueryLoadMetricSource* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">XnioProvider* (ON_DEMAND, DESCRIBED)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Handled in 479ms</span><br /><br /><span class="Apple-style-span" style="font-size: x-large;">Bean</span><br />To get more information about one or more beans in particular, you can run the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bean</span> command. e.g.:<br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh bean ModClusterListener ModClusterService</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Name='ModClusterListener'</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;bean type=org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;mode=ON_DEMAND</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;state=DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;required state=DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;context type=org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;unresolved dependencies=1</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Name='ModClusterService'</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;bean type=org.jboss.modcluster.ModClusterService</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;mode=ON_DEMAND</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;state=DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;required state=DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;context type=org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;unresolved dependencies=5</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Handled in 485ms</span><br /><br />To get some more information about the dependencies, you can pass in the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-d</span> flag<br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh bean -d ModClusterListener</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Name='ModClusterListener'</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;bean type=org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;mode=ON_DEMAND</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;state=DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;required state=DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;context type=org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;unresolved dependencies=1</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;Resolved dependencies:</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;Unresolved dependencies:</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp; &nbsp;iDependOn=ModClusterService; whenRequired=INSTANTIATED; dependentState=INSTALLED</span><br /><br />The <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-u</span> flag is the same as <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-d</span> apart from it does not look for resolved dependencies:<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh bean -d ModClusterListener</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Name='ModClusterListener'</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;bean type=org.jboss.modcluster.catalina.CatalinaEventHandlerAdapter</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;mode=ON_DEMAND</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;state=DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;required state=DESCRIBED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;context type=org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;unresolved dependencies=1</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;Unresolved dependencies:</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp; &nbsp;iDependOn=ModClusterService; whenRequired=INSTANTIATED; dependentState=INSTALLED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Handled in 492ms</span><br /><div><br /></div><br /><span class="Apple-style-span" style="font-size: x-large;">Change</span><br />Finally there is the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">change</span> command which attempts to change the state of a bean, so it can for example be used to temporarily disable a bean. Only do this if you know what you are doing! For example, let us try to stop the bean that implements the MC Inspector's&nbsp;<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bean</span> command:<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh change INSTANTIATED McInspectorBeanCommand</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Changed 'McInspectorBeanCommand' to INSTANTIATED</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Handled in 473ms</span><br /><br />This has stopped the bean implementing the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bean</span> command, so <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bean</span> no longer appears in the list of available commands:<br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">$./mcinspector.sh help</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Available commands:</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;help Prints the list of available commands.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;list Lists all the available contexts.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;change Changes the state of the context.</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;&nbsp;For more information about a particular command, enter 'help </span><command><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">'.<br />Handled in 497ms</span> <br />And it appears in the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">INSTANTIATED</span> state:<br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> $./mcinspector.sh list INSTANTIATED -v<br />INSTANTIATED: <br />McInspectorBeanCommand (AUTOMATIC, INSTANTIATED)<br />Handled in 488ms</span><br /><br />Let us make it installed again:<br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> $./mcinspector.sh change INSTALLED McInspectorBeanCommand<br />Changed 'McInspectorBeanCommand' to INSTALLED<br />Handled in 474ms</span> <br />Now <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">bean</span> appears in the list of available commands again:<br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"> $./mcinspector.sh help<br />Available commands:<br />&nbsp;&nbsp;help Prints the list of available commands.<br />&nbsp;&nbsp;list Lists all the available contexts.<br />&nbsp;&nbsp;change Changes the state of the context.<br />&nbsp;&nbsp;bean Inspect a particular bean.<br />For more information about a particular command, enter 'help </span><command><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">'.<br />Handled in 480ms</span> <br /><br /></command></command>For those of you familiar with the Twiddle application, which allows you to inspect the JMX MBeans in JBoss Application Server, I have created a similar tool for use with the JBoss Microcontainer. This means that you can now manage and inspect ALL the beans in the JBoss Application Server (or in a standalone Microcontainer application). I'll briefly outline the existing functionality below and how...Optimizing the JBoss Microcontainer2010-02-19T07:07:15-05:00searchisko:content:id:jbossorg_blog-optimizing_the_jboss_microcontainer2010-02-19T06:01:00-05:00Kabir Khan<span class="Apple-style-span" style="font-family: Helvetica;"></span><br /><div><a href="http://in.relation.to/Bloggers/MC22SeriesAndNewJBossAS6M2">Ales</a> linked to the ongoing optimization work before I had planned on writing anything, so here is a very rushed overview of what is going on :-)&nbsp;</div><div><br /></div><div>For <a href="http://bstansberry.wordpress.com/2010/02/16/jboss-application-server-6-0-0-m2-is-out/">JBoss Application Server 6.0.0.M2</a> a lot of work went in to optimizing the boot time. Some of the work done by the AS team that really made a difference was optimizing the algorithm to add the deployers, and to make things like the admin console start when first accessed rather than use eager loading.</div><div><br /></div><div>As part of this, for JBoss Kernel 2.2.0.Alpha6 I took a look at optimizing the dependency resolution algorithm of the Microcontainer, which is used to install and wire together the services the core of the application server. The dependency resolution algorithm is used to determine if the beans implementing the services can be moved through the states on the way from being put into the Microcontainer to being fully up and running. Initially I did work on a <a href="http://community.jboss.org/thread/146838">fully optimized prototype</a>, but this was too big and risky an undertaking for the short timeframe and did not yield the expected results. This prototype is far from "finished" and there is plenty of room for improvement, so I might come back to it at some later stage.</div><div><br /></div><div>So instead I went through and used&nbsp;<a href="http://www.ej-technologies.com/products/jprofiler/overview.html">JProfiler</a>&nbsp;to see what is taking the time in the dependency resolution algorithm that we have <a href="http://community.jboss.org/thread/147883">today</a>. What really made a difference here was that I found that when a bean can not be moved to the next state we were looking up its unresolved dependency three times in the Microcontainer. Wrapping these three calls into one gave a lot less overhead. That was the main optimization we had time for for JBoss Kernel 2.2.0.Alpha6 which is what is used in AS 6.0.0.M2.&nbsp;</div><div><br /></div><div>Since then I have been working on quite a few other optimizations that you can see on the <a href="http://community.jboss.org/community/jbossmc/dev?view=discussions&amp;start=0">Microcontainer Development Forum</a>, more specifically <a href="http://community.jboss.org/thread/148044">here</a>, which so far significantly improve the boot time of 6.0.0.M2 in my local benchmarks, and I am nowhere not done yet. The fixes are mainly making sure that objects used in maps are properly hashed, and making objects that are expensive to create less expensive to create. All these fixes will all go into the next community release of JBoss AS: 6.0.0.M3.</div><div><br /></div><div>Another thing is that John Bailey is currently integrating JBoss Virtual File System 3 into AS. VFS is used as an abstraction layer to read files from several different sources, and VFS 3 promises to really speed things up when reading from zipped archives. This is something that happens a lot in the application server, when scanning archives for deployment descriptors and annotations, and loading classes and so on. So it will be very exciting to see this in JBoss AS 6.0.0.M3!</div>Ales linked to the ongoing optimization work before I had planned on writing anything, so here is a very rushed overview of what is going on :-) For JBoss Application Server 6.0.0.M2 a lot of work went in to optimizing the boot time. Some of the work done by the AS team that really made a difference was optimizing the algorithm to add the deployers, and to make things like the admin console start...Findbugs Filter Creation Tool2009-10-05T14:36:10-04:00searchisko:content:id:jbossorg_blog-findbugs_filter_creation_tool2009-10-05T11:00:00-04:00Kabir KhanWe have started using findbugs on some of the projects I am working on. It seems pretty useful, and it has picked out some bugs already. It does however, report quite a few bugs that are not a problem. Luckily, findbugs provides <a href="http://findbugs.sourceforge.net/manual/filter.html">filters</a> to be able to exclude the bugs you don't want to include.<br /><br />After spending a day on creating the filter files manually, I found it to be a bit fiddly and time-consuming to create these by hand. I tried looking to see if there was a way to automate this a bit more. I might be wrong, but I could not find a tool to do this. Hopefully the below will help others in the same situation.<br /><br />When you run a findbugs check it generates an output file. I do this via the maven plugin: <code>mvn findbugs:check</code> which yields a file called <code>findbugsCheck.xml</code>. This file references an xsl stylesheet:<br /><pre name="code" class="xml">&lt;?xml-stylesheet type="text/xsl" href="http://findbugs.sourceforge.net/xsl/default.xsl"?&gt;</pre><br />so if you open this file in your browser you will see something like this:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TXHtTxzXe9g/SsoVOiaq2aI/AAAAAAAAAAM/PuBbHYVHcjo/s1600-h/original.png"><img style="width: 320px; height: 182px;" src="http://1.bp.blogspot.com/_TXHtTxzXe9g/SsoVOiaq2aI/AAAAAAAAAAM/PuBbHYVHcjo/s320/original.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5389143243603237282" /></a><br /><br />I created another version of default.xsl called <a href="http://anonsvn.jboss.org/repos/jbossas/projects/findbugs-filtercreator/trunk/filterHelper.xsl">filterHelper.xsl</a>. Modifying findbugsCheck.xml to use this stylesheet:<br /><pre name="code" class="xml">&lt;?xml-stylesheet type="text/xsl" href="http://anonsvn.jboss.org/repos/jbossas/projects/findbugs-filtercreator/trunk/filterHelper.xsl"?&gt;</pre><br />gives output that looks much the same<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_TXHtTxzXe9g/SsoVPJWp-cI/AAAAAAAAAAU/kAGMTE6CroM/s1600-h/helper.png"><img style="width: 320px; height: 246px;" src="http://2.bp.blogspot.com/_TXHtTxzXe9g/SsoVPJWp-cI/AAAAAAAAAAU/kAGMTE6CroM/s320/helper.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5389143254055385538" /></a><br />Now each bug has a a checkbox next to it. Check the bugs you want to create an exclude filter for, press the "Create Filter" button and the textarea gets populated with the <code>Match</code> elements for each bug.<br /><br />You can then copy the results into a file, in my projects they are under <code>src/main/resources/findbugs/exclude.xml</code>. For example:<br /><pre name="code" class="xml">&lt;FindBugsFilter&gt;<br />&lt;Match&gt;<br /> &lt;Class name="org.jboss.system.ServiceMBeanSupport"/&gt;<br /> &lt;Field name="SERVICE_CONTROLLER_SIG"/&gt;<br /> &lt;Bug pattern="MS_PKGPROTECT"/&gt;<br />&lt;/Match&gt;<br />&lt;!-- Rest of exclusions here --&gt;<br />&lt;/FindBugsFilter&gt;</pre><br />Then set maven up to use the filter in the plugins section:<br /><pre name="code" class="xml">&lt;plugin&gt;<br /> &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;<br /> &lt;artifactId&gt;findbugs-maven-plugin&lt;/artifactId&gt;<br /> &lt;version&gt;2.0.1&lt;/version&gt;<br /> &lt;configuration&gt;<br /> &lt;excludeFilterFile&gt;${project.build.outputDirectory}/findbugs/exclude.xml&lt;/excludeFilterFile&gt;<br /> &lt;debug&gt;true&lt;/debug&gt;<br /> &lt;/configuration&gt;<br />&lt;/plugin&gt;</pre>We have started using findbugs on some of the projects I am working on. It seems pretty useful, and it has picked out some bugs already. It does however, report quite a few bugs that are not a problem. Luckily, findbugs provides filters to be able to exclude the bugs you don't want to include. After spending a day on creating the filter files manually, I found it to be a bit fiddly and time-consum...Findbugs Filter Creation2009-10-05T14:31:19-04:00searchisko:content:id:jbossorg_blog-findbugs_filter_creation2009-10-05T11:00:00-04:00Kabir KhanWe have started using findbugs on some of the projects I am working on. It seems pretty useful, and it has picked out some bugs already. It does however, report quite a few bugs that are not a problem. Luckily, findbugs provides <a href="http://findbugs.sourceforge.net/manual/filter.html">filters</a> to be able to exclude the bugs you don't want to include.<br /><br />After spending a day on creating the filter files manually, I found it to be a bit fiddly and time-consuming to create these by hand. I tried looking to see if there was a way to automate this a bit more. I might be wrong, but I could not find a tool to do this. Hopefully the below will help others in the same situation.<br /><br />When you run a findbugs check it generates an output file. I do this via the maven plugin: <code>mvn findbugs:check</code> which yields a file called <code>findbugsCheck.xml</code>. This file references an xsl stylesheet:<br /><pre name="code" class="xml">&lt;?xml-stylesheet type="text/xsl" href="http://findbugs.sourceforge.net/xsl/default.xsl"?&gt;</pre><br />so if you open this file in your browser you will see something like this:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TXHtTxzXe9g/SsoVOiaq2aI/AAAAAAAAAAM/PuBbHYVHcjo/s1600-h/original.png"><img style="width: 320px; height: 182px;" src="http://1.bp.blogspot.com/_TXHtTxzXe9g/SsoVOiaq2aI/AAAAAAAAAAM/PuBbHYVHcjo/s320/original.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5389143243603237282" /></a><br /><br />I created another version of default.xsl called <a href="http://anonsvn.jboss.org/repos/jbossas/projects/findbugs-filtercreator/trunk/filterHelper.xsl">filterHelper.xsl</a>. Modifying findbugsCheck.xml to use this stylesheet:<br /><pre name="code" class="xml">&lt;?xml-stylesheet type="text/xsl" href="hhttp://anonsvn.jboss.org/repos/jbossas/projects/findbugs-filtercreator/trunk/filterHelper.xsl"?&gt;</pre><br />gives output that looks much the same<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_TXHtTxzXe9g/SsoVPJWp-cI/AAAAAAAAAAU/kAGMTE6CroM/s1600-h/helper.png"><img style="width: 320px; height: 246px;" src="http://2.bp.blogspot.com/_TXHtTxzXe9g/SsoVPJWp-cI/AAAAAAAAAAU/kAGMTE6CroM/s320/helper.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5389143254055385538" /></a><br />Now each bug has a a checkbox next to it. Check the bugs you want to create an exclude filter for, press the "Create Filter" button and the textarea gets populated with the <code>Match</code> elements for each bug.<br /><br />You can then copy the results into a file, in my projects they are under <code>src/main/resources/findbugs/exclude.xml</code>. For example:<br /><pre name="code" class="xml">&lt;FindBugsFilter&gt;<br />&lt;Match&gt;<br /> &lt;Class name="org.jboss.system.ServiceMBeanSupport"/&gt;<br /> &lt;Field name="SERVICE_CONTROLLER_SIG"/&gt;<br /> &lt;Bug pattern="MS_PKGPROTECT"/&gt;<br />&lt;/Match&gt;<br />&lt;!-- Rest of exclusions here --&gt;<br />&lt;/FindBugsFilter&gt;</pre><br />Then set maven up to use the filter in the plugins section:<br /><pre name="code" class="xml">&lt;plugin&gt;<br /> &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;<br /> &lt;artifactId&gt;findbugs-maven-plugin&lt;/artifactId&gt;<br /> &lt;version&gt;2.0.1&lt;/version&gt;<br /> &lt;configuration&gt;<br /> &lt;excludeFilterFile&gt;${project.build.outputDirectory}/findbugs/exclude.xml&lt;/excludeFilterFile&gt;<br /> &lt;debug&gt;true&lt;/debug&gt;<br /> &lt;/configuration&gt;<br />&lt;/plugin&gt;</pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37420196-8596229716013379474?l=kabir-khan.blogspot.com'/></div>We have started using findbugs on some of the projects I am working on. It seems pretty useful, and it has picked out some bugs already. It does however, report quite a few bugs that are not a problem. Luckily, findbugs provides filters to be able to exclude the bugs you don't want to include. After spending a day on creating the filter files manually, I found it to be a bit fiddly and time-consum...MC Tools: Converting service.xml files2009-07-01T11:10:46-04:00searchisko:content:id:jbossorg_blog-mc_tools_converting_service_xml_files2009-07-01T10:36:00-04:00Flavia RainoneHi everyone! Welcome to my new blog!<br /><br />I'm Flavia Rainone, a former Core developer at the JBoss AOP project, and I have joined the JBoss Microcontainer core development team on May.<br /><br />I thought that the best way of kicking off my new blog would be introducing the MC Tools project.<br /><br />The idea behind the MC tools is to create several tools that will help our users to speed up their development with MC. Given that the MC Tools is a work from the community to the community, everyone is invited to contribute with their own tools.<br /><br />The first tool that we developed is a meta data converter. This tool basically converts your old -service.xml files to the new jboss-beans.xml format.<br /><br />Of course, there is lot of space for improvements, but feel free to try it out and let us know what you think of it:<br />http://anonsvn.jboss.org/repos/jbossas/projects/mc-tools/smd2bmd/trunk<br /><br />Just build the project with maven and use the resulting jar with a javac -jar to convert your jboss-service.xml files. There is no need to setup your classpath.<br /><br />Stay tuned, as there is plan for improvements, new modules and documentation!Hi everyone! Welcome to my new blog! I'm Flavia Rainone, a former Core developer at the JBoss AOP project, and I have joined the JBoss Microcontainer core development team on May. I thought that the best way of kicking off my new blog would be introducing the MC Tools project. The idea behind the MC tools is to create several tools that will help our users to speed up their development with MC. Gi...Microcontainer Downloads2009-05-27T09:50:22-04:00searchisko:content:id:jbossorg_blog-microcontainer_downloads2009-05-27T06:22:00-04:00Kabir KhanWhile getting up to speed after joining the <a href="http://www.jboss.org/jbossmc/">JBoss Microcontainer</a> project, I have updated our <a href="http://www.jboss.org/jbossmc/downloads/">downloads</a> section with the latest releases.<br /><br />The old JBoss Microcontainer 1.0.x releases can still be found on <a href="http://sourceforge.net/project/showfiles.php?group_id=22866&amp;package_id=137237">Sourceforge</a>. Since those early releases were uploaded the JBoss Microcontainer has developed a lot, and it is now the umbrella for several sub-projects.<br /><br />The <a href="http://www.jboss.org/jbossmc/downloads/">downloads</a> section has been split into two main categories:<br /><ul><br /> <li>The <a href="http://www.jboss.org/jbossmc/downloads/framework/">Frameworks</a> category contains the downloads most convenient for end users:<br /><ul><br /><li><a href="http://www.jboss.org/jbossmc/downloads/framework/jboss-kernel">Kernel</a>: This is what most people think of when they hear "Microcontainer". It contains the core of the Microcontainer and its dependencies. In brief this is the core state machine with the dependency injection framework, with support for bean metadata supplied via xml or annotations.<br /></li><br /><li><a href="http://www.jboss.org/jbossmc/downloads/framework/jboss-deployers">JBoss Virtual Deployment Framework</a>: This contains all the individual projects from the JBoss Microcontainer project. It consists of the Kernel, advanced classloading capabilities and deployment support, as consumed by JBoss Application Server and <a href="http://www.jboss.org/community/wiki/JBossReloadedDesign">JBoss Reloaded</a>. <br /></li><br /></ul><br /></li><br /><li>The <a href="http://www.jboss.org/jbossmc/downloads/individual">Individual Projects</a> section contains the independent releases of the JBoss Microcontainer sub-projects. Only the binaries and sources are currently contained in the downloads, with no dependencies. The sources are however buildable using maven (version 2.0.9 or later), so you can get all the dependencies and javadoc.<br /></li><br /></ul><br /><br />The current releases on the downloads pages take the already released latest releases of the MC projects. Over the next few releases the plan is to put in a lot of effort in improving our consumables.While getting up to speed after joining the JBoss Microcontainer project, I have updated our downloads section with the latest releases. The old JBoss Microcontainer 1.0.x releases can still be found on Sourceforge. Since those early releases were uploaded the JBoss Microcontainer has developed a lot, and it is now the umbrella for several sub-projects. The downloads section has been split into tw...Test2009-05-20T05:56:24-04:00searchisko:content:id:jbossorg_blog-test12009-05-20T05:54:00-04:00Kabir KhanTest aggregator<div class="blogger-post-footer"><img width='1' height='1' src='//blogger.googleusercontent.com/tracker/37420196-7941668130746723634?l=kabir-khan.blogspot.com'/></div>Test aggregatorTest2009-04-27T09:40:15-04:00searchisko:content:id:jbossorg_blog-test22009-04-27T09:39:00-04:00Kabir KhanJust kicking off the aggregator on my new blog<div class="blogger-post-footer"><img width='1' height='1' src='//blogger.googleusercontent.com/tracker/37420196-6772434076119800951?l=kabir-khan.blogspot.com'/></div>Just kicking off the aggregator on my new blog