Thursday, October 10, 2013

running jruby in jmx console

If you want to play with the MBeans and their properties but prefer ruby

jconsole -J-Djava.class.path=$JDK_HOME/lib/jconsole.jar:$JDK_HOME/lib/tools.jar:/Users/konurur/.rvm/rubies/jruby-1.6.2/lib/jruby.jar -J-Dcom.sun.demo.jconsole.console.language=jruby  -pluginpath $JDK_HOME/demo/scripting/jconsole-plugin/jconsole-plugin.jar 

Wednesday, March 27, 2013

Jruby on rails multiple datasources on jboss with warble


inside warble.rb
  config.webxml.jndi = ["jdbc/DS1", "jdbc/DS2","jdbc/DS3","jdbc/DS4"]

inside jboss-web-xml

 <resource-ref>
        <res-ref-name>jdbc/DS1</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <jndi-name>DS1</jndi-name>
    </resource-ref>

 <resource-ref>
        <res-ref-name>jdbc/DS2</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <jndi-name>DS2</jndi-name>
    </resource-ref>

 <resource-ref>
        <res-ref-name>jdbc/DS3</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <jndi-name>DS3</jndi-name>
    </resource-ref>

 <resource-ref>
        <res-ref-name>jdbc/DS4</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <jndi-name>DS4</jndi-name>
   </resource-ref>

inside web.xml.erb


 <% if webxml.jndi then webxml.jndi.each do |jndi| %>
      <resource-ref>
        <res-ref-name><%= jndi %></res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
    <% end; end %>