Sunday, October 07, 2012

JBoss AS is being renamed

Those of you who missed this year's JavaOne event and still haven't heard about it, here's some news that all JBoss AS followers should be aware of - your favourite application server, JBoss AS, is being renamed.

JBoss AS or just JBoss, as we have all called it since the 3.x days will now be called something else. The reasons for the rename have been explained in this "Why rename JBoss AS, FAQ?". Mark Little has blogged about the this rename in his posts here and here. Read through those pages to understand what's being proposed.

So what's the new name going to be for the JBoss AS project? We don't know yet. In fact, the name will be picked by the community. Everyone is allowed to submit a name of their choice and those names will go through a voting process and one out of those names will be chosen. So if you can think of a name for JBoss AS then go suggest it here before the 14th of this month. Don't leave it for later, this is your chance to be known as the one who chose the new name!

Friday, February 17, 2012

JBoss AS 7.1.0.Final "Thunder" released - Java EE 6 Full Profile certified!


After just about more than a year of development on JBoss AS7, we have now released 7.1.0.Final "Thunder"! The download is available at the usual place here. This is a really big achievement for the JBoss AS7 team and we are really proud about this release.

This release contains numerous bug fixes from 7.1.0.CR1b which was released a few months back. But the biggest news about this release is that JBoss AS 7.1.0.Final is Java EE 6 Full Profile certified! I'm sure a lot of our users will be very happy about this news. AS 7.0.x was Web Profile certified but I have seen in the forums that many of you were waiting for the Full Profile certification to happen. So here's a very good reason to start using JBoss AS7, if you haven't done yet.

Apart from the Full Profile certification, AS 7.1.0.Final contains a lot of bug fixes and other JIRA issues resolved. The entire release notes can be found here.

Like in some of my previous posts on AS7 releases, in this post I'll explain atleast one new feature of this release. Many of you would know that JBoss AS7 is very different compared to the previous JBoss AS versions, on various counts. One prominent difference is that we no longer have numerous XML files in the distribution, configuring various services. Instead we just have *one* single configuration file which governs the entire server. Furthermore, unlike previous JBoss AS versions, JBoss AS7 (prior to 7.1.0.Final) did not allow *deploying* XML files to configure datasources and JMS queues. However, the community members have been repeatedly asking for this feature and JBoss AS 7.1.0.Final now allows deploying of datasources and JMS queues via application specific XML files (in addition to configuring them centrally in the domain/standalone configuration file). So let's take a quick look at how it's done in 7.1.0.Final.

Deploying datasource via -ds.xml files in JBoss AS 7.1.0.Final

The datasource file is expected to end with the -ds.xml suffix, like in previous JBoss AS releases. You can place the *-ds.xml file in the JBOSS_HOME/standalone/deployments folder or even package it in the application under the META-INF folder of the application. If it's a .war application, then the *-ds.xml is expected to be right under the WEB-INF folder of the .war.

The *-ds.xml is expected to follow the jboss-as-datasources xsd which looks like this. So you have a datasources element under which you can define multiple datasource elements. In this example, we'll try and create a MySQL datasource and deploy it as  mysql-ds.xml.

Before creating the datasource, we first have to install the database driver. AS7 allows you install the database driver either as a deployment or as JBoss Module. For more details on this, see this article. In this post, we'll deploy the driver as a JBoss Module.

Create and install the database driver

As a first step, we'll require the MySQL driver jar file. I downloaded the driver jar from the MySQL download site here. The step to create the JBoss Module for this driver involves creating a module.xml which looks like this and is named module.xml:

 <module xmlns="urn:jboss:module:1.1" name="mysql">  
   
   <resources>  
     <resource-root path="mysql-connector-java-5.1.18-bin.jar"/>  
   </resources>  
   <dependencies>  
     <module name="javax.api"/>  
     <module name="javax.transaction.api"/>  
   </dependencies>  
 </module>  
We place the mysql-connector-java-5.1.18-bin.jar and this module.xml file in JBOSS_HOME/modules/mysql/main folder (you'll have to create the mysql/main folder). That completes the JBoss Module creation for the MySQL driver. Now let's install this driver so that it gets registered in the standalone/domain configurations. In this example, we'll be using the standalone server. So let's start the server using:
 ./standalone.sh  
Once the server is up, let's open the Command Line Interface (CLI) utility which is shipped in AS7. The CLI startup script is in the JBOSS_HOME/bin folder and can be started as follows (more details about the CLI can be found here)
 ./jboss-cli.sh --connect  
Once connected successfully, we'll add the jdbc-driver using the following command:
 /subsystem=datasources/jdbc-driver=mysql-5-driver:add(driver-name=mysql-5-driver, driver-class-name=com.mysql.jdbc.Driver, driver-module-name=mysql)  
So here we are naming the driver as "mysql-5-driver" (you can name it anything). The driver-module-name points to the "mysql" JBoss Module that we created in previous step. The driver-class-name is the fully qualified classname of the MySQL driver. In this case, it's com.mysql.jdbc.Driver.

A successful execution of that command will show the output as success:
 [standalone@localhost:9999 /] /subsystem=datasources/jdbc-driver=mysql-5-driver:add(driver-name=mysql-5-driver, driver-class-name=com.mysql.jdbc.Driver, driver-module-name=mysql)  
 {"outcome" => "success"}  
   
The installation will be persisted in the configuration file which was used to start the server. In this case it's the standalone.xml and this is how it looks like after the driver has been installed:
 <subsystem xmlns="urn:jboss:domain:datasources:1.0">  
      ...  
           <drivers>  
                ...  
                <driver name="mysql-5-driver" module="mysql">  
                     <driver-class>com.mysql.jdbc.Driver</driver-class>  
                </driver>  
           </drivers>  
      </datasources>  
 </subsystem>  
We are now done with the driver installation. Now let's move on and create the mysql-ds.xml file.

Create the mysql-ds.xml file

As previously mentioned, the mysql-ds.xml should follow the jboss-as-datasources xsd. Here's how the file looks like in our case:
 <?xml version="1.0" encoding="UTF-8"?>  
 <datasources>  
   <datasource jndi-name="java:jboss/datasources/MySQLDS" enabled="true" use-java-context="true"  
         pool-name="MySQLDS">  
     <connection-url>jdbc:mysql://localhost:3306/test</connection-url>  
     <driver>mysql-5-driver</driver>  
     <security>  
       <user-name>foo</user-name>  
       <password>bar</password>  
     </security>  
   </datasource>  
 </datasources>  
Let's see what that xml file contains. The "jndi-name" is the name to which the datasource will be bound to (you can use a name of your choice. Ideally, it would be good to bind them in java:jboss/datasources/ namespace). The "enabled=true" indicates that the datasource should be enabled after being deployed. The "use-java-context" attribute is used to indicate that the JNDI name should be bound under the java: namespace. The "connection-url" is the URL to be used for connecting to the MySQL database (check MySQL documentation for more details about the connection-url). The "driver" element points to the installed JDBC driver that we created in the previous step. In our example, we named it mysql-5-driver and that's what we use here. Finally, the "security" section contains the username and password information for connecting to the database. Make sure you use the appropriate values for all these configurations.

So now let's place this mysql-ds.xml in the JBOSS_HOME/standalone/deployments folder and see JBoss AS7 hot deploy it (if the server is already running). The logs will show the following on successful deployment:
 14:05:55,829 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "mysql-ds.xml"  
 14:05:55,847 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [jboss/datasources/MySQLDS]  
   
So that's it! We have successfully deployed the MySQL datasource through a -ds.xml file in 7.1.0.Final!

So download this new version and start deploying your applications and start using these features. We'll be blogging more about the features in this release, in the upcoming days (after the AS7 developers get some much needed sleep :) ). So keep an eye on the jboss.org blogs. If you run into any issues with AS7, feel free to visit our user forum and ask for help.

Monday, February 06, 2012

JUDCon 2012, Bangalore - Photos and presentations uploaded

The photos and the presentations of JUDCon 2012 which was held in Bangalore have been uploaded. You can get the photos from here and the presentations from here. The videos will be uploaded soon.


Thursday, January 26, 2012

Very impressed by JUDCon 2012 in Bangalore

I just returned from the first ever JUDCon event in India which was organized in Bangalore. For those of you who couldn't make it (you really missed a very impressive event) here's an review of the event.

The venue:


It was organized in the Nimhans convention centre in Bangalore on Jan 24th and 25th. The venue had very good WiFi facility (although it did make it's absence felt for a few seconds during Rado's live demo on mod_cluster :) ). I haven't been to previous JUDCon events, so I wasn't aware how good the connectivity usually is at these events. Apparently the connectivity here was among the best as compared to the previous events, as per Galder's review. So a big thank you to the organizers of the event, Saltmarch Media.

Attendance:


To be honest, when I arrived for the event I was expecting an audience of around 100-150 people. I did know that there's a huge number of jboss.org community users from India (like Bruno later showed in his presentation) but I hadn't expected that many would show up at the event especially since it was weekday (for some of the JBUG events that I have organized earlier, I have always been requested that the event be scheduled on a weekend) and also because the event was close to a national holiday on 26th. But to my pleasant surprise the attendance was far more in number, a number that I had never expected. We were told that there were 700+ registrations for the event (remember, this is a paid event so most of them would definitely show up) and we could really see the large numbers during the presentations. Apparently this is the biggest JUDCon in terms of attendance itself. The audience was not just impressive because of the numbers but also because of the knowledge they had about various JBoss projects some of which are very new. We could see that the audience was very well informed based on the questions (a lot of them) they asked after the sessions. So full marks for all those who attended the event and made it a great success.

Sessions:


Before the event started this week, due to some unavoidable last minute changes, a couple of sessions had to be changed. Luckily for me and those from the audience who would have liked to hear about EJB configurations in AS7, the session organizers decided to allow a session titled "Configure and deploy your EJB applications on AS7" on the second day of the event. Since this was a last minute change and because I had already made some arrangements to leave the event sometime in the afternoon on the second day, Satish Kale and Ravi Maurya (who are both from the Red Hat team) volunteered to present the session and I decided to provide them with the necessary help for creating the slides/content. I arrived in Bangalore one day earlier before the event and spent most of the time creating the presentation for the session.

The sessions were divided into 3 tracks: (1) JBoss AS7 (2) OpenShift/Cloud and (3) Rules,Workflow, SOA and EAI. The AS7 sessions were held in the Main Hall which had a very large seating capacity and the other tracks were held in two different halls which were a bit smaller compared to the main hall but still had enough room to accommodate around 100 (or more?) people in the audience. The smaller halls were always packed for whichever session I decided to take a look at. Infact, many of them were even standing due to the full house. You will get to see a proof once the videos and pictures of the event are uploaded at jboss.org :)

I had decided that I would be attending most of the AS7 sessions and the OpenShift ones. The event started on day one at 9 in the morning when Bruno delivered the keynote address to a packed house. Then I attended a couple of more sessions - one by Ales, on Android and the Cloud and the other by Greg Kable (who I finally got to meet!) on the Best Practices for using JPA2 with Hibernate. Like I said, the sessions were well attended and the audience had some very good questions in the end for the speakers. I even got to take home a couple of important best practice suggestions from Greg's presentation. I had always wondered whether field based annotations or property based annotations on entities was a preferred approach. If you too have been wondering about that, then wait for the Greg's video/presentation to be uploaded on jboss.org (I'll actually create a new blog entry once those are uploaded. So you can even watch this blog too).

By the way, speaking of Hibernate, if Steve's reading this blog (Hi Steve! :)) there was one specific question about Hibernate which got asked atleast 3 times during various sessions and once when I was having lunch. Many of you would know that Hibernate recently switched to Gradle as their build system. They were earlier using Maven like many other JBoss projects. Apparently some users are having problems using Gradle to build Hibernate. They mentioned that they had an internal set of testsuites which they run after building Hibernate themselves, before deciding whether or not to use the newer versions of Hibernate. Apparently there's some issue with using Gradle since they say it requires some native .so library which they don't have and that results in failure on their build systems. So the question they had was whether the Hibernate team would have some kind of Maven compatibility for the builds. I don't have any knowledge of Gradle, so all I could suggest was to open a forum thread asking this question and explaining their usecase. So that's a heads up to Steve :)

After those couple of morning sessions, we had a nice lunch at the venue. The food was good. Later during the noon, I attended the session on JBoss AS7 "What's new" by Bruno. Being part of the AS7 team, I already had an idea of what the session was going to cover but I decided to be in the audience to see their reaction to the new changes to AS7 and the feedback they had around it. It was nice to see that there were many users in the audience who had started using AS7 and were aware of many of the new developments around it. The feedback was mostly encouraging although some users did mention that they had some trouble trying to migrate application which had previous JBoss AS specific extensions and descriptors. But overall, they were really happy with AS7 because of the vast amount of improvements it has compared to previous versions.

The session after that, I attended Shane's presentation on Getting Started developing apps with AS7. This was a very technical one with a live demo of how to use the command line interface (introduced in AS7) for deploying/undeploying the applications. The session included quickstarts that are made available publicly here. The session was attended by a packed audience and was well accepted. Those of you who haven't had a chance to look at the quickstarts, then I would very highly recommend taking a look at https://github.com/jbossas/quickstart. It covers a vast range of technologies and has quickstart applications with comprehensive documentation for each of those applications. Thanks to Sande Gilda and Pete Muir  for managing the quickstarts and thanks for everyone else that has been contributing. This is a big improvement compared to some of our previous JBoss AS releases which did not have readily usable quickstart examples.

After these sessions, I decided to meet some of the community users and also catch up with some of my JBoss colleagues. It was good to talk to many of the community users some of whom had apparently known me by my name on the community forums.

Later in the evening of day one we had one last event at around 5:30. Although it was the last one of the day, it really turned out to be the best one (in my opinion) and well participated one. The event was "Expert Q&A with the Red Hat team". Ray Ploski (I finally got to meet Ray too!) started off the session by asking some questions to the audience and the on-stage Red Hat team then went on to discuss a wide range of topics covering a lot of JBoss projects. Each of the on-stage Red Hat team members shared their experience on a wide range of topics right from the relevance of Java, post Oracle acquisition of Sun to the very new Ceylon language. There was also discussion around Drools, jBPM, AS7, EAP and other JBoss projects. You could clearly see that the audience was very knowledgeable. This session not just had some serious discussions on a variety of topics but also had its fun moments, thanks to Mike Brock ;) (you'll see it in the video once it's posted, towards the end of the session when one member from the audience asks a question which had something to do with multi-core processors). That session ended a very lively and exciting first day of the event. We then had dinner at the event, where the delegates were invited to join the JBoss team and have a chat with them. I got to meet some delegates who had very interesting experiences to share about JBoss projects. Some of them were curious why there wasn't any session on Arquillian.

That marked the end a very nice day one at the event.

The next day the sessions started at 10 in the morning. The first one, in the AS7 track was by Dimitris, who by the way, told me that he had an exciting first hand experience of the Bangalore traffic - actually, lot of my other team mates had a similar opinion,  which was natural :). Ales, I think even has a video. If not, Rado has one for sure :). So back to the sessions - the first one for day two that I attended was by Dimitris titled "JBoss Application Server 7 - Reloaded". I loved this session and I'm sure many who attended it loved it too! Dimitris started off with the history of JBoss AS 2.x, 3.x days and went on explaining the various changes/improvements that had happened all the way till AS7. It was nice to listen to some of the stories behind the previous versions, some of which I wasn't aware of. Later in the session he explained about AS7 and the projects and kernel that make up AS7 and why AS7 performs so fast. He ended that session with a "Thank you" slide which was well appreciated by the audience because he had that slide in Kannada (the language spoken in Bangalore), Hindi, Greek (Dimitris is from Greece) and English!

The next session I attended was by Rado, on mod_cluster. Rado presented on mod_cluster, which although I had some idea about, was new to me. I found the session very informative technical and got to learn some nice facts about the project. Rado even had a live demo of the project against AS7. The session went off well and there were a lot of questions from the audience.

It was then time for lunch on day two. Since I planned to leave the event an hour after lunch, I had just one more session that I had planned to attend. Ales presented a session titled CapeDwarf - Running your Google App Engine applications on JBoss AS7. Being part of the JBoss team, I had heard about the CapeDwarf project a few times from Ales but did not have much idea about what it was all about. So this was my chance to get to understand it better. I attended the session and Ales explained what the project was all about and where it stands currently. He even had a demo where he showed that you could directly deploy your Google App Engine application (an application which uses Google App Engine APIs) against a JBoss AS7 instance enabled with CapeDwarf subsystem and without having to do any changes to your application. It was an impressive demo and presentation and I got to learn what the project was all about.

So that was the last session I could attend that day since I had to leave early. There still were some other sessions that I wished I could attend and even present the "Configuring EJB applications for AS7" but that wasn't to be. Later I got to know that the session on EJB went well, although I still have to catch up with Satish and Ravi to get to know more. A big thanks to Satish and Ravi for presenting this session since it was a last minute decision for them too after the previously decided sessions were cancelled.

I caught up, one last time for this event, with my JBoss colleagues before leaving the event. Turns out I missed getting a JUDCon t-shirt because I left early and forgot to submit the feedback form for the sessions :(

Overall, these 2 days at the event were real exciting and the event was really impressive. I got to meet my JBoss team mates, some of whom I had never met before and also got a chance to meet a lot of community members. I wish we had a few more days of this! A big thank you to all those who attended and made this a success and for those who couldn't attend, keep a watch on this blog - I'll post a link to the event photos/videos once they are uploaded. Also keep an eye on the jboss.org blog feeds where I'm sure you'll see many more reviews of this event.