<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-30587633</id><updated>2012-01-28T11:45:57.171+05:30</updated><category term='timerservice'/><category term='JBoss'/><category term='judcon'/><category term='mysql'/><category term='jboss ejb31 javaee'/><category term='judcon2012'/><category term='jbossas7'/><category term='Javascript'/><category term='ejb3.1'/><category term='jndi'/><category term='as7_openshift'/><category term='Hibernate'/><category term='Misc'/><category term='refcard'/><category term='event'/><category term='openshift'/><category term='Log4j'/><category term='Java'/><category term='slf4j'/><category term='JAAS'/><category term='EJB'/><category term='dzone'/><category term='Webservice'/><category term='ejb31'/><category term='openshift_express'/><category term='javaee'/><category term='eclipse plugin'/><category term='as7'/><category term='logback'/><category term='jboss_application_server7'/><category term='javaee6'/><category term='jbossas'/><category term='J2EE'/><title type='text'>My Wiki</title><subtitle type='html'>Compilation of most of the technical stuff that i encounter as part of my job.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>50</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-30587633.post-644129001207916893</id><published>2012-01-26T21:15:00.000+05:30</published><updated>2012-01-28T11:45:57.183+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas7'/><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='as7'/><category scheme='http://www.blogger.com/atom/ns#' term='event'/><category scheme='http://www.blogger.com/atom/ns#' term='judcon2012'/><category scheme='http://www.blogger.com/atom/ns#' term='judcon'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Very impressed by JUDCon 2012 in Bangalore</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I just returned from the first ever &lt;a href="http://www.jboss.org/events/JUDCon/2012/india/" target="_blank"&gt;JUDCon event in India&lt;/a&gt; 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.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;The venue:&lt;/h3&gt;&lt;br /&gt;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 &lt;a href="http://infinispan.blogspot.com/2012/01/judcon-india-post-mortem.html" target="_blank"&gt;Galder's review&lt;/a&gt;. So a big thank you to the organizers of the event, &lt;a href="http://www.saltmarch.com/" target="_blank"&gt;Saltmarch Media&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Attendance:&lt;/h3&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Sessions:&lt;/h3&gt;&lt;br /&gt;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, &lt;a href="http://www.linkedin.com/pub/satish-kale/4/59b/8b6" target="_blank"&gt;Satish Kale&lt;/a&gt; and &lt;a href="http://www.linkedin.com/in/ravindramaurya" target="_blank"&gt;Ravi Maurya&lt;/a&gt; (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.&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://www.jboss.org/" target="_blank"&gt;jboss.org&lt;/a&gt; :)&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://www.jboss.org/" target="_blank"&gt;jboss.org&lt;/a&gt; (I'll actually create a new blog entry once those are uploaded. So you can even watch this blog too).&lt;br /&gt;&lt;br /&gt;By the way, speaking of &lt;a href="http://hibernate.org/" target="_blank"&gt;Hibernate&lt;/a&gt;, if &lt;a href="http://in.relation.to/Bloggers/Steve" target="_blank"&gt;Steve's&lt;/a&gt; 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 &lt;a href="http://in.relation.to/Bloggers/HibernateGradlePointers" target="_blank"&gt;switched to Gradle&lt;/a&gt; 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 :)&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;The session after that, I attended &lt;a href="http://relation.to/Bloggers/Shane" target="_blank"&gt;Shane's&lt;/a&gt; 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 &lt;a href="https://github.com/jbossas/quickstart" target="_blank"&gt;here&lt;/a&gt;. 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 &lt;a href="https://github.com/jbossas/quickstart"&gt;https://github.com/jbossas/quickstart&lt;/a&gt;. It covers a vast range of technologies and has quickstart applications with comprehensive documentation for each of those applications. Thanks to &lt;a href="https://github.com/sgilda" target="_blank"&gt;Sande Gilda&lt;/a&gt; and &lt;a href="https://github.com/pmuir" target="_blank"&gt;Pete Muir&lt;/a&gt;&amp;nbsp; for managing the quickstarts and thanks for everyone else that has been &lt;a href="https://docs.jboss.org/author/display/AS71/Quickstarts" target="_blank"&gt;contributing&lt;/a&gt;. This is a big improvement compared to some of our previous JBoss AS releases which did not have readily usable quickstart examples.&lt;br /&gt;&lt;br /&gt;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. &lt;br /&gt;&lt;br /&gt;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&amp;amp;A with the Red Hat team". &lt;a href="http://www.blogger.com/profile/07496088168312707495" target="_blank"&gt;Ray Ploski&lt;/a&gt; (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 &lt;a href="http://ceylon-lang.org/" target="_blank"&gt;Ceylon language&lt;/a&gt;. 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 &lt;a href="http://twitter.com/JBossMike" target="_blank"&gt;Mike Brock&lt;/a&gt; ;) (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 &lt;a href="http://www.jboss.org/arquillian/" target="_blank"&gt;Arquillian&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;That marked the end a very nice day one at the event.&lt;br /&gt;&lt;br /&gt;The next day the sessions started at 10 in the morning. The first one, in the AS7 track was by &lt;a href="http://dandreadis.blogspot.com/" target="_blank"&gt;Dimitris&lt;/a&gt;, 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,&amp;nbsp; which was natural :). &lt;a href="https://github.com/alesj" target="_blank"&gt;Ales&lt;/a&gt;, I think even has a video. If not, &lt;a href="http://twitter.com/radoslavhusar" target="_blank"&gt;Rado&lt;/a&gt; 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 (&lt;a href="http://en.wikipedia.org/wiki/Kannada" target="_blank"&gt;the language spoken in Bangalore&lt;/a&gt;), &lt;a href="http://en.wikipedia.org/wiki/Standard_Hindi" target="_blank"&gt;Hindi&lt;/a&gt;, Greek (Dimitris is from Greece) and English!&lt;br /&gt;&lt;br /&gt;The next session I attended was by Rado, on &lt;a href="http://www.jboss.org/mod_cluster" target="_blank"&gt;mod_cluster&lt;/a&gt;. 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.&lt;br /&gt;&lt;br /&gt;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 &lt;a href="https://github.com/capedwarf/" target="_blank"&gt;CapeDwarf project&lt;/a&gt; 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.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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 :(&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://planet.jboss.org/view/all" target="_blank"&gt;jboss.org blog feeds&lt;/a&gt; where I'm sure you'll see many more reviews of this event.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-644129001207916893?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/644129001207916893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=644129001207916893' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/644129001207916893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/644129001207916893'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2012/01/very-impressed-by-judcon-2012-in.html' title='Very impressed by JUDCon 2012 in Bangalore'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7140709164700714496</id><published>2011-12-23T15:20:00.000+05:30</published><updated>2011-12-23T15:20:26.419+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas7'/><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='as7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss_application_server7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 7.1.0.CR1 "Flux Capacitor" released</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;It's been just one month since we released JBoss AS 7.1.0.Beta1. Within that one month we have been able to fix numerous issues in JBoss AS7, add more features and resolve various other JIRAs. As a result, we now have 7.1.0.CR1 "Flux Capacitor" available for &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="_blank"&gt;downloads&lt;/a&gt;.This new release contains around &lt;a href="https://issues.jboss.org/secure/ReleaseNote.jspa?projectId=12311211&amp;amp;version=12316687" target="_blank"&gt;378 resolved JIRAs&lt;/a&gt;. The highlights of this release include:&lt;br /&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;EE6 Full Profile support is now &lt;i&gt;feature complete&lt;/i&gt;. What this means is - all the features required for EE6 full profile support are now available in AS7. &lt;/li&gt;&lt;li&gt;Various improvements in AS7 management&lt;/li&gt;&lt;li&gt;Clustering improvement:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Stateful session bean replication support&lt;/li&gt;&lt;li&gt;Clustered SSO&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;So, go get a copy of this release from the &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="_blank"&gt;downloads&lt;/a&gt; page and start using it. Start deploying your applications, for which you have been waiting for full EE6 profile support in AS7 and let us know how it goes. As usual, feel provide us feedback or suggestions or ask for help if you run into any issues, in our &lt;a href="http://community.jboss.org/en/jbossas7?view=discussions" target="_blank"&gt;user forum&lt;/a&gt;. It's just a few more days before we reach 7.1.0.Final, so help us deliver a high quality 7.1.0.Final by trying out 7.1.0.CR1 and reporting any issues.&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div style="text-align: center;"&gt;[&lt;a href="http://www.jboss.org/as7"&gt;AS7 Home&lt;/a&gt;] [&lt;a href="https://issues.jboss.org/browse/AS7"&gt;AS7 JIRA&lt;/a&gt;] [&lt;a href="http://community.jboss.org/en/jbossas7?view=discussions"&gt;AS7 User Forum&lt;/a&gt;] [&lt;a href="https://docs.jboss.org/author/display/AS71/Documentation"&gt;AS7 documentation&lt;/a&gt;] [&lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;AS7 downloads&lt;/a&gt;] [&lt;a href="http://community.jboss.org/thread/167590"&gt;AS7 nightly builds&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7140709164700714496?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7140709164700714496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7140709164700714496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7140709164700714496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7140709164700714496'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/12/jboss-as-710cr1-flux-capacitor-released.html' title='JBoss AS 7.1.0.CR1 &quot;Flux Capacitor&quot; released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-4117777511966438656</id><published>2011-11-24T23:08:00.001+05:30</published><updated>2011-11-24T23:26:38.001+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas7'/><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='as7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss_application_server7'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 7.1.0.Beta1 "Tesla" released</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Two months after we released 7.0.2 "Arc", we now have JBoss AS 7.1.0.Beta1 "Tesla" available for use. It's available for download at the usual location &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="_blank"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Apart from the regular bug fixes, 7.1.0 Beta1 has a whole lot of new features. This includes increased support for Java EE technologies. Here's the main set of features that have been included in this release:&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&amp;nbsp;A significant portion of EE full profile capabilities&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Remote EJB over Remoting&lt;/li&gt;&lt;li&gt;Remote EJB over IIOP&lt;/li&gt;&lt;li&gt;CMP &amp;amp; BMP&lt;/li&gt;&lt;li&gt;EJB 2.x support&lt;/li&gt;&lt;li&gt;App Client&lt;/li&gt;&lt;li&gt;JSR-88&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&amp;nbsp;A number of management improvements&lt;/li&gt;&lt;li&gt;&amp;nbsp;Management is now secure by default&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Although with local user transparent auth for CLI and Java API tools&lt;/li&gt;&lt;li&gt;Console will "guide" you through creating a user&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&amp;nbsp;Numerous component updates&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: left;"&gt;&amp;nbsp;The entire list of bug fixes and improvements is available &lt;a href="https://issues.jboss.org/secure/ReleaseNote.jspa?projectId=12311211&amp;amp;version=12316686" target="_blank"&gt;here &lt;/a&gt;&lt;br /&gt;&lt;h4&gt;Let's briefly see some of the main features:&lt;/h4&gt;&lt;h5&gt;Standalone server configurations&lt;/h5&gt;7.1.0.Beta1 ships with a standalone.xml and a standalone-full.xml configurations. The standalone.xml supports web-profile technologies plus some additional technologies like javamail and full EJB3 support including remote EJB invocations. It however doesn't contain the messaging (i.e. HornetQ), Jacorb and CMP subsystem. The standalone-full.xml configuration, on the other hand contains support for all the technologies that have been implemented in AS7 so far.&lt;br /&gt;&lt;br /&gt;By default, the standalone server starts up using the standalone.xml. If you want to use the other configuration then just use the following command:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; ./standalone.sh -server-config=standalone-full.xml  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;or if you are on Windows OS&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; ./standalone.bat -server-config=standalone-full.xml  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h5&gt;EJB 2.x support&lt;/h5&gt;Ever since AS 7.0.0 (which had web profile support) was released community users have been asking for EJB2.x support and support for invocations on EJB from remote clients. The plan was to have that support available in our early 7.1 Alpha/Beta releases. That has worked out as per the plan and users can now start deploying their EJB2.x applications on AS7.&lt;h5&gt;Remote client invocations on EJB&lt;/h5&gt;For those of you who are interested in knowing about or trying out EJB invocations from a remote client, we have updated our AS7 documentation to have a chapter on &lt;a href="https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI" target="_blank"&gt;EJB invocations from a remote client using JNDI&lt;/a&gt;. We already have some users who have started trying out and providing feedback in the &lt;a href="http://community.jboss.org/en/jbossas7?view=discussions" target="_blank"&gt;user forum&lt;/a&gt;.&lt;h5&gt;7.1.0 Beta1 is secured by default&lt;/h5&gt;Starting this version, the server is configured to be secured by default. What this means is that users wont have access to management operations (either via CLI or admin console) without authentication first. &lt;a href="http://community.jboss.org/wiki/AS710Beta1-SecurityEnabledByDefault" target="_blank"&gt;This wiki article&lt;/a&gt; is a must read to understand the finer (and well explained) details about this.&lt;br /&gt;&lt;br/&gt;As you can see we have made some very good progress in the last couple of months since 7.0.2 was released. We hope to continue with the same speed for the upcoming 7.1.0.CR1. &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="_blank"&gt;Try out&lt;/a&gt; this new version and let us know how it goes. Feedback is always welcome in our &lt;a href="http://community.jboss.org/en/jbossas7?view=discussions" target="_blank"&gt;forums&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;[&lt;a href="http://www.jboss.org/as7"&gt;AS7 Home&lt;/a&gt;] [&lt;a href="https://issues.jboss.org/browse/AS7"&gt;AS7 JIRA&lt;/a&gt;] [&lt;a href="http://community.jboss.org/en/jbossas7?view=discussions"&gt;AS7 User Forum&lt;/a&gt;] [&lt;a href="https://docs.jboss.org/author/display/AS71/Documentation"&gt;AS7 documentation&lt;/a&gt;] [&lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;AS7 downloads&lt;/a&gt;] [&lt;a href="http://community.jboss.org/thread/167590"&gt;AS7 nightly builds&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-4117777511966438656?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/4117777511966438656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=4117777511966438656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4117777511966438656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4117777511966438656'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/11/jboss-as-710beta1-tesla-released.html' title='JBoss AS 7.1.0.Beta1 &quot;Tesla&quot; released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7812140792957437050</id><published>2011-09-23T19:34:00.001+05:30</published><updated>2011-09-24T19:57:40.103+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas7'/><category scheme='http://www.blogger.com/atom/ns#' term='as7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss_application_server7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 7.0.2 "Arc" released!</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-i77lnVv_SVQ/TnyJndZjPjI/AAAAAAAAACA/tSnGkD9lEsk/s1600/AS7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-i77lnVv_SVQ/TnyJndZjPjI/AAAAAAAAACA/tSnGkD9lEsk/s1600/AS7.png" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;More good news on the JBoss AS7 front. JBoss AS 7.0.2.Final "Arc" has been &lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;released&lt;/a&gt; today! It's been one month since AS 7.0.1 was released. Within this short period of time there have been numerous bugs fixed and more features and improvements implemented. All these &lt;a href="https://issues.jboss.org/secure/ReleaseNote.jspa?projectId=12311211&amp;amp;version=12317953"&gt;bug fixes and features&lt;/a&gt; have been included in this 7.0.2 release. This new release mainly consists of the following features/improvements: &lt;/div&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;JSF 2.1Async&amp;nbsp;&lt;/li&gt;&lt;li&gt;EJB support&amp;nbsp;&lt;/li&gt;&lt;li&gt;Resurrected -b option for command line binding&amp;nbsp;&lt;/li&gt;&lt;li&gt;SSO support&amp;nbsp;&lt;/li&gt;&lt;li&gt;JNDI memory footprint improvement&amp;nbsp;&lt;/li&gt;&lt;li&gt;Limited support for Hibernate 3.3&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;Let's quickly look at one of these improvements. Those of you who have been using previous versions of JBoss AS would know that starting JBoss AS 4.2.x, JBoss by default binds its services to localhost for security reasons. These previous versions of JBoss AS allowed a command line option "-b" to allow binding the services to a different IP. AS 7.0.0 and 7.0.1 did not have this feature. Users could still bind to an IP of their choice but that required editing a xml file. Starting 7.0.2 release, we have now enabled this -b option (and also introduced a "-bmanagement" option) to allow you to bind your server to a IP/host of your choice. So let's quickly see how it's done.&lt;br /&gt;&lt;br /&gt;Download the server binary from &lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;here&lt;/a&gt; and extract it to a folder of your choice. Start the standalone server using the standalone.sh (standalone.bat for Windows OS) script available in JBOSS_HOME/bin folder:&lt;br /&gt;&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:bin$ ./standalone.sh  &lt;br /&gt; ...  &lt;br /&gt; 18:45:36,893 INFO [org.jboss.as.remoting] (MSC service thread 1-3) Listening on /127.0.0.1:9999  &lt;br /&gt; 18:45:37,030 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;In the logs you'll notice that the server is being bound to 127.0.0.1 IP (by default). What this means is that all your services including the web access won't be accessible remotely from a different machine via the IP address or hostname of your machine.&lt;br /&gt;&lt;br /&gt;As a quick check, access the following pages:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://localhost:8080/"&gt;http://localhost:8080&lt;/a&gt;&lt;br /&gt;&lt;a href="http://localhost:9990/"&gt;http://localhost:9990&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first one is the default home page of your server and the second URL is the admin console. Now try accessing them using your machine's IP or hostname instead of localhost and you'll notice that they aren't accessible. Now let's see how we can enable access via your machine's IP or hostname.&lt;br /&gt;&lt;br /&gt;Stop your running server and start it with the following command:&lt;br /&gt;&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:bin$ ./standalone.sh -b 10.67.2.193  &lt;br /&gt; ...  &lt;br /&gt; 18:47:24,588 INFO [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:9999  &lt;br /&gt; 18:47:24,818 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--10.67.2.193-8080  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now you'll notice that the http interface (for your web applications) is now bound to 10.67.2.193 (the IP you passed). However, the management interface (on which the admin console is exposed) still binds to localhost. So now, you'll be able to access the AS home page (and your applications) at &lt;a href="http://10.67.2.193:8080/"&gt;http://10.67.2.193:8080&lt;/a&gt; and the admin console at &lt;a href="http://localhost:9990/"&gt;http://localhost:9990&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you want to change the binding address for your management interface too, then you'll have to additionally use the -bmanagement option as follows:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:bin$ ./standalone.sh -b 10.67.2.193 -bmanagement 10.67.2.193  &lt;br /&gt; ...  &lt;br /&gt; 18:48:56,295 INFO [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /10.67.2.193:9999  &lt;br /&gt; 18:48:56,654 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--10.67.2.193-8080  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;As you can see the http interface and the management interface are now both bound to the IP address that you passed as a option to the startup script. So you'll now be able to access the home page at&amp;nbsp; &lt;a href="http://10.67.2.193:8080/"&gt;http://10.67.2.193:8080&lt;/a&gt; and the admin console at &lt;a href="http://10.67.2.193:8080/"&gt;http://10.67.2.193:9990&lt;/a&gt;. That's it!&amp;nbsp; &lt;br /&gt;&lt;br /&gt;So go get a fresh copy of &lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;7.0.2&lt;/a&gt; and start using it. If you run into any issues are have any suggestions, feel free to report them in our &lt;a href="http://community.jboss.org/en/jbossas/as7_users?view=discussions"&gt;user forum&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;[&lt;a href="http://www.jboss.org/as7"&gt;AS7 Home&lt;/a&gt;] [&lt;a href="https://issues.jboss.org/browse/AS7"&gt;AS7 JIRA&lt;/a&gt;] [&lt;a href="http://community.jboss.org/community/jbossas/as7_users?view=discussions"&gt;AS7 User Forum&lt;/a&gt;] [&lt;a href="https://docs.jboss.org/author/display/AS7/Documentation"&gt;AS7 documentation&lt;/a&gt;] [&lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;AS7 downloads&lt;/a&gt;] [&lt;a href="http://community.jboss.org/thread/167590"&gt;AS7 nightly builds&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: left;"&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7812140792957437050?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7812140792957437050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7812140792957437050' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7812140792957437050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7812140792957437050'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/09/jboss-as-702-arc-released.html' title='JBoss AS 7.0.2 &quot;Arc&quot; released!'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-i77lnVv_SVQ/TnyJndZjPjI/AAAAAAAAACA/tSnGkD9lEsk/s72-c/AS7.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7082113776060279466</id><published>2011-08-20T21:27:00.004+05:30</published><updated>2011-08-22T14:37:23.263+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas7'/><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='as7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss_application_server7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='openshift_express'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='as7_openshift'/><category scheme='http://www.blogger.com/atom/ns#' term='openshift'/><title type='text'>Deploy a Java EE application on OpenShift Express (with AS7 support)</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;During the past few years, I've been hearing about "cloud" services more and more. Initially I wasn't really curious to try them out. But a few months (a year?) back, I decided to see what it was all about. I have been involved with Java EE development for more than 7 years now, so I decided to see what it takes to deploy my Java EE application to the cloud. I set out looking for documentation and other usual blog articles and such. At that point, whichever cloud services I thought of trying out, would require me to provide my credit card details even to try out a trial application. I wasn't too keen to provide my credit card details just to try out a few applications of mine. So I kind of gave up on trying out my applications on cloud, although I kept reading about what other developers were doing to deploy their applications on cloud. &lt;br /&gt;&lt;br /&gt;At about the same time, I came across this elaborate writeup on how one of the developers had setup his application involving Weld and JSF, on Google App Engine - &lt;a href="http://in.relation.to/Bloggers/WeldJSF20AndGoogleAppEngineNavigatingTheMinefieldPart1"&gt;Part1&lt;/a&gt;, &lt;a href="http://in.relation.to/Bloggers/WeldJSF20AndGoogleAppEngineNavigatingTheMinefieldPart2"&gt;Part2&lt;/a&gt;. The blog was well written and explained what was required to get your Java EE application up and running on a cloud service. But the important piece of information in those articles was that, users who had an application which was implemented as per Java EE standards (to be portable) had to change many of the application parts just to get them running on cloud. This was because many of the Java EE technologies weren't supported by the cloud service provider. This didn't look appealing to me. After all, what would I gain by doing that. So at that point, I as a Java EE developer, wasn't too interested in experimenting with deploying my application on cloud.  &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Enter OpenShift!&lt;/h4&gt;But this month, the &lt;a href="http://www.jboss.org/openshift.html"&gt;OpenShift announcement&lt;/a&gt; about being able to deploy your &lt;a href="http://www.jboss.org/as7"&gt;JBoss AS7&lt;/a&gt; Java EE applications to cloud, caught my eye. By the way, I do work for RedHat and am part of the JBoss AS7 team, but I wasn't keeping a watch on what the OpenShift team was upto, so this announcement came as a pleasant surprise! So I decided to give it a try. After reading some of the documentation on the project site, I found out that OpenShift offers two different services. One was "&lt;a href="https://openshift.redhat.com/app/express"&gt;OpenShift Express&lt;/a&gt;" and the other "&lt;a href="https://openshift.redhat.com/app/flex"&gt;OpenShift Flex&lt;/a&gt;". OpenShift Express is free to use (that was one more good news for me) while OpenShift Flex requires your Amazon EC2 credentials and you'll be charged for the EC2 usage (there's however a free trial going on currently). I decided to give OpenShift Express a try since it was free and suits my current needs of just trying out a quick and simple Java EE application deployment and access to that application.&lt;br /&gt;&lt;br /&gt;So here's what I did to be able to deploy my Java EE application which uses the technologies available in Java EE6 webprofile and which deploys fine on my local AS7 instance, to OpenShift Express. You might have already guessed that I'm no expert about OpenShift (or cloud services in general), so in this article doesn't have any advanced technical details, but contains more of a how-to on deploying Java EE applications to OpenShift Express. &lt;br /&gt;&lt;br /&gt;So let's start then.&lt;br /&gt;&lt;h4&gt;Sign up&lt;/h4&gt;The first step is to sign up &lt;a href="https://openshift.redhat.com/app/user/new"&gt;here&lt;/a&gt; to create an account for yourself. The sign up just requires a valid email address to which your account details will be dispatched. On signing up, you'll receive a mail which contains a link to activate your account and will take you to the login screen. Login using the email id and password that you used to register.&lt;br /&gt;&lt;h4&gt;Get Access to OpenShift Express&lt;/h4&gt;So let's got the &lt;a href="https://openshift.redhat.com/app/express"&gt;OpenShift Express page&lt;/a&gt;. On that page you will notice a "Get Access to Express" button on left hand side. Click on it to get access to "Express". You'll be notified (immediately) through a mail to the email id which you registered. Check the mail which will contain a link to a &lt;a href="https://openshift.redhat.com/app/express#quickstart"&gt;quick start guide&lt;/a&gt;, to help you get started with OpenShift Express. &lt;br /&gt;&lt;h4&gt;Install client tools&lt;/h4&gt;The &lt;a href="https://openshift.redhat.com/app/express#quickstart"&gt;quick start&lt;/a&gt; contains the instructions to get you started with the installation procedure. The first step includes installing a few client tools on your system to help you interact with OpenShift. Follow those instructions to install the client tools (I won't repeat them here, since it's well explained in that guide).&lt;br /&gt;&lt;h4&gt;Create a domain&lt;/h4&gt;Now once we have the client tools, we are now ready to setup our "domain" on the OpenShift cloud. Setting up a domain will create a unique domain name that you can use for your applications. The domain name will be part of the URL which you will use to access the application and which you'll publish to your users for access. The command to create the domain is easy:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; rhc-create-domain -l &amp;lt;email-id-you-registered-with&amp;gt; -n &amp;lt;domain-name-of-your-choice&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Running that command will ask you for the password that you used to register. Enter that password and let the command complete (a few seconds).&lt;br /&gt;&lt;br /&gt;The "rhc-create-domain" is part of the client tool that you installed earlier. If you haven't yet installed those tools, then you won't be able to use these commands, so don't miss that step! The "rhc-create-domain" accepts a few more optional parameters. To see the list of accepted parameters, you can run the following command: &lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; rhc-create-domain --help  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4&gt;Create a jbossas-7.0 application&lt;/h4&gt;Once you have successfully create a domain, your next step is to create an "application". Currently OpenShift Express supports different "types" of applications, each of them backed by &lt;a href="http://en.wikipedia.org/wiki/Git_%28software%29"&gt;Git&lt;/a&gt; (which is a version control system). At the point of writing this post, the supported application types are jbossas-7.0, perl-5.10, rack-1.1, wsgi-3.2 and php-5.3. I'm interested in deploying a Java EE application, so I'll be creating a "jbossas-7.0" application. This type of application provides you a JBoss AS 7.0.0 instance in the OpenShift cloud to which you can deploy your applications. So let's now create an application of type jbossas-7.0. &lt;br /&gt;&lt;br /&gt;Note that the term "application" can be a bit confusing (atleast I found it a bit confusing) because all you are doing at this point is setting up JBoss AS7 server.&lt;br /&gt;&lt;br /&gt;The command to create an application is rhc-create-app. The rhc-create-app accepts multiple options. For a complete list of options run:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; rhc-create-app --help  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;To create a jbossas-7.0 application, we'll run the following command:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; rhc-create-app -a &amp;lt;application-name&amp;gt; -l &amp;lt;email-id-you-used-to-register&amp;gt; -t jbossas-7.0 -r &amp;lt;path-on-local-filesystem-for-the-repository&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Running that command will ask you for the password that you used to register. Enter that password and let the command complete (a few seconds).&lt;br /&gt;&lt;br /&gt;The -a option lets you specify the name for your application. This name will be part of the URL that you use to access your application. If your application name is "foo" and (the previously created) domain name is "bar", then the URL to access your application will be http://foo-bar.rhcloud.com/.  &lt;br /&gt;&lt;br /&gt;The -t option in that command, specifies the application type. In our case, we are interested in jbossas-7.0&lt;br /&gt;&lt;br /&gt;The other option of importance is the -r option which you'll use to point to a folder on your local filesystem where OpenShift will store all the data related to your application. Part of that data will be a local copy of the git repo (version control system). We'll see this in more detail later on in this blog.&lt;br /&gt;&lt;h4&gt;Access your server URL&lt;/h4&gt;So once you run the command and it successfully completes, it will print out the URL where the application is available. You can (immediately) use that URL to access the application. On accessing that URL you'll notice a welcome page, which is an indication that the application has been installed successfully and available for access. For me, the URL to the newly created application was &lt;a href="http://jaikiran-jbossas.rhcloud.com/"&gt;http://jaikiran-jbossas.rhcloud.com/&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;So at this point, we have created a domain and then an application and have made sure that it's accessible to the world. In short, your cloud server is up and running and you can now deploy your Java EE applications to that server.&lt;br /&gt;&lt;h4&gt;Create and deploy a Java EE application&lt;/h4&gt;So let's now move to the step of creating and deploying a Java EE application. I didn't have any specific application in mind, but wanted to deploy an application which would involve accessing a database. Instead of creating a brand new application, I decide to use one of the quick start applications that come with JBoss AS7. The quick start applications for JBoss AS7 are available for download &lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;here&lt;/a&gt;. Once you have downloaded the quick start archive, unzip it to a location of your choice. Building the quick start examples will require Maven build tool be installed on your system. The details about the quick start applications and how to build them can be found &lt;a href="https://docs.jboss.org/author/display/AS7/Getting+Started+Developing+Applications+Guide"&gt;here&lt;/a&gt;. Those interested in trying it out themselves, might want to look at that guide.&lt;br /&gt;&lt;br /&gt;I chose the "kitchensink" application from those quick starts. The kitchensink application uses Java Persistence API (JPA) for persistence and by default uses the java:jboss/datasources/ExampleDS which is shipped by default by JBoss AS7. The ExampleDS uses &lt;a href="http://www.h2database.com/html/main.html"&gt;H2&lt;/a&gt; as its database.This is how the persistence.xml looks like:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;  &lt;br /&gt; &amp;lt;persistence version="2.0"  &lt;br /&gt;   xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  &lt;br /&gt;   xsi:schemaLocation="  &lt;br /&gt;     http://java.sun.com/xml/ns/persistence  &lt;br /&gt;     http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&amp;gt;  &lt;br /&gt;   &amp;lt;persistence-unit name="primary"&amp;gt;  &lt;br /&gt;    &amp;lt;!-- If you are running in a production environment, add a managed   &lt;br /&gt;      data source, the example data source is just for proofs of concept! --&amp;gt;  &lt;br /&gt;    &lt;b&gt;&amp;lt;jta-data-source&amp;gt;java:jboss/datasources/ExampleDS&amp;lt;/jta-data-source&amp;gt;  &lt;/b&gt;&lt;br /&gt;    &amp;lt;properties&amp;gt;  &lt;br /&gt;      &amp;lt;!-- Properties for Hibernate --&amp;gt;  &lt;br /&gt;      &amp;lt;property name="hibernate.hbm2ddl.auto" value="create-drop" /&amp;gt;  &lt;br /&gt;      &amp;lt;property name="hibernate.show_sql" value="false" /&amp;gt;  &lt;br /&gt;    &amp;lt;/properties&amp;gt;  &lt;br /&gt;   &amp;lt;/persistence-unit&amp;gt;  &lt;br /&gt; &amp;lt;/persistence&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;That's enough for me now, to show how to deploy the application and also show the DB support available in OpenShift Express.&lt;br /&gt;&lt;br /&gt;After &lt;a href="https://docs.jboss.org/author/display/AS7/Getting+Started+Developing+Applications+Guide"&gt;building the application&lt;/a&gt;, the deployable war is named jboss-as-kitchensink.war and is available on my local file system. My next step would be to deploy it my JBoss AS7 server which we have setup on the OpenShift Express cloud. Let's see how that's done.&lt;br /&gt;&lt;h4&gt;Deploy the application to OpenShift Express&lt;/h4&gt;Remember, while creating the "application" using the rhc-create-app command, we used the -r option to point to a folder on our local file system to create a local copy of the application repository. That's the place which will be used now for deploying our applications. In my case, I used /home/jpai/OpenShift/myapps/demo as the repo location. This is how that folder looks like:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; demo  &lt;br /&gt; |  &lt;br /&gt; |--- deployments  &lt;br /&gt; |  &lt;br /&gt; |--- pom.xml  &lt;br /&gt; |  &lt;br /&gt; |--- README  &lt;br /&gt; |  &lt;br /&gt; |--- src  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;There's more than one way to deploy your application to OpenShift Express. One way is to write your code and commit the source code within the src folder of your local repository and then push your changes to the remote git repository. This will then trigger a Maven build for your project on the remote repository. More details about this approach is available in &lt;a href="https://www.redhat.com/openshift/blogs/seeing-cdi-working-in-openshift"&gt;this blog&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;In our case, we'll focus on how to deploy an already built Java EE application to your OpenShift Express cloud server. In the previous step, we built the jboss-as-kitchensink.war. Now, copy that war file to the "deployments" subfolder of your local git repository. In this case, it's /home/jpai/OpenShift/myapps/demo/deployments:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; cp /home/jpai/jboss-as-quickstarts-7.0.0.Final/kitchensink/target/jboss-as-kitchensink.war /home/jpai/OpenShift/myapps/demo/deployments  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Once you have copied it here, your next step is to "commit" this change using the git commit command:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:demo$ git add deployments/jboss-as-kitchensink.war  &lt;br /&gt; jpai@jpai-laptop:demo$ git commit -m "Deploy kitchensink application" deployments/jboss-as-kitchensink.war  &lt;br /&gt; [master 1637c21] Deploy kitchensink application  &lt;br /&gt;  1 files changed, 0 insertions(+), 0 deletions(-)  &lt;br /&gt;  create mode 100644 deployments/jboss-as-kitchensink.war  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;So at this point your kitchensink application has been commited to your local git repo. Next we should "push" this commit to the remote git repo:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:openshift$ git push origin master  &lt;br /&gt; Counting objects: 6, done.  &lt;br /&gt; Delta compression using up to 2 threads.  &lt;br /&gt; Compressing objects: 100% (4/4), done.  &lt;br /&gt; Writing objects: 100% (4/4), 393.71 KiB, done.  &lt;br /&gt; Total 4 (delta 1), reused 0 (delta 0)  &lt;br /&gt; remote: Stopping application...  &lt;br /&gt; remote: done  &lt;br /&gt; remote: Found .openshift/config/standalone.xml... copying to ...  &lt;br /&gt; ....  &lt;br /&gt; ....  &lt;br /&gt; ....  &lt;br /&gt; remote: Starting application...done  &lt;br /&gt; To ssh://6a7ff43a6c2246999de28219a5aaa4ae@jaikiran-jbossas.rhcloud.com/~/git/jaikiran.git/  &lt;br /&gt;   6e57976..1637c21 master -&amp;gt; master  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;(trimmed some logs from the above output).&lt;br /&gt;&lt;br /&gt;So with this "push" we have now deployed our application to the remote OpenShift Express JBoss AS7 server. The jboss-as-kitchensink.war will be deployed at the "jboss-as-kitchensink" web application context. So the URL to access the application will be &lt;a href="http://jaikiran-jbossas.rhcloud.com/jboss-as-kitchensink"&gt;http://jaikiran-jbossas.rhcloud.com/jboss-as-kitchensink&lt;/a&gt;. Go ahead and access that URL. The application does nothing fancy - it allows you to add a user name, email and phone number which will then be stored in the database.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-aob0Mj7Oxas/Tk_QHJoPveI/AAAAAAAAABw/PmYDRjFxrAY/s1600/openshift-kitchensink.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="278" src="http://1.bp.blogspot.com/-aob0Mj7Oxas/Tk_QHJoPveI/AAAAAAAAABw/PmYDRjFxrAY/s640/openshift-kitchensink.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Like I mentioned earlier, the kitchensink application uses ExampleDS datasource which is backed by H2 database. So all the data will be stored remotely in the H2 database.&lt;br /&gt;&lt;h4&gt;Using the MySQL database available in OpenShift Express&lt;/h4&gt;OpenShift Express sets up a MySQL datasource &lt;i&gt;template&lt;/i&gt; for you when you create a jbossas-7.0 application type. The details of the database can be found in the &amp;lt;path-to-local-repo&amp;gt;/.openshift/config/standalone.xml:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;subsystem xmlns="urn:jboss:domain:datasources:1.0"&amp;gt;  &lt;br /&gt;      &amp;lt;datasources&amp;gt;  &lt;br /&gt;           &amp;lt;datasource jndi-name="java:jboss/datasources/ExampleDS" enabled="true" use-java-context="true" pool-name="H2DS"&amp;gt;  &lt;br /&gt;                &amp;lt;connection-url&amp;gt;jdbc:h2:${jboss.server.data.dir}/test;DB_CLOSE_DELAY=-1&amp;lt;/connection-url&amp;gt;  &lt;br /&gt;                &amp;lt;driver&amp;gt;h2&amp;lt;/driver&amp;gt;  &lt;br /&gt;                &amp;lt;pool&amp;gt;&amp;lt;/pool&amp;gt;  &lt;br /&gt;                &amp;lt;security&amp;gt;  &lt;br /&gt;                     &amp;lt;user-name&amp;gt;sa&amp;lt;/user-name&amp;gt;  &lt;br /&gt;                     &amp;lt;password&amp;gt;sa&amp;lt;/password&amp;gt;  &lt;br /&gt;                &amp;lt;/security&amp;gt;  &lt;br /&gt;                &amp;lt;validation&amp;gt;&amp;lt;/validation&amp;gt;  &lt;br /&gt;                &amp;lt;timeout&amp;gt;&amp;lt;/timeout&amp;gt;  &lt;br /&gt;                &amp;lt;statement&amp;gt;&amp;lt;/statement&amp;gt;  &lt;br /&gt;           &amp;lt;/datasource&amp;gt;  &lt;br /&gt;           &lt;b&gt;&amp;lt;datasource jndi-name="java:jboss/datasources/MysqlDS" enabled="false" use-java-context="true" pool-name="MysqlDS"&amp;gt;&lt;/b&gt;  &lt;br /&gt;                &amp;lt;connection-url&amp;gt;jdbc:mysql://127.1.1.1:3306/mysql&amp;lt;/connection-url&amp;gt;  &lt;br /&gt;                &amp;lt;driver&amp;gt;mysql&amp;lt;/driver&amp;gt;  &lt;br /&gt;                &amp;lt;security&amp;gt;  &lt;br /&gt;                 &amp;lt;user-name&amp;gt;admin&amp;lt;/user-name&amp;gt;  &lt;br /&gt;                 &amp;lt;password&amp;gt;changeme&amp;lt;/password&amp;gt;  &lt;br /&gt;                &amp;lt;/security&amp;gt;  &lt;br /&gt;           &amp;lt;/datasource&amp;gt;  &lt;br /&gt;           &amp;lt;drivers&amp;gt;  &lt;br /&gt;                &amp;lt;driver name="h2" module="com.h2database.h2"&amp;gt;  &lt;br /&gt;                     &amp;lt;xa-datasource-class&amp;gt;org.h2.jdbcx.JdbcDataSource&amp;lt;/xa-datasource-class&amp;gt;  &lt;br /&gt;                &amp;lt;/driver&amp;gt;  &lt;br /&gt;                &amp;lt;driver name="mysql" module="com.mysql.jdbc"&amp;gt;  &lt;br /&gt;                     &amp;lt;xa-datasource-class&amp;gt;com.mysql.jdbc.jdbc2.optional.MysqlXADataSource&amp;lt;/xa-datasource-class&amp;gt;  &lt;br /&gt;                &amp;lt;/driver&amp;gt;  &lt;br /&gt;           &amp;lt;/drivers&amp;gt;  &lt;br /&gt;      &amp;lt;/datasources&amp;gt;  &lt;br /&gt; &amp;lt;/subsystem&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;You'll notice that apart from the ExampleDS that comes by default in AS7, OpenShift Express has setup a MySQL datasource which will be available at java:jboss/datasources/MysqlDS. The important piece to note here is that it is disabled (i.e. enabled=false) by default. Also notice that the password is "changeme". Basically, this datasource configuration for MysqlDS in the standalone.xml is there as a template. In order to enable that datasource, we first have to create a MySQL database for our application. That can be done by using the following command:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:openshift$ rhc-ctl-app -a &amp;lt;application-name&amp;gt; -l &amp;lt;email-id-we-used-to-register&amp;gt; -e add-mysql-5.1   &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;The rhc-ctl-app is passed the application name (which is the one that we used during rhc-create-app) and also our account id. Additionally, we use the -e option to specify what we want to do. In this case, we issue a "add-mysql-5.1" command. Running that command will ask you for your account password and on successful completion will show the output similar to:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; RESULT:  &lt;br /&gt; Mysql 5.1 database added. Please make note of these credentials:  &lt;br /&gt; Root User: admin  &lt;br /&gt; Root Password: as43n34023n  &lt;br /&gt; Connection URL: mysql://127.1.1.1:3306/  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Note down the user name, password and the connection url. Now open the &amp;lt;repo-home&amp;gt;/.openshift/config/standalone.xml in a text editor and update the MysqlDS configuration to use the connection URL, the user name and the new password. Also set the enabled flag to "true" so that the datasource is enabled. Ultimately the datasource configuration will look like:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;datasource jndi-name="java:jboss/datasources/MysqlDS" enabled="true" use-java-context="true" pool-name="MysqlDS"&amp;gt;  &lt;br /&gt;      &amp;lt;connection-url&amp;gt;jdbc:mysql://127.1.1.1:3306/mysql&amp;lt;/connection-url&amp;gt;  &lt;br /&gt;      &amp;lt;driver&amp;gt;mysql&amp;lt;/driver&amp;gt;  &lt;br /&gt;      &amp;lt;security&amp;gt;  &lt;br /&gt;       &amp;lt;user-name&amp;gt;admin&amp;lt;/user-name&amp;gt;  &lt;br /&gt;       &amp;lt;password&amp;gt;as43n34023n&amp;lt;/password&amp;gt;  &lt;br /&gt;      &amp;lt;/security&amp;gt;  &lt;br /&gt; &amp;lt;/datasource&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Pay attention to the connection-url. It has to be of the format jdbc:mysql://&amp;lt;ip:port&amp;gt;/dbname. Typically, you don't have to touch that connection-url at all, since the rhc-ctl-app add-mysql-5.1 and the datasource template are in sync with the IP/port. The important pieces to change are the password and the enabled flag.&lt;br /&gt;&lt;br /&gt;Once this file is updated, save the changes and commit it to your local git repo:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:demo$ git commit -m "Enable the MysqlDS and fix the password" ./  &lt;br /&gt; [master dd7b58a] Fix the datasource password  &lt;br /&gt; 1 files changed, 1 insertions(+), 1 deletions(-)  &lt;br /&gt; Push these changes to remote repo:  &lt;br /&gt; jpai@jpai-laptop:openshift$ git push origin master  &lt;br /&gt; Counting objects: 9, done.  &lt;br /&gt; Delta compression using up to 2 threads.  &lt;br /&gt; Compressing objects: 100% (4/4), done.  &lt;br /&gt; Writing objects: 100% (5/5), 494 bytes, done.  &lt;br /&gt; Total 5 (delta 2), reused 0 (delta 0)  &lt;br /&gt; remote: Stopping application...  &lt;br /&gt; remote: done  &lt;br /&gt; ....  &lt;br /&gt; .....  &lt;br /&gt; remote: Starting application...done  &lt;br /&gt; To ssh://6a7ff43a6c2246999de28219a5aaa4ae@jaikiran-jbossas.rhcloud.com/~/git/jaikiran.git/  &lt;br /&gt; 2d38fa8..dd7b58a master -&amp;amp;gt; master  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;So we now have added MySQL DB and enabled the MysqlDS datasource which is available at java:jboss/datasources/MysqlDS jndi name on the server. So if the kitchensink application has to use MySQL as its database, instead of H2, then all it has to do is use the java:jboss/datasources/MysqlDS. Let's now edit the persistence.xml file that we saw earlier and use the MysqlDS instead:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;  &lt;br /&gt; &amp;lt;persistence version="2.0"  &lt;br /&gt;   xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  &lt;br /&gt;   xsi:schemaLocation="  &lt;br /&gt;     http://java.sun.com/xml/ns/persistence  &lt;br /&gt;     http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&amp;gt;  &lt;br /&gt;   &amp;lt;persistence-unit name="primary"&amp;gt;  &lt;br /&gt;    &amp;lt;!-- Changed to use MysqlDS --&amp;gt;  &lt;br /&gt;    &lt;b&gt;&amp;lt;jta-data-source&amp;gt;java:jboss/datasources/MysqlDS&amp;lt;/jta-data-source&amp;gt;&lt;/b&gt;  &lt;br /&gt;    &amp;lt;properties&amp;gt;  &lt;br /&gt;      &amp;lt;!-- Properties for Hibernate --&amp;gt;  &lt;br /&gt;      &amp;lt;property name="hibernate.hbm2ddl.auto" value="create-drop" /&amp;gt;  &lt;br /&gt;      &amp;lt;property name="hibernate.show_sql" value="false" /&amp;gt;  &lt;br /&gt;    &amp;lt;/properties&amp;gt;  &lt;br /&gt;   &amp;lt;/persistence-unit&amp;gt;  &lt;br /&gt; &amp;lt;/persistence&amp;gt;   &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Additionally, just to "show" that this new application has been updated to use MySQL database, I also edited the index.xhtml page of the kitchensink application, to add a message on that page about MySQL database being used:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;h3&amp;gt;  &lt;br /&gt;       &amp;lt;span style="color: red;"&amp;gt;  &lt;br /&gt;            This application uses MySQL database as its persistence store  &lt;br /&gt;        &amp;lt;/span&amp;gt;  &lt;br /&gt; &amp;lt;/h3&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Next, I'll build the kitchensink application locally using Maven, to reflect these changes and generate the new jboss-as-kitchensink.war. Once built, let's now again copy it to our local git repo and then commit the change and push it to the remote git repo:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:kitchensink$ cp target/jboss-as-kitchensink.war /home/jpai/OpenShift/myapps/demo/deployments  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:demo$ git commit -m "Use MySQL database for kitchensink application" ./  &lt;br /&gt; [master ded2445] Use MySQL database for kitchensink application  &lt;br /&gt; 1 files changed, 0 insertions(+), 0 deletions(-)  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:openshift$ git push origin master  &lt;br /&gt; Counting objects: 7, done.  &lt;br /&gt; Delta compression using up to 2 threads.  &lt;br /&gt; Compressing objects: 100% (4/4), done.  &lt;br /&gt; Writing objects: 100% (4/4), 1.35 KiB, done.  &lt;br /&gt; Total 4 (delta 2), reused 0 (delta 0)  &lt;br /&gt; remote: Stopping application...  &lt;br /&gt; remote: done  &lt;br /&gt; remote: Found .openshift/config/standalone.xml... copying to...  &lt;br /&gt; ...  &lt;br /&gt; ...  &lt;br /&gt; ...  &lt;br /&gt; remote: Starting application...done  &lt;br /&gt; To ssh://6a7ff43a6c2246999de28219a5aaa4ae@jaikiran-jbossas.rhcloud.com/~/git/jaikiran.git/  &lt;br /&gt; 1637c21..ded2445 master -&amp;amp;gt; master  &lt;br /&gt; jpai@jpai-laptop:demo$   &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;(trimmed some logs from the output)&lt;br /&gt;&lt;br /&gt;So at this point we have now changed our kitchensink application to use MySQL database and have deployed it to our OpenShift Express AS7 server. So let's access the application URL again &lt;a href="http://jaikiran-jbossas.rhcloud.com/jboss-as-kitchensink"&gt;http://jaikiran-jbossas.rhcloud.com/jboss-as-kitchensink&lt;/a&gt;. As you see, that page now prominently displays our message about MySQL DB being used. Go ahead and try out that app by adding some dummy user information.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-xh3u0qY2ZtI/Tk_TW2NnkxI/AAAAAAAAAB4/g3xyAr8kLj4/s1600/openshift-mysql.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="278" src="http://4.bp.blogspot.com/-xh3u0qY2ZtI/Tk_TW2NnkxI/AAAAAAAAAB4/g3xyAr8kLj4/s640/openshift-mysql.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;That's it! We have successfully deployed our application to OpenShift Express server and the application is available for use. &lt;br /&gt;&lt;h4&gt;Summary&lt;/h4&gt;It's been a pleasant experience so far with OpenShift. I plan to try out a few more things with OpenShift, in the coming days and blog about any interesting details. &lt;br /&gt;&lt;h4&gt;Useful resources&lt;/h4&gt;While working on deploying this application, I had to use some documents and help from the OpenShift community to understand how this is all setup,. Here's a list of useful resources related to OpenShift in general:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://docs.redhat.com/docs/en-US/OpenShift_Express/1.0/html/User_Guide/"&gt;OpenShift Express User guide&lt;/a&gt; &lt;br /&gt;&lt;a href="https://www.redhat.com/openshift/forums/"&gt;OpenShift forums&lt;/a&gt; &lt;br /&gt;OpenShift IRC #openshift on irc.freenode.net. The folks here are very helpful!&lt;br /&gt;&lt;a href="http://community.jboss.org/blogs/scott.stark/tags/as7_openshift"&gt;Scott Stark's blog&lt;/a&gt;. Scott's blogs contain a lot of useful information about AS7 on OpenShift and OpenShift in general. Scott's blog is definitely a must read!&lt;br /&gt;&lt;h4&gt;Where to look for help&lt;/h4&gt;OpenShift questions in general are answered in the &lt;a href="https://www.redhat.com/openshift/forums/"&gt;OpenShift forums&lt;/a&gt;. For questions around AS7 on OpenShift, the best place to ask questions is the &lt;a href="http://community.jboss.org/groups/cloud?view=discussions"&gt;JBoss Cloud Group&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;[&lt;a href="http://www.jboss.org/openshift.html"&gt;AS7 + OpenShift&lt;/a&gt;] [&lt;a href="https://www.redhat.com/openshift/"&gt;OpenShift Home&lt;/a&gt;] [&lt;a href="http://www.jboss.org/as7"&gt;AS7 Home&lt;/a&gt;] [&lt;a href="http://community.jboss.org/groups/cloud?view=discussions"&gt;JBoss Cloud Group&lt;/a&gt;] [&lt;a href="http://community.jboss.org/blogs/scott.stark/tags/as7_openshift"&gt;Scott Stark's blog&lt;/a&gt;]&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7082113776060279466?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7082113776060279466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7082113776060279466' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7082113776060279466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7082113776060279466'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/08/deploy-java-ee-application-on-openshift.html' title='Deploy a Java EE application on OpenShift Express (with AS7 support)'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-aob0Mj7Oxas/Tk_QHJoPveI/AAAAAAAAABw/PmYDRjFxrAY/s72-c/openshift-kitchensink.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7027294721808669015</id><published>2011-08-19T16:35:00.000+05:30</published><updated>2011-08-19T16:35:33.292+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 6.1.0 released</title><content type='html'>This week at JBoss, we not only saw &lt;a href="http://jaitechwriteups.blogspot.com/2011/08/jboss-as-701-released.html"&gt;JBoss AS 7.0.1 being released&lt;/a&gt; but there also was the release of JBoss AS 6.1.0, a few days earlier. The download is available &lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;here&lt;/a&gt;. JBoss AS 6.1.0 is mainly is bug fix release. This release is mainly for those users who haven't yet migrated to AS7. Release notes are available &lt;a href="http://community.jboss.org/wiki/AS610FinalReleaseNotes"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One of the highlights of this release, is that this was mainly driven by the community members.Many of the JBoss AS developers were busy with AS7 activities, so we had &lt;a href="http://community.jboss.org/thread/166668"&gt;asked for community members to volunteer&lt;/a&gt; for providing fixes for 6.1.0. &lt;a href="http://community.jboss.org/people/shelly.mcgowan"&gt;Shelly&lt;/a&gt; led the 6.1.0 release efforts (like she did with 6.0.0). We had some great help from the community for this release, notably from &lt;a href="http://community.jboss.org/people/beve"&gt;Daniel Bevenius&lt;/a&gt; who helped fix a number of issues. Thanks to Shelly, Daniel and other community members for making this release possible!&lt;br /&gt;&lt;br /&gt;So, AS6 users, &lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;download&lt;/a&gt; this new release and give it a try! As always, if you have any questions or run into any issues, please visit our &lt;a href="http://community.jboss.org/en/jbossas"&gt;user forum&lt;/a&gt; and start a discussion.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7027294721808669015?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7027294721808669015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7027294721808669015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7027294721808669015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7027294721808669015'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/08/jboss-as-610-released.html' title='JBoss AS 6.1.0 released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-8503276163821026902</id><published>2011-08-19T14:01:00.003+05:30</published><updated>2011-08-19T14:35:27.110+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas7'/><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='as7'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb3.1'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss_application_server7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 7.0.1 - Configuring EJB3 Pools</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Now that AS 7.0.1 has been released, let's take a look at what new EJB3 features are available. Like I mentioned in my &lt;a href="http://jaitechwriteups.blogspot.com/2011/08/jboss-as-701-released.html"&gt;previous post&lt;/a&gt; AS 7.0.1 now allows you to configure pools for your stateless session beans and MDBs. Currently we allow configuring the pools at the subsystem level, which means that the pool will be applicable for all the beans deployed on the server. In some upcoming release, we'll allow configuring the pools at individual deployment and individual bean level. Let's, for now, see how the configuration looks like at the subsystem level. &lt;br /&gt;&lt;br /&gt;In my &lt;a href="http://jaitechwriteups.blogspot.com/2011/08/jboss-as-701-released.html"&gt;previous post&lt;/a&gt; I mentioned that AS 7.0.1 has 2 distributions. One which is purely webprofile and the other (named "everything") has additional EE features like support for MDBs. In this post, I'll be using the "Everything" distribution and the JBOSS_HOME/standalone/configurations/standalone-preview.xml for explaining the configurations. &lt;br /&gt;&lt;br /&gt;Before we begin with the configurations, for those of you who are new to AS7, let's just see how to start the server using a specific configuration file. First, &lt;a href="http://www.jboss.org/jbossas/downloads/"&gt;download&lt;/a&gt; the server and the unzip the binary in a folder of your choice. Then from the command prompt, move to the "bin" folder of the installation. Within this folder, you will see a standalone.bat/standalone.sh and domain.bat/domain.sh. We'll be concentrating on the standalone server in this post, but the same applies to the EJB3 subsystem in the domain configurations.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Starting the standalone server&lt;/h4&gt;So let's start the server. I'm on a Linux system, so I'll use the standalone.sh file. Those of you on Windows, will have to use standalone.bat.&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:bin$ ./standalone.sh  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Within around a couple of seconds, you'll see the server is up and running:&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:bin$ ./standalone.sh  &lt;br /&gt; =========================================================================  &lt;br /&gt;  JBoss Bootstrap Environment  &lt;br /&gt;  JBOSS_HOME: /NotBackedUp/jpai/jboss-as-7.0.1.Final  &lt;br /&gt;  JAVA: /opt/Java/SunJava-6/jdk1.6.0_21//bin/java  &lt;br /&gt;  JAVA_OPTS: -server -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  &lt;br /&gt; =========================================================================  &lt;br /&gt; 09:30:31,537 INFO [org.jboss.modules] JBoss Modules version 1.0.1.GA  &lt;br /&gt; 09:30:31,765 INFO [org.jboss.msc] JBoss MSC version 1.0.0.GA  &lt;br /&gt; 09:30:31,818 INFO [org.jboss.as] JBoss AS 7.0.1.Final "Zap" starting  &lt;br /&gt; 09:30:32,618 WARN [org.jboss.as] No security realm defined for native management service, all access will be unrestricted.  &lt;br /&gt; 09:30:32,693 INFO [org.jboss.as] creating http management service using network interface (management) port (9990)  &lt;br /&gt; 09:30:32,694 WARN [org.jboss.as] No security realm defined for http management service, all access will be unrestricted.  &lt;br /&gt; 09:30:32,703 INFO [org.jboss.as.logging] Removing bootstrap log handlers  &lt;br /&gt; 09:30:32,720 INFO [org.jboss.as.connector.subsystems.datasources] (Controller Boot Thread) Deploying JDBC-compliant driver class org.h2.Driver (version 1.2)  &lt;br /&gt; 09:30:32,739 INFO [org.jboss.as.clustering.infinispan.subsystem] (Controller Boot Thread) Activating Infinispan subsystem.  &lt;br /&gt; 09:30:32,905 INFO [org.jboss.as.naming] (Controller Boot Thread) Activating Naming Subsystem  &lt;br /&gt; 09:30:32,915 INFO [org.jboss.as.naming] (MSC service thread 1-1) Starting Naming Service  &lt;br /&gt; 09:30:32,918 INFO [org.jboss.as.osgi] (Controller Boot Thread) Activating OSGi Subsystem  &lt;br /&gt; 09:30:32,940 INFO [org.jboss.as.security] (Controller Boot Thread) Activating Security Subsystem  &lt;br /&gt; 09:30:32,957 INFO [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version 3.2.0.Beta2  &lt;br /&gt; 09:30:32,968 INFO [org.xnio] (MSC service thread 1-4) XNIO Version 3.0.0.Beta3  &lt;br /&gt; 09:30:32,982 INFO [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.0.0.Beta3  &lt;br /&gt; 09:30:33,182 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-4) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/Java/SunJava-6/jdk1.6.0_21/jre/lib/i386/server:/opt/Java/SunJava-6/jdk1.6.0_21/jre/lib/i386:/opt/Java/SunJava-6/jdk1.6.0_21/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib  &lt;br /&gt; 09:30:33,203 INFO [org.jboss.as.jmx.JMXConnectorService] (MSC service thread 1-2) Starting remote JMX connector  &lt;br /&gt; 09:30:33,209 INFO [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:9999  &lt;br /&gt; 09:30:33,232 INFO [org.jboss.as.ee] (Controller Boot Thread) Activating EE subsystem  &lt;br /&gt; 09:30:33,390 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080  &lt;br /&gt; 09:30:33,512 INFO [org.jboss.as.connector] (MSC service thread 1-1) Starting JCA Subsystem (JBoss IronJacamar 1.0.3.Final)  &lt;br /&gt; 09:30:33,554 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) Bound data source [java:jboss/datasources/ExampleDS]  &lt;br /&gt; 09:30:33,919 INFO [org.jboss.as.deployment] (MSC service thread 1-4) Started FileSystemDeploymentService for directory /NotBackedUp/jpai/jboss-as-7.0.1.Final/standalone/deployments  &lt;br /&gt; 09:30:33,931 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final "Zap" started in 2636ms - Started 93 of 148 services (55 services are passive or on-demand)  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h4&gt;Using a different server configuration file&lt;/h4&gt;The standalone.sh command by default uses a configuration file named "standalone.xml" which is present in JBOSS_HOME/standalone/configuration folder. The command also allows you to specify a different configuration file, to start the server. Like I mentioned, earlier, I'll be using the standalone-preview.xml in this post. So let's start the server using the standalone-preview.xml. &lt;br /&gt;&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; jpai@jpai-laptop:bin$ ./standalone.sh -server-config=standalone-preview.xml  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;As you see, we pass the -server-config parameter with standalone-preview.xml as the parameter value. By default, the file is looked for in the JBOSS_HOME/standalone/configuration folder. The server starts up in around 3.5 seconds:&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; 09:35:59,694 INFO&amp;amp;nbsp; [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.1.Final "Zap" started in 3586ms - Started 125 of 184 services (59 services are passive or on-demand)  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h4&gt;EJB3 subsystem configurations&lt;/h4&gt;Now that we have seen how to startup the server, let's move on to see the configurations. In the standalone-preview.xml, look for the EJB3 subsystem which looks like this:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;subsystem xmlns="urn:jboss:domain:ejb3:1.1" &amp;gt;  &lt;br /&gt;      &amp;lt;timer-service&amp;gt;  &lt;br /&gt;           &amp;lt;thread-pool core-threads="1" max-threads="4" /&amp;gt;  &lt;br /&gt;           &amp;lt;data-store path="timer-service-data" relative-to="jboss.server.data.dir" /&amp;gt;  &lt;br /&gt;      &amp;lt;/timer-service&amp;gt;  &lt;br /&gt;      &amp;lt;!-- EJB3 pools --&amp;gt;  &lt;br /&gt;      &amp;lt;pools&amp;gt;  &lt;br /&gt;           &amp;lt;bean-instance-pools&amp;gt;  &lt;br /&gt;                &amp;lt;strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5"  &lt;br /&gt;                                     instance-acquisition-timeout-unit="MINUTES"/&amp;gt;  &lt;br /&gt;                &amp;lt;strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5"  &lt;br /&gt;                                     instance-acquisition-timeout-unit="MINUTES"/&amp;gt;  &lt;br /&gt;           &amp;lt;/bean-instance-pools&amp;gt;  &lt;br /&gt;      &amp;lt;/pools&amp;gt;  &lt;br /&gt;      &amp;lt;!-- Default MDB configurations --&amp;gt;  &lt;br /&gt;      &amp;lt;mdb&amp;gt;  &lt;br /&gt;           &amp;lt;resource-adapter-ref resource-adapter-name="hornetq-ra"/&amp;gt;  &lt;br /&gt;           &amp;lt;bean-instance-pool-ref pool-name="mdb-strict-max-pool"/&amp;gt;  &lt;br /&gt;      &amp;lt;/mdb&amp;gt;  &lt;br /&gt;      &amp;lt;!-- Session bean configurations --&amp;gt;  &lt;br /&gt;      &amp;lt;session-bean&amp;gt;  &lt;br /&gt;           &amp;lt;stateless&amp;gt;  &lt;br /&gt;                &amp;lt;bean-instance-pool-ref pool-name="slsb-strict-max-pool"/&amp;gt;  &lt;br /&gt;           &amp;lt;/stateless&amp;gt;  &lt;br /&gt;      &amp;lt;/session-bean&amp;gt;  &lt;br /&gt; &amp;lt;/subsystem&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;This is where the EJB3 subsystem level configurations are present. Let's quickly see what some of those are. The first piece of configuration is for EJB3 timerservices. We won't go into too much details of that in this post. &lt;br /&gt;&lt;h4&gt;EJB3 Pools&lt;/h4&gt;The next piece of configuration is the "pools":&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;!-- EJB3 pools --&amp;gt;  &lt;br /&gt; &amp;lt;pools&amp;gt;  &lt;br /&gt;      &amp;lt;bean-instance-pools&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5"  &lt;br /&gt;                                instance-acquisition-timeout-unit="MINUTES"/&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5"  &lt;br /&gt;                                instance-acquisition-timeout-unit="MINUTES"/&amp;gt;  &lt;br /&gt;      &amp;lt;/bean-instance-pools&amp;gt;  &lt;br /&gt; &amp;lt;/pools&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;This is where you configure the pools used by EJB3. Within the "pools" element, you can configure the bean instance pools using the "bean-instance-pools" element. In AS 7.0.1, we only support "strict-max-pool" as a bean instance pool. &lt;br /&gt;&lt;br /&gt;A strict max pool allows you to configure a maximum upper limit for the pool. At runtime, when all the bean instances from the pool are in use and a new bean invocation request comes in, the pool blocks the request till the next bean instance is available or till a timeout (set in instance-acquisition-timeout) is reached. Each pool has a unique name. The configurations above show 2 strict max pools named "slsb-strict-max-pool" and "mdb-strict-max-pool". You can add a new strict max pool in there and set a unique name of your choice to it. You can either edit the xml by hand (when the server is down) to add a new strict max pool or you can use the Command Line Client (CLI) that comes with AS7. We'll see how to use the CLI, later in this post. &lt;br /&gt;&lt;h4&gt;Message driven bean configurations&lt;/h4&gt;Let's now move to the next configurations in that EJB3 subsystem:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;!-- Default MDB configurations --&amp;gt;  &lt;br /&gt; &amp;lt;mdb&amp;gt;  &lt;br /&gt;      &amp;lt;resource-adapter-ref resource-adapter-name="hornetq-ra"/&amp;gt;  &lt;br /&gt;      &amp;lt;bean-instance-pool-ref pool-name="mdb-strict-max-pool"/&amp;gt;  &lt;br /&gt; &amp;lt;/mdb&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;This section configures the MDB with the defaults. &lt;br /&gt;&lt;h4&gt;Default resource adapter for MDBs&lt;/h4&gt;The "resource-adapter-ref" element specifies the default resource-adapter which will be used by the MDBs. In this example, it shows that we use hornetq-ra as the default RA. &lt;br /&gt;&lt;h4&gt;Default bean instance pool for MDBs&lt;/h4&gt;The bean-instance-pool-ref acts as a reference to a bean-instance-pool, which will be used as the default pool configuration for all MDBs. In this example, we see that it points to "mdb-strict-max-pool" which we saw in the earlier section was configured as a strict max pool with 20 as the upper limit for the pool. If you want to change the default bean instance pool for MDBs, then just change the pool-name attribute of the bean-instance-pool-ref element to some other bean instance pool that's available. You can either do it by editing the xml directly (when the server is down) or use the CLI to do this (we'll see how that's done, later).&lt;br /&gt;&lt;h4&gt;Stateless session bean configurations&lt;/h4&gt;Moving on to the next section in the EJB3 configurations, you'll see:&lt;br /&gt;&lt;pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; &amp;lt;!-- Session bean configurations --&amp;gt;  &lt;br /&gt; &amp;lt;session-bean&amp;gt;  &lt;br /&gt;      &amp;lt;stateless&amp;gt;  &lt;br /&gt;           &amp;lt;bean-instance-pool-ref pool-name="slsb-strict-max-pool"/&amp;gt;  &lt;br /&gt;      &amp;lt;/stateless&amp;gt;  &lt;br /&gt; &amp;lt;/session-bean&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;This is where you configure the defaults for the session beans. Like we saw with MDBs, the above configuration shows how we configure the default bean instance pool for the stateless session beans. Here we see that "slsb-strict-max-pool" is used as the default. Just like for MDBs, you can change the default bean instance pool for Stateless session beans by changing the pool-name attribute of the bean-instance-pool-ref element either directly in the xml or via the CLI.&lt;br /&gt;&lt;h4&gt;Using the Command Line Client (CLI)&lt;/h4&gt;AS7 comes with a powerful command line client. Check the &lt;a href="https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-CommandLineInterface"&gt;AS7 documentation on CLI&lt;/a&gt; for a quick reference. The command line client tool is started using the jboss-admin.sh/jboss-admin.bat scripts that are available in the JBOSS_HOME/bin folder:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; jpai@jpai-laptop:bin$ ./jboss-admin.sh  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;On running that script, you will notice the following message which acts you to connect to the server:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.  &lt;br /&gt; [disconnected /]   &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;The CLI requires a running server to be able to connect. So if you haven't started the server, then start it first (as explained in one of the sections above). Now let's connect to the server through the command line:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [disconnected /] connect  &lt;br /&gt; Connected to standalone controller at localhost:9999  &lt;br /&gt; [standalone@localhost:9999 /]   &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;So the CLI is now connected to the server which is listening on localhost on port 9999. The CLI can be passed a different hostname and port to connect to, but let's not get into that now.&lt;br /&gt;&lt;br /&gt;Once you are connected to the server from the CLI, you can now run operations from the CLI to manage your running server. Let's now see how we can manage the bean instance pool configurations for EJB3 subsystem.&lt;br /&gt;&lt;h4&gt;Create a new strict max bean instance pool from the CLI&lt;/h4&gt;After you have connected to the server from the CLI, you can create a new strict max bean instance pool as follows:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [standalone@localhost:9999 /] /subsystem=ejb3/strict-max-bean-instance-pool=new-pool:add  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;I would recommend that you read the &lt;a href="https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-CommandLineInterface"&gt;CLI documentation&lt;/a&gt; to understand the command better. But let me just briefly split up the above command and explain what each part does. &lt;br /&gt;&lt;br /&gt;An important thing to note is that you don't have to type all of that on the CLI. The CLI provides a very (very) useful tab completion feature! So typing in /subsystem= and pressing the tab will show you the available options.&lt;br /&gt;&lt;h4&gt;Understanding the bean instance pool creation command&lt;/h4&gt;From the CLI documentation:&lt;br /&gt;&lt;blockquote style="border:1px solid #CCCCCC;" word-wrap:break-word;&gt;An operation request basically consists of three parts: The address, an operation name and an optional set of parameters.&lt;br /&gt;&lt;br /&gt;The formal specification for an operation request is:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [/node-type=node-name (/node-type=node-name)*] : operation-name [( [parameter-name=parameter-value (,parameter-name=parameter-value)*] )]  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;In this example, our goal is to create a new strict max bean instance pool. This can be done by issuing a "add" operation. In the command that I posted above, notice the use of ":add" at the end. An operation always starts with a ":" followed by the operation name. So in the example above, we are issuing the ":add" operation.&lt;br /&gt;&lt;br /&gt;Now the "add" operation will have to be executed on a particular "resource". i.e. the server has to know what to add and where. This is known as addressing. In order to run an operation, an address needs to be provided (don't confuse this with the hostname/port "address" of the server, that's completely different). In AS7 management terms, the server is made up of manageable "resources" and each resource has a address of its own. For example, each of the subsystems that make up the server configuration can be addressed. To refer to the ejb3 subsystem from the command line client, you use /subsystem=ejb3 (you can use the tab completion).&lt;br /&gt;&lt;br /&gt;Let's say our new pool that we are creating is going to be named "new-pool". So ultimately the address at which the "add" operation needs to be carried out would look like:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; /subsystem=ejb3/strict-max-bean-instance-pool=new-pool  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Finally, we will combine the address and the operation and run it from the CLI&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [standalone@localhost:9999 /] /subsystem=ejb3/strict-max-bean-instance-pool=new-pool:add  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;A sucessful completion of the operation will show you the following output:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [standalone@localhost:9999 /] /subsystem=ejb3/strict-max-bean-instance-pool=new-pool:add  &lt;br /&gt; {"outcome" =&amp;gt; "success"}  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;All management operations are persisted to the server configuration file. In our case it's the standalone-preview.xml, since that's the one we used to start the server.&lt;br /&gt;&lt;br /&gt;After running that operation, you can now open the standalone-preview.xml in a text editor and notice that a new strict max bean instance pool, named "new-pool" has been added to the "bean-instance-pools":&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; &amp;lt;pools&amp;gt;  &lt;br /&gt;      &amp;lt;bean-instance-pools&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="new-pool"/&amp;gt;  &lt;br /&gt;      &amp;lt;/bean-instance-pools&amp;gt;  &lt;br /&gt; &amp;lt;/pools&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;The max-pool-size and the other attributes haven't been set and the default values will be used. That's because while running the operation, we did &lt;i&gt;not&lt;/i&gt; specify any values for those attributes. Let's now try issuing a command to create one more pool (named "take2") with some specific attribute values. The command will now look like:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [standalone@localhost:9999 /] /subsystem=ejb3/strict-max-bean-instance-pool=take2:add(max-pool-size=15,timeout=2)  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;So the command above is similar to the previous one, except that the name of the pool is "take2" and we have additional specified a max-pool-size of 15 and a timeout of 2 and let the timeout-unit be the default. Note that you can use tab completion while writing that command. On running that command, you'll see the following output:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [standalone@localhost:9999 /] /subsystem=ejb3/strict-max-bean-instance-pool=take2:add(max-pool-size=15,timeout=2)  &lt;br /&gt; {"outcome" =&amp;gt; "success"}  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;The standalone-preview.xml will now look like:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; &amp;lt;pools&amp;gt;  &lt;br /&gt;      &amp;lt;bean-instance-pools&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="new-pool"/&amp;gt;  &lt;br /&gt;           &amp;lt;strict-max-pool name="take2" max-pool-size="15" instance-acquisition-timeout="2"/&amp;gt;  &lt;br /&gt;      &amp;lt;/bean-instance-pools&amp;gt;  &lt;br /&gt; &amp;lt;/pools&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Notice the "take2" pool which has the max-pool-size and instance-acquisition-timeout values set to whatever we specified on the CLI.&lt;br /&gt;&lt;br /&gt;So that's how you create a new bean instance pool from the CLI.&lt;br /&gt;&lt;h4&gt;Setting/changing the default bean instance pool used by the MDBs and the SLSBs&lt;/h4&gt;In the previous section we saw how to create a new bean instance pool. Now if we want this new pool to be our default pool configuration for MDBs and/or SLSBs, then we can use the CLI to do that. &lt;br /&gt;&lt;br /&gt;Let's first see how it's done for MDBs:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [standalone@localhost:9999 /] /subsystem=ejb3:write-attribute(name=default-mdb-instance-pool, value=take2)  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;So we are issuing a "write-attribute" operation on the /subsystem=ejb3 address to write the attribute named "default-mdb-instance-pool" with a value "take2". Effectively, this command is going to change the default MDB bean instance pool from "mdb-strict-max-pool" (remember, we saw this in the standalone-preview.xml earlier, in the bean-instance-pool-ref section of the MDB) to the "take2" pool that we create a few steps back. Running this command will show you the following output&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [standalone@localhost:9999 /] /subsystem=ejb3:write-attribute(name=default-mdb-instance-pool, value=take2)  &lt;br /&gt; {"outcome" =&amp;gt; "success"}  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;If you open the standalone-preview.xml in a text editor, you'll now notice that the changes have been done - the MDB configuration now uses "take2" as the default pool configuration for all MDBs (henceforth).&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; &amp;lt;mdb&amp;gt;  &lt;br /&gt;      &amp;lt;resource-adapter-ref resource-adapter-name="hornetq-ra"/&amp;gt;  &lt;br /&gt;      &amp;lt;bean-instance-pool-ref pool-name="take2"/&amp;gt;  &lt;br /&gt; &amp;lt;/mdb&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;We can do the same for Stateless session bean configuration too. The command is:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; [standalone@localhost:9999 /] /subsystem=ejb3:write-attribute(name=default-slsb-instance-pool, value=new-pool)  &lt;br /&gt; {"outcome" =&amp;gt; "success"}  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;Here we set the default-slsb-instance-pool to the "new-pool" that we created earlier. The standalone-preview.xml file will now look like:&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; &amp;lt;session-bean&amp;gt;  &lt;br /&gt;      &amp;lt;stateless&amp;gt;  &lt;br /&gt;           &amp;lt;bean-instance-pool-ref pool-name="new-pool"/&amp;gt;  &lt;br /&gt;      &amp;lt;/stateless&amp;gt;  &lt;br /&gt; &amp;lt;/session-bean&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;So that's it! We have now used the CLI to configure/manage our EJB3 pools.&lt;br /&gt;&lt;h4&gt;Disabling pooling for MDBs and Stateless Session Beans&lt;/h4&gt;We also allow pooling to be disabled for MDBs and SLSBs. However, it's not always recommended since it can have performance impacts. If as a developer, you know that your beans aren't too heavy during construction (i.e. nothing in constructor and nothing in @PostConstruct), then it sometimes help to disable pooling for the beans. Currently the only way to do this, is by removing the &amp;lt;bean-instance-pool-ref&amp;gt; element from the &amp;lt;mdb&amp;gt; and/or &amp;lt;stateless&amp;gt; elements in the EJB3 subsystem configuration. We don't currently have a way to do this via the CLI nor do we have a way to specify this at per deployment or per bean level. &lt;br /&gt;&lt;br /&gt;So, if you know disabling the pooling benefits you, then that's how you can disable it.&lt;br /&gt;&lt;h4&gt;Summary&lt;/h4&gt;I hadn't thought that this blog would get this lengthy. But since most of this is new in AS7, it was worth writing this up. So, in this blog we saw how and where the EJB3 bean instance pools are configured, how to create new bean instance pools, how to change the default bean instance pools for MDBs and Stateless session beans. We also saw how all of this can be done using the CLI in AS7.&lt;br /&gt;&lt;br /&gt;I plan to write some more blog posts in the upcoming days, to explain some other features of AS7 and/or EJB3 in AS7. If you have any questions or run into issues, please visit us in our user forums.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;[&lt;a href="http://www.jboss.org/as7"&gt;AS7 Home&lt;/a&gt;] [&lt;a href="https://issues.jboss.org/browse/AS7"&gt;AS7 JIRA&lt;/a&gt;] [&lt;a href="http://community.jboss.org/community/jbossas/as7_users?view=discussions"&gt;AS7 User Forum&lt;/a&gt;] [&lt;a href="https://docs.jboss.org/author/display/AS7/Documentation"&gt;AS7 documentation&lt;/a&gt;] [&lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;AS7 downloads&lt;/a&gt;] [&lt;a href="http://community.jboss.org/thread/167590"&gt;AS7 nightly builds&lt;/a&gt;]&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-8503276163821026902?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/8503276163821026902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=8503276163821026902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/8503276163821026902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/8503276163821026902'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/08/jboss-as-701-configuring-ejb3-pools.html' title='JBoss AS 7.0.1 - Configuring EJB3 Pools'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-2304837237761969695</id><published>2011-08-18T16:55:00.002+05:30</published><updated>2011-08-18T19:26:24.557+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas7'/><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='as7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss_application_server7'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 7.0.1 released!</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-n41wI0rJ2nU/Tkz95adn05I/AAAAAAAAABo/FbpAF3wPI5I/s1600/AS7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-n41wI0rJ2nU/Tkz95adn05I/AAAAAAAAABo/FbpAF3wPI5I/s1600/AS7.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JBoss AS 7.0.1 "Zap" has been &lt;a href="http://www.jboss.org/jbossas/downloads/"&gt;released&lt;/a&gt; today. It's been one month since AS 7.0.0 was released, so this new release has come in quick time. This new release includes a lot of &lt;a href="https://issues.jboss.org/secure/ReleaseNote.jspa?projectId=12311211&amp;amp;version=12317200"&gt;bug fixes&lt;/a&gt; (135 issues in total) that have been mainly reported in the community. Apart from the bug fixes the major features/additions to 7.0.1 are as follows:&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;* Better JPA integration and plug-ability&lt;/h3&gt;&lt;br /&gt;As many of you might already know, AS 7.0.0 came bundled with Hibernate 4 version. Users could still package Hibernate 3 within their application and use it. But many users reported issues with Hibernate 3 bundled within their application. Moreover, 7.0.0 did not have a way to allow other JPA implementations (like EclipseLink) to be integrated. As such, major changes were implemented in 7.0.1 to introduce better JPA plug-ability. The &lt;a href="https://docs.jboss.org/author/display/AS7/JPA+Reference+Guide"&gt;JPA reference guide for AS7&lt;/a&gt; is good place to look at the details.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;* MDB support&lt;/h3&gt;&lt;br /&gt;AS 7.0.0 had 2 distributions. One, a purely "web-profile" certified distribution which included EJB3.1 "Lite" support (as mandated by webprofile spec). The other distribution (named "everything") had some more features in addition to "web-profile". EJB3.1 "Lite" doesn't include MDB support. So in AS 7.0.0 we didn't have MDB support. Many users in the forums asked for MDB support to be included in the near future. We decided that it would be good to include it in 7.0.1 and as such, we now support MDBs in the "everything" distribution of 7.0.1. We have had some very &lt;a href="http://community.jboss.org/thread/170141"&gt;good community feedback&lt;/a&gt;, on the MDB support, while the development was in progress. So thanks to that feedback, we were able to fix some issues with MDB integration, right in time for the 7.0.1.&lt;br /&gt;&lt;br /&gt;So try out the MDB support available in the "everything" distribution of AS 7.0.1 and &lt;a href="http://community.jboss.org/en/jbossas/as7_users?view=discussions"&gt;let us know how it goes&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;* EJB3 pool configurations&lt;/h3&gt;&lt;br /&gt;AS 7.0.0 had hardcoded pool configurations for Stateless session beans. There wasn't a way to configure the pool for the beans. In AS 7.0.1 we have introduced a way to configure pools for Stateless session beans and MDBs. We also allow disabling pools for both Stateless session beans and MDBs. Disabling pools benefits in some cases where the bean construction isn't heavy (like not much in @PostConstruct etc...). I'll blog more about the EJB3 pool configurations in a separate post.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;* Ability to bundle application specific JSF version&lt;/h3&gt;&lt;br /&gt;Users can now bundle their own version of JSF in their applications.&lt;br /&gt;&lt;br /&gt;7.0.1 (and AS7 in general) has had a huge community feeback and contribution. A lot of the issues that have been fixed, have been raised by our community members. A big thanks to them for helping us all along, towards AS7 efforts!&lt;br /&gt;&lt;br /&gt;As always, give the new release a &lt;a href="http://www.jboss.org/jbossas/downloads/"&gt;try&lt;/a&gt; and let us know how it goes. We are always looking for inputs to make AS7 better. Report any issues or ask for help in our &lt;a href="http://community.jboss.org/en/jbossas/as7_users?view=discussions"&gt;user forum&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;I plan to write some more posts around 7.0.1 in the coming days. Also, keep a watch on other blogs from JBoss AS developers and community members around AS7.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;[&lt;a href="http://www.jboss.org/as7"&gt;AS7 Home&lt;/a&gt;] [&lt;a href="https://issues.jboss.org/browse/AS7"&gt;AS7 JIRA&lt;/a&gt;] [&lt;a href="http://community.jboss.org/community/jbossas/as7_users?view=discussions"&gt;AS7 User Forum&lt;/a&gt;] [&lt;a href="https://docs.jboss.org/author/display/AS7/Documentation"&gt;AS7 documentation&lt;/a&gt;] [&lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;AS7 downloads&lt;/a&gt;] [&lt;a href="http://community.jboss.org/thread/167590"&gt;AS7 nightly builds&lt;/a&gt;]&lt;/div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-2304837237761969695?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/2304837237761969695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=2304837237761969695' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2304837237761969695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2304837237761969695'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/08/jboss-as-701-released.html' title='JBoss AS 7.0.1 released!'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-n41wI0rJ2nU/Tkz95adn05I/AAAAAAAAABo/FbpAF3wPI5I/s72-c/AS7.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-6567336099422328263</id><published>2011-06-22T16:16:00.006+05:30</published><updated>2011-06-22T16:46:47.836+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas7'/><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='jboss_application_server7'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Upcoming JBoss AS7 webinars - highly recommended</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;JBoss AS7 has almost arrived! For those of you who haven't been following the latest news about JBoss AS7, here's a quick overview &lt;a href="http://www.dzone.com/links/jboss_as7_is_coming.html"&gt;http://www.dzone.com/links/jboss_as7_is_coming.html&lt;/a&gt;. JBoss AS 7.0 CR1 will be released sometime this week and then the Final version will be released within a couple of weeks after that.&lt;br /&gt;&lt;br /&gt;AS7 is drastically different from the previous versions of JBoss AS, even when it comes to the directory layout and how deployments are managed. Furthermore, it now has inbuilt support for managing multiple servers as a "domain". Developing against AS7 is vastly more productive than the previous versions, since AS7 now boots in just around 3 seconds. There are lots of other features and changes, like a new feature-rich admin console, a lightweight command line client and much muhc more.&lt;br /&gt;&lt;br /&gt;Naturally, with these many changes and the nature of these changes, it becomes important that we demonstrate these new features and explain each of them to our users. As such, we have arranged for Webinars around JBoss AS7 in the coming week (&lt;b&gt;June 29 2011 to July 1 2011&lt;/b&gt;). &lt;br /&gt;&lt;br /&gt;&lt;b&gt;For any JBoss AS user or enthusiast, I would strongly recommend that you register for these webinars and see what's new in AS7.&lt;/b&gt; Registration is simple and just requires a email address, to which the demo/live meeting details will be mailed. To find more details about the Webinars, take a look at &lt;a href="http://www.jboss.org/webinars"&gt;http://www.jboss.org/webinars&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Complete details of available webinars :&lt;/b&gt; &lt;a href="http://www.jboss.org/webinars"&gt;http://www.jboss.org/webinars&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JBoss AS7 - Next generation EE6 programming : &lt;/b&gt;&lt;a href="https://jboss.webex.com/mw0306ld/mywebex/default.do?nomenu=true&amp;amp;siteurl=jboss&amp;amp;service=6&amp;amp;rnd=0.34449920541623236&amp;amp;main_url=https%3A%2F%2Fjboss.webex.com%2Fec0605ld%2Feventcenter%2Fevent%2FeventAction.do%3FtheAction%3Ddetail%26confViewID%3D784779512%26siteurl%3Djboss%26%26%26"&gt;Register here&lt;/a&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JBoss AS7 - Management &amp;amp; Clustering :&lt;/b&gt;&lt;b&gt; &lt;/b&gt;&lt;a href="https://jboss.webex.com/mw0306ld/mywebex/default.do?nomenu=true&amp;amp;siteurl=jboss&amp;amp;service=6&amp;amp;rnd=0.5592446631270972&amp;amp;main_url=https%3A%2F%2Fjboss.webex.com%2Fec0605ld%2Feventcenter%2Fevent%2FeventAction.do%3FtheAction%3Ddetail%26confViewID%3D784779564%26siteurl%3Djboss%26%26%26"&gt;Register here&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt; &lt;br /&gt;Furthermore, if you are in Asia, there's a Asia timezone friendly timing of the Webinars:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JBoss AS7 - Next generation EE6 programming (Asia timezone) :&lt;/b&gt; &lt;a href="https://jboss.webex.com/ec0605ld/eventcenter/enroll/join.do?confViewID=784779542&amp;amp;confId=784779542&amp;amp;siteurl=jboss&amp;amp;path=program_detail&amp;amp;theAction=detail"&gt;Register here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JBoss AS7 - Management &amp;amp; Clustering (Asia timezone):&lt;/b&gt; &lt;a href="https://jboss.webex.com/ec0605ld/eventcenter/enroll/join.do?confViewID=784779568&amp;amp;confId=784779568&amp;amp;siteurl=jboss&amp;amp;path=program_detail&amp;amp;theAction=detail"&gt;Register here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-6567336099422328263?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/6567336099422328263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=6567336099422328263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/6567336099422328263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/6567336099422328263'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/06/upcoming-jboss-as7-webinars-highly.html' title='Upcoming JBoss AS7 webinars - highly recommended'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-8043859783417857539</id><published>2011-04-10T19:08:00.001+05:30</published><updated>2011-04-10T19:18:58.035+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss Community Recognition Awards 2011 - Winners announced</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In my previous &lt;a href="http://jaitechwriteups.blogspot.com/2011/02/jboss-community-recognition-awards-2011.html"&gt;post&lt;/a&gt; I blogged about the JBoss Community Recognition Awards 2011, for which voting was in progress. Thanks to all those who participated in the voting process. The winners have now been &lt;a href="http://www.jboss.org/jbcra/winners.html"&gt;announced&lt;/a&gt;. Congratulations to all the winners! :)&amp;nbsp; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-8043859783417857539?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/8043859783417857539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=8043859783417857539' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/8043859783417857539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/8043859783417857539'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/04/jboss-community-recognition-awards-2011.html' title='JBoss Community Recognition Awards 2011 - Winners announced'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-9165041349892542286</id><published>2011-02-28T16:11:00.000+05:30</published><updated>2011-02-28T16:11:33.413+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss Community Recognition Awards 2011 - voting in progress</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Like the previous year, this year too the polls for various categories under JBoss Community Recognition Awards for 2011 have begun. The awards have been categorized into 5 categories. You can vote for the nominees in each of the following categories:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://community.jboss.org/polls/1066"&gt;Poll : New Features category&lt;/a&gt;&lt;br /&gt;&lt;a href="http://community.jboss.org/polls/1067"&gt;Poll : Bug fixes category&lt;/a&gt;&lt;br /&gt;&lt;a href="http://community.jboss.org/polls/1068"&gt;Poll : Issue/JIRA category&lt;/a&gt;&lt;br /&gt;&lt;a href="http://community.jboss.org/polls/1069"&gt;Poll : Wiki category&lt;/a&gt;&lt;br /&gt;&lt;a href="http://community.jboss.org/polls/1070"&gt;Poll : Documentation category&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So go ahead and cast your vote! This is one way of thanking the community members for the help/support they have been providing. For more about JBoss Community Recognition Awards (JBCRA) read this &lt;a href="http://www.jboss.org/jbcra"&gt;http://www.jboss.org/jbcra&lt;/a&gt; and to read more about the nominees see this &lt;a href="http://www.jboss.org/jbcra/nominees.html"&gt;http://www.jboss.org/jbcra/nominees.html&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-9165041349892542286?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/9165041349892542286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=9165041349892542286' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/9165041349892542286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/9165041349892542286'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/02/jboss-community-recognition-awards-2011.html' title='JBoss Community Recognition Awards 2011 - voting in progress'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7472795069478534744</id><published>2011-02-09T14:13:00.000+05:30</published><updated>2011-02-09T14:13:49.352+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee6'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><title type='text'>@Resource and the new lookup attribute - How to avoid compilation and runtime problems</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;More and more users have started moving to Java EE6 functionality and one of the common question that keeps coming up in the forums these days is about the use of the "lookup" attribute of the @Resource annotation. Java EE6 introduced this new attribute to the @javax.annotation.Resource annotation (&lt;a href="http://download.oracle.com/javaee/6/api/javax/annotation/Resource.html#lookup%28%29"&gt;javadoc&lt;/a&gt;). In the previous version, this attribute wasn't available. So now users can start using this attribute as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;package org.myapp;&lt;br /&gt;&lt;br /&gt;import javax.annotation.Resource;&lt;br /&gt;import javax.ejb.Stateless;&lt;br /&gt;import javax.sql.DataSource;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;* Author: Jaikiran Pai&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;@Stateless&lt;br /&gt;public class SimpleSLSB&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; @Resource(lookup = "test")&lt;br /&gt;&amp;nbsp;&amp;nbsp; private DataSource dataSource;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; public void doNothing()&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // nothing!&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Simple enough! However, the problem arises when you try to compile this code or even run it. Compiling this code with JDK 1.6 leads to this compile time error:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;[ERROR] /NotBackedUp/jpai/business/me/resource-lookup/src/main/java/org/myapp/SimpleSLSB.java:[36,13] cannot find symbol&lt;br /&gt;[ERROR] symbol&amp;nbsp; : method lookup()&lt;br /&gt;[ERROR] location: @interface javax.annotation.Resource&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The root cause of this issue is that the standalone JDK itself ships its own version of @javax.annotation.Resource which doesn't have this lookup attribute (&lt;a href="http://download.oracle.com/javase/6/docs/api/javax/annotation/Resource.html"&gt;javadoc&lt;/a&gt;). The compiler ends up using the version shipped in the JDK.&lt;br /&gt;&lt;br /&gt;So how do we get past this problem. The solution is simple - all you have to do is set the -Djava.endorsed.dirs system property to point to the folder containing the jar which has the new @javax.annotation.Resource annotation. The -Djava.endorsed.dirs needs to be set while compiling the program as well as while running the program. Depending on what tool you use to compile the program, there are different ways to set this system property. Let's see how we handle this in a Maven project.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Building through Maven:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt; is a build tool which is used in many project these days. Maven uses a build file named pom.xml which can be used to setup the dependencies of the project as well as other build related configurations. I'll assume that those of you who are using Maven, already know all these details and just want to see how to get the @Resource(lookup="") working within a Maven project. So here it is:&lt;br /&gt;&lt;br /&gt;1) Use the maven-dependency-plugin to "copy" the jar containing the new javax.annotation.* classes into some folder within your project. In this example, I'm copying it over to a folder named "endorsed" within the project's build directory:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:xml"&gt;&amp;nbsp;&amp;nbsp; &amp;lt;build&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugins&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-dependency-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;executions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;execution&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;goals&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;goal&amp;gt;copy&amp;lt;/goal&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/goals&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Configure the plugin to copy the jar containing javax.annotation.*&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to a folder named "endorsed" within the project's build directory --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactItems&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactItem&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.jboss.spec.javax.annotation&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;jboss-annotations-api_1.1_spec&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/artifactItem&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/artifactItems&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;outputDirectory&amp;gt;${project.build.directory}/endorsed&amp;lt;/outputDirectory&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/execution&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/executions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) Now let's instruct the compiler plugin and the surefire plugin (which runs your unit tests) to use the jar from the project's endorsed folder. As I said eariler, we just need to set the -Djava.endorsed.dirs property to make this happen. So here's how we do it for these 2 plugins:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:xml"&gt;...&lt;br /&gt;&amp;lt;!-- Setup the compiler plugin to use the endorsed directory containing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; our javax.annotation.* classes --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;2.3.2&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;source&amp;gt;1.6&amp;lt;/source&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;target&amp;gt;1.6&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Setup the compiler plugin to use the endorsed directory containing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the jar for javax.annotation.* classes. Remember that we setup this folder&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; via the maven-dependency-plugin configuration, above. --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;compilerArgument&amp;gt;-Djava.endorsed.dirs=${project.build.directory}/endorsed&amp;lt;/compilerArgument&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Setup surefire plugin to use the endoresed directory containing our javax.annotation.* classes --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-surefire-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;2.5&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Setup the surefire plugin to use the endorsed directory containing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the jar for javax.annotation.* classes. Remember that we setup this folder&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; via the maven-dependency-plugin configuration, above. --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;argLine&amp;gt;-Djava.endorsed.dirs=${project.build.directory}/endorsed&amp;lt;/argLine&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugins&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/build&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's it! We now have setup our project to use the correct endorsed jars. Here's the complete pom.xml for this sample project:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:xml"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;project xmlns="http://maven.apache.org/POM/4.0.0"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;jaikiran&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;resource-lookup&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;build&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugins&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-dependency-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;executions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;execution&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;goals&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;goal&amp;gt;copy&amp;lt;/goal&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/goals&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Configure the plugin to copy the jar containing javax.annotation.*&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to a folder named "endorsed" within the project's build directory --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactItems&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactItem&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.jboss.spec.javax.annotation&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;jboss-annotations-api_1.1_spec&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/artifactItem&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/artifactItems&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;outputDirectory&amp;gt;${project.build.directory}/endorsed&amp;lt;/outputDirectory&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/execution&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/executions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Setup the compiler plugin to use the endorsed directory containing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; our javax.annotation.* classes --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-compiler-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;2.3.2&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;source&amp;gt;1.6&amp;lt;/source&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;target&amp;gt;1.6&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Setup the compiler plugin to use the endorsed directory containing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the jar for javax.annotation.* classes. Remember that we setup this folder&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; via the maven-dependency-plugin configuration, above. --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;compilerArgument&amp;gt;-Djava.endorsed.dirs=${project.build.directory}/endorsed&amp;lt;/compilerArgument&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Setup surefire plugin to use the endoresed directory containing our javax.annotation.* classes --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-surefire-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;2.5&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Setup the surefire plugin to use the endorsed directory containing&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the jar for javax.annotation.* classes. Remember that we setup this folder&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; via the maven-dependency-plugin configuration, above. --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;argLine&amp;gt;-Djava.endorsed.dirs=${project.build.directory}/endorsed&amp;lt;/argLine&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/plugins&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/build&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependencies&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- EJB API dependency --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.jboss.spec.javax.ejb&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;jboss-ejb-api_3.1_spec&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;1.0.0.Final&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependency&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- javax.annotation.* dependency --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.jboss.spec.javax.annotation&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;jboss-annotations-api_1.1_spec&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;1.0.0.Final&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/dependencies&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Running "mvn clean install" will now show a build success:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:plain"&gt;[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ resource-lookup ---&lt;br /&gt;[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!&lt;br /&gt;[INFO] Compiling 1 source file to /NotBackedUp/jpai/business/me/resource-lookup/target/classes&lt;br /&gt;[INFO] &lt;br /&gt;[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ resource-lookup ---&lt;br /&gt;[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!&lt;br /&gt;[INFO] skip non existing resourceDirectory /NotBackedUp/jpai/business/me/resource-lookup/src/test/resources&lt;br /&gt;[INFO] &lt;br /&gt;[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ resource-lookup ---&lt;br /&gt;[INFO] Nothing to compile - all classes are up to date&lt;br /&gt;[INFO] &lt;br /&gt;[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ resource-lookup ---&lt;br /&gt;[INFO] No tests to run.&lt;br /&gt;[INFO] &lt;br /&gt;...&lt;br /&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;[INFO] BUILD SUCCESS&lt;br /&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;[INFO] Total time: 6.087s&lt;br /&gt;[INFO] Finished at: Wed Feb 09 13:02:02 IST 2011&lt;br /&gt;[INFO] Final Memory: 9M/129M&lt;br /&gt;[INFO] ------------------------------------------------------------------------&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Although it did not involve much to set this up in Maven, it did however require setting it up with the use of 3 separate plugins. It would have been far more easier if there was a way in Maven where we could just add a "dependency" to the endorsed dir and let all the relevant plugins use it without the developer having to configure each of those separately. But anyway, we got what we were after - a successful compilation of that class using @Resource(lookup="").&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7472795069478534744?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7472795069478534744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7472795069478534744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7472795069478534744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7472795069478534744'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2011/02/resource-and-new-lookup-attribute-how.html' title='@Resource and the new lookup attribute - How to avoid compilation and runtime problems'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-4130922178744946454</id><published>2010-12-28T22:06:00.000+05:30</published><updated>2010-12-28T22:18:33.769+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb31'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 6.0 Final released</title><content type='html'>JBoss AS 6.0.0.Final has just been &lt;a href="http://lists.jboss.org/pipermail/jboss-development/2010-December/016782.html" target="blank"&gt;released&lt;/a&gt;. The release notes are &lt;a href="http://community.jboss.org/wiki/AS600FinalReleaseNotes" target="blank"&gt;here&lt;/a&gt; and the download is available from the JBoss AS download page &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I'll blog more about this in the days to come. For now, to summarize what's new in 6.0.0 Final - there have been numerous bug fixes for issues reported by the community. Furthermore from a EJB3.1 point of view, we now have &lt;a href="http://community.jboss.org/message/576375#576375" target="blank"&gt;EJB3.1 Embedded support&lt;/a&gt; and a far better support for EJB3.1 @Asynchronous functionality.&lt;br /&gt;&lt;br /&gt;As usual, give it a try and feel free to ask any questions or report any issues, in our user forums:&lt;br /&gt;&lt;br /&gt;JBoss AS user forum: &lt;a href="http://community.jboss.org/en/jbossas?view=discussions"&gt;http://community.jboss.org/en/jbossas?view=discussions&lt;/a&gt;&lt;br /&gt;EJB3 user forum: &lt;a href="http://community.jboss.org/en/ejb3?view=discussions"&gt;http://community.jboss.org/en/ejb3?view=discussions&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-4130922178744946454?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/4130922178744946454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=4130922178744946454' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4130922178744946454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4130922178744946454'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/12/jboss-as-60-final-released.html' title='JBoss AS 6.0 Final released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-1171922864209085341</id><published>2010-11-29T15:48:00.000+05:30</published><updated>2010-11-29T15:54:16.909+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb3.1'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 6.0 CR1 released</title><content type='html'>JBoss AS 6.0 CR1 was released last week and I'm bit late on writing this blog :) I'll briefly summarize what 6.0 CR1 contains, mainly from EJB3.1 point of view. &lt;br /&gt;&lt;br /&gt;Like I mentioned in my &lt;a href="http://jaitechwriteups.blogspot.com/2010/10/ejb31-global-jndi-access-portable-jndi.html" target="blank"&gt;previous blog entry&lt;/a&gt;, this latest release of AS now has support for EJB3.1 spec mandated JNDI naming scheme for EJBs. It also contains various bug fixes in JBoss EJB3 implementation that were reported by the community in the previous versions of JBoss AS. We are now left with just a couple of EJB3.1 features - support for EJB3.1 Embedded and a full fledged support for EJB3.1 @Asynchronous invocations. These 2 features will make it to 6.0 Final version of JBoss AS, which is &lt;a href="http://lists.jboss.org/pipermail/jboss-development/2010-September/016606.html" target="blank"&gt;planned during December 2010&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Apart from EJB3.1, the other set of new features and bug fixes in 6.0 CR1 have been listed &lt;a href="http://community.jboss.org/docs/DOC-16139" target="blank"&gt;here&lt;/a&gt;. Shelly has blogged about this release and the upcoming 6.0 Final release &lt;a href="http://community.jboss.org/blogs/donnamishelly/2010/11/24/jboss-as-600cr1-released" target="blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So go &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="blank"&gt;download&lt;/a&gt; the latest release and give it a try. As usual, feel free to report any issues (so that they get fixed in 6.0 Final) in our user forums. Some useful links are provided below:&lt;br /&gt;&lt;br /&gt;JBoss AS Download page : &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="blank"&gt;http://www.jboss.org/jbossas/downloads.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;JBoss AS user forum : &lt;a href="http://community.jboss.org/en/jbossas?view=discussions" target="blank"&gt;http://community.jboss.org/en/jbossas?view=discussions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;JBoss EJB3 user forum : &lt;a href="http://community.jboss.org/en/ejb3?view=discussions" target="blank"&gt;http://community.jboss.org/en/ejb3?view=discussions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;JBoss AS JIRA (bug tracking system) : &lt;a href="https://jira.jboss.org/browse/JBAS" target="blank"&gt;https://jira.jboss.org/browse/JBAS&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-1171922864209085341?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/1171922864209085341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=1171922864209085341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/1171922864209085341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/1171922864209085341'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/11/jboss-as-60-cr1-released.html' title='JBoss AS 6.0 CR1 released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-4775521222756012478</id><published>2010-10-10T12:50:00.000+05:30</published><updated>2010-10-10T13:15:10.269+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb31'/><category scheme='http://www.blogger.com/atom/ns#' term='jndi'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>EJB3.1 Global JNDI Access - A portable jndi naming scheme for EJBs</title><content type='html'>Many of you, who have been using EJBs would know that one of the pain points, with respect to portability, is the JNDI names of the beans. As you all will be aware, prior to EJB3.1 spec, there wasn't a standard portable JNDI naming scheme for EJBs. Each application server had its own JNDI naming scheme, which would often mean that you either had to include a server specific deployment descriptor (jboss.xml for JBoss AS) or use annotations to override the JNDI names (for EJB3.0). So while migrating our project to some other application server, you almost always would end up with NameNotFoundException, if you forgot to configure/change the JNDI names to match the application server you are deploying to.&lt;br /&gt;&lt;br /&gt;However, starting EJB3.1, the spec now mandates portable JNDI names for EJBs. The compliant application servers are now expected to bind the EJBs at some pre-defined portable JNDI names. Effectively, when you deploy the same EJB jar into a different compliant application server, you will no longer have to change/configure the JNDI names, if you use the portable JNDI names during lookup.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Syntax of portable JNDI names:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The EJB3.1 spec (section 4.4 "Global JNDI Access") explains the syntax of the portable JNDI names. It's actually more than a couple of lines, with examples. So quoting that section here would be a waste of space. Its better to just &lt;a href="http://jcp.org/aboutJava/communityprocess/final/jsr318/index.html" target="blank"&gt;download the spec&lt;/a&gt; and read through it. But I'll just show some examples of the portable JNDI names, in the next section.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example of the new JNDI naming scheme:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let's assume you have the following Stateless EJB:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;package org.myapp.ejb.impl;&lt;br /&gt;&lt;br /&gt;@Stateless&lt;br /&gt;@Remote(Echo.class)&lt;br /&gt;@LocalBean&lt;br /&gt;public class SimpleSLSB implements Echo&lt;br /&gt;{&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The SimpleSLSB exposes a remote business interface view and also (explicitly) marks the bean for the no-interface view. So this bean now has 2 views - the remote business interface view and the no-interface view. &lt;br /&gt;&lt;br /&gt;Let's further assume that we are packaging this bean in a simple .jar file and deploying it to the application server. Let's name the jar file myejb3.jar. &lt;br /&gt;&lt;br /&gt;As per the EJB3.1 spec, global jndi naming scheme, this bean will now be available at (all of the) following JNDI names:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;java:global/myejb3/SimpleSLSB!org.myapp.ejb.impl.Echo&lt;br /&gt;java:global/myejb3/SimpleSLSB!org.myapp.ejb.impl.SimpleSLSB&lt;br /&gt;java:app/myejb3/SimpleSLSB!org.myapp.ejb.impl.Echo&lt;br /&gt;java:app/myejb3/SimpleSLSB!org.myapp.ejb.impl.SimpleSLSB&lt;br /&gt;java:module/SimpleSLSB!org.myapp.ejb.impl.Echo&lt;br /&gt;java:module/SimpleSLSB!org.myapp.ejb.impl.SimpleSLSB&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#1 above exposes the remote business interface view in the java:global namespace and #2 exposes the no-interface view (remember, we explicitly marked our bean as @LocalBean) in the java:global namespace. As can be seen, the JNDI name is composed of a namespace (for example java:global), a app/module name (for example myejb3), the bean name, which by default is the unqualified name of the bean implementation class (for example SimpleSLSB) and finally the fully qualified name of the business interface being exposed (for example, org.myapp.ejb.impl.Echo). In case of no-interface view, the final part of the JNDI name is the fully qualified name of the bean implementation class.&lt;br /&gt;&lt;br /&gt;The rest of the JNDI names follow the same naming scheme, except that they are available in a different JNDI namespace. More details can be found in the EJB3.1 spec (section 4.4 "Global JNDI Access").&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Support for EJB3.1 global JNDI names in JBoss AS:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The current JBoss AS trunk supports this new JNDI naming scheme. So the &lt;a href="http://lists.jboss.org/pipermail/jboss-development/2010-September/016606.html" target="blank"&gt;upcoming JBoss AS 6.0.0.CR1 release&lt;/a&gt; will have support for this feature. However, if you want to try it out before JBoss AS 6.0.0.CR1 is released, then you can download the nightly build of JBoss AS from &lt;a href="https://hudson.jboss.org/hudson/view/JBoss%20AS/job/JBoss-AS-6.0.x/lastSuccessfulBuild/artifact/JBossAS_6_0/build/target/jboss-6.0.x.zip" target="blank"&gt;here&lt;/a&gt; and give it a try.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Reporting issues:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you have any questions or run into issue while testing this, then feel free to bring it up in our &lt;a href="http://community.jboss.org/community/ejb3" target="blank"&gt;EJB3 user forum&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-4775521222756012478?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/4775521222756012478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=4775521222756012478' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4775521222756012478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4775521222756012478'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/10/ejb31-global-jndi-access-portable-jndi.html' title='EJB3.1 Global JNDI Access - A portable jndi naming scheme for EJBs'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-2899623095298136889</id><published>2010-09-25T20:56:00.000+05:30</published><updated>2010-09-25T21:07:36.907+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb31'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='timerservice'/><title type='text'>JBoss AS 6.0.0.M5 released</title><content type='html'>JBoss AS 6.0.0.M5 has just been &lt;a href="http://community.jboss.org/blogs/donnamishelly/2010/09/24/jboss-as-600m5-released" target="blank"&gt;released&lt;/a&gt;. This is mainly a bug fix release, in preparation for the &lt;a href="http://lists.jboss.org/pipermail/jboss-development/2010-September/016606.html" target="blank"&gt;upcoming&lt;/a&gt; 6.0.0.CR1 release. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What are the JBoss EJB3 changes in JBoss AS 6.0.0.M5:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There have been many user reported and other EJB3.x bug fixes that have been included JBoss AS 6.0.0.M5. Other than the bug fixes, there has been one important change to the way we deploy (our internal) JBoss EJB3.x timerservice. This change involves deploying (our internal) timerservice implementation "lazily". The timerservice is deployed only when the server has any EJB3.x deployments. The change was done to improve the JBoss AS boot time. The complete details of the change can be found &lt;a href="http://community.jboss.org/wiki/LazyEJB31timerservicedeploymentstartingJBossAS600M5" target="blank"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Download:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So as always, go download the server from &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="blank"&gt;here&lt;/a&gt; and give it a try! Any issues/questions can always be asked in our user forum &lt;a href="http://community.jboss.org/community/jbossas?view=discussions" target="blank"&gt;here&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Release Notes:&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;You can find the release notes of JBoss AS 6.0.0.M5 &lt;a href="http://community.jboss.org/docs/DOC-15879" target="blank"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;JBoss AS6 FAQ:&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;JBoss AS6 specific FAQ can be found &lt;a href="http://community.jboss.org/docs/DOC-15857" target="blank"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-2899623095298136889?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/2899623095298136889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=2899623095298136889' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2899623095298136889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2899623095298136889'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/09/jboss-as-600m5-released.html' title='JBoss AS 6.0.0.M5 released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-6250947136223201254</id><published>2010-08-22T14:03:00.000+05:30</published><updated>2010-08-22T14:39:50.223+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL installation error - Neither host nor 'localhost' could be looked up</title><content type='html'>While trying to install MySQL 5.1 on my Ubuntu system recently, I ran into an annoying error. I call it annoying because the error message turned out to be a bit misleading. I'll first mention the steps that I followed to install MySQL and the error that I ran into and finally the "fix" to get past the error.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;System details:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;- Ubuntu 10.04 Operating System&lt;br /&gt;  &lt;br /&gt;- MySQL 5.1.x downloaded from the official site here &lt;a href="http://dev.mysql.com/downloads/mysql/"&gt;http://dev.mysql.com/downloads/mysql/&lt;/a&gt; and selected the "Compressed TAR Archive" (mysql-5.1.50-linux-i686-glibc23.tar.gz to be precise) under the "Linux - Generic" platform&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Installation steps:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;- Extracted the .tar.gz locally to /home/jpai/MySQL/mysql-5.1.50-linux-i686-glibc23. In the rest of this article, I'll refer to this path as &lt;MYSQL_HOME&gt;&lt;br /&gt;&lt;br /&gt;- From the command prompt, "cd" to &lt;MYSQL_HOME&gt;&lt;br /&gt;&lt;br /&gt;(Some steps mentioned in the &lt;MYSQL_HOME&gt;/INSTALL-BINARY file are skipped in this article, since they aren't relevant here)&lt;br /&gt;&lt;br /&gt;- Run the scripts/mysql_install_db command from the command prompt:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;jpai@jpai-laptop:mysql-5.1.50-linux-i686-glibc23$ scripts/mysql_install_db &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Error:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Running that above command threw up the following error message:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;jpai@jpai-laptop:mysql-5.1.50-linux-i686-glibc23$ scripts/mysql_install_db &lt;br /&gt;Neither host 'jpai-laptop' nor 'localhost' could be looked up with&lt;br /&gt;/usr/bin/resolveip&lt;br /&gt;Please configure the 'hostname' command to return a correct&lt;br /&gt;hostname.&lt;br /&gt;If you want to solve this at a later stage, restart this script&lt;br /&gt;with the --force option&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That message looked strange because I was able to ping those hostnames and was sure that I had my hostname setup properly. So I decided to see why "usr/bin/resolveip" can't resolve those hostnames. So from the command prompt, I tried running the following command:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;jpai@jpai-laptop:~$ /usr/bin/resolveip --help&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This threw up an error:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;jpai@jpai-laptop:~$ /usr/bin/resolveip --help&lt;br /&gt;bash: /usr/bin/resolveip: No such file or directory&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So obviously, /usr/bin/resolveip command doesn't exist at all. So why was the MySQL installation trying to use this non-existent command? I then decided to take a look at the scripts/mysql_install_db script under &lt;MYSQL_HOME&gt;. The lines, in that script, from where this error is being thrown are as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;# Check if hostname is valid&lt;br /&gt;if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0&lt;br /&gt;then&lt;br /&gt;  resolved=`$extra_bindir/resolveip $hostname 2&gt;&amp;1`&lt;br /&gt;  if test $? -ne 0&lt;br /&gt;  then&lt;br /&gt;    resolved=`$extra_bindir/resolveip localhost 2&gt;&amp;1`&lt;br /&gt;    if test $? -ne 0&lt;br /&gt;    then&lt;br /&gt;      echo "Neither host '$hostname' nor 'localhost' could be looked up with"&lt;br /&gt;      echo "$extra_bindir/resolveip"&lt;br /&gt;      echo "Please configure the 'hostname' command to return a correct"&lt;br /&gt;      echo "hostname."&lt;br /&gt;      echo "If you want to solve this at a later stage, restart this script"&lt;br /&gt;      echo "with the --force option"&lt;br /&gt;      exit 1&lt;br /&gt;    fi&lt;br /&gt;    echo "WARNING: The host '$hostname' could not be looked up with resolveip."&lt;br /&gt;    echo "This probably means that your libc libraries are not 100 % compatible"&lt;br /&gt;    echo "with this binary MySQL version. The MySQL daemon, mysqld, should work"&lt;br /&gt;    echo "normally with the exception that host name resolving will not work."&lt;br /&gt;    echo "This means that you should use IP addresses instead of hostnames"&lt;br /&gt;    echo "when specifying MySQL privileges !"&lt;br /&gt;  fi&lt;br /&gt;fi&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The important part from those lines are:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;resolved=`$extra_bindir/resolveip $hostname 2&gt;&amp;1`&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and &lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;resolved=`$extra_bindir/resolveip localhost 2&gt;&amp;1`&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As can be seen the script tries to infer the location of "resolveip" command through the $extra_bindir variable. This variable gets set earlier in that script, based on various conditions. Some of the relevant lines are these:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;# Now we can get arguments from the groups [mysqld] and [mysql_install_db]&lt;br /&gt;# in the my.cfg file, then re-run to merge with command line arguments.&lt;br /&gt;parse_arguments `$print_defaults $defaults mysqld mysql_install_db`&lt;br /&gt;parse_arguments PICK-ARGS-FROM-ARGV "$@"&lt;br /&gt;&lt;br /&gt;# Configure paths to support files&lt;br /&gt;if test -n "$srcdir"&lt;br /&gt;then&lt;br /&gt;  basedir="$builddir"&lt;br /&gt;  bindir="$basedir/client"&lt;br /&gt;  extra_bindir="$basedir/extra"&lt;br /&gt;  mysqld="$basedir/sql/mysqld"&lt;br /&gt;  langdir="$srcdir/sql/share/english"&lt;br /&gt;  pkgdatadir="$srcdir/scripts"&lt;br /&gt;  scriptdir="$srcdir/scripts"&lt;br /&gt;elif test -n "$basedir"&lt;br /&gt;then&lt;br /&gt;  bindir="$basedir/bin"&lt;br /&gt;  extra_bindir="$bindir"&lt;br /&gt;  mysqld=`find_in_basedir mysqld libexec sbin bin`&lt;br /&gt;  if test -z "$mysqld"&lt;br /&gt;  then&lt;br /&gt;    cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin&lt;br /&gt;    exit 1&lt;br /&gt;  fi&lt;br /&gt;  langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english`&lt;br /&gt;  if test -z "$langdir"&lt;br /&gt;  then&lt;br /&gt;    cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english&lt;br /&gt;    exit 1&lt;br /&gt;  fi&lt;br /&gt;  pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`&lt;br /&gt;  if test -z "$pkgdatadir"&lt;br /&gt;  then&lt;br /&gt;    cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql&lt;br /&gt;    exit 1&lt;br /&gt;  fi&lt;br /&gt;  scriptdir="$basedir/scripts"&lt;br /&gt;else&lt;br /&gt;  basedir="."&lt;br /&gt;  bindir="./bin"&lt;br /&gt;  extra_bindir="$bindir"&lt;br /&gt;  mysqld="./bin/mysqld"&lt;br /&gt;  pkgdatadir="./share"&lt;br /&gt;  scriptdir="./bin"&lt;br /&gt;fi&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In short, those lines check for the presence of "default" values for some variables like "basedir" in MySQL configuration files (from earlier installations) under some known locations like /etc/my.cnf or the /etc/mysql. Incidentally, I had one such file /etc/mysql/my.cnf with one of the lines being:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;...&lt;br /&gt;basedir  = /usr&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So effectively, MySQL ended up picking up "basedir" as /usr and ultimately the following lines in the script:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;...&lt;br /&gt;  bindir="$basedir/bin"&lt;br /&gt;  extra_bindir="$bindir"&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;set extra_bindir to /usr/bin.&lt;br /&gt;&lt;br /&gt;Now that explained why the MySQL installation ending up using /usr/bin/resolveip while resolving the hostname:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;resolved=`$extra_bindir/resolveip $hostname 2&gt;&amp;1`&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For those who are just looking for a solution to get past this error, I'll just quickly explain what needs to be done. The scripts/mysql_install_db script allows for explicitly specifying the basedir to use during the installation. So the solution is to pass the &lt;MYSQL_HOME&gt; as the value of basedir from the command prompt while running that script. Here's how you do it:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;jpai@jpai-laptop:mysql-5.1.50-linux-i686-glibc23$ scripts/mysql_install_db --basedir=.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;(Remember that we are running this command from the &lt;MYSQL_HOME&gt;, so the relative path "." works fine for the basedir).&lt;br /&gt;&lt;br /&gt;By passing the value for basedir we have now made sure that MySQL picks up the "resolveip" command from the correct location, which is &lt;MYSQL_HOME&gt;/bin/resolveip. Yes, "resolveip" is indeed shipped as part of the MySQL download.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What's annoying about this error:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I earlier mentioned that I found this error annoying because of the misleading error message. As we saw, the real problem was that the installation script was trying to use an non-existent command (due to incorrect path). The reason why it used the incorrect path was mainly my fault, because I ignored a part in the INSTALL_BINARY file which mentioned:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;Warning&lt;br /&gt;&lt;br /&gt;   If you have previously installed a MySQL installation using your&lt;br /&gt;   operating system native package management system, such as yum or&lt;br /&gt;   apt-get, you may experience problems installing using a native&lt;br /&gt;   binary. Make sure your previous MySQL previous installation has&lt;br /&gt;   been removed entirely (using your package management system), and&lt;br /&gt;   that any additional files, such as old versions of your data&lt;br /&gt;   files, have also been removed. You should also check the existence&lt;br /&gt;   of configuration files such as /etc/my.cnf or the /etc/mysql&lt;br /&gt;   directory have been deleted.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;   &lt;br /&gt;*But* the error message should really have printed out a message which could probably have said:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;"/usr/bin/resolveip" command not found. &lt;br /&gt;Make sure basedir (and other variables) point to the right location. &lt;br /&gt;Tip: resolveip can be located in the bin folder of MySQL download location.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This would have made it real easy for the user to fix the issue instead of trying to figure out what's wrong with their hostname.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-6250947136223201254?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/6250947136223201254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=6250947136223201254' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/6250947136223201254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/6250947136223201254'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/08/mysql-installation-error-neither-host.html' title='MySQL installation error - Neither host nor &apos;localhost&apos; could be looked up'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7753797756377443032</id><published>2010-07-27T23:41:00.000+05:30</published><updated>2010-07-28T00:15:49.866+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ejb31'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>EJB3.1 TimerService in JBoss AS 6.0.0.M4</title><content type='html'>For those of you, who have been waiting for more of EJB3.1 features in JBoss AS, here's some good news! JBoss AS 6.0.0.M4 which will be released in a day or two, introduces support for EJB3.1 Timer Service and EJB3.1 Asynchronous invocations. In this article, we'll see some examples on EJB3.1 timer service features. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Download JBoss AS: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before, starting with the example, let's first download JBoss AS 6.0.0.M4. You can download it from &lt;a href="http://www.jboss.org/jbossas/downloads.html"&gt;here&lt;/a&gt;. After downloading the AS, start and stop it once to make sure it boots without any issues.&lt;br /&gt;&lt;br /&gt;In the next steps we will see a simple EJB3.1 timerservice example (mainly the calendar expression support)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;EJB3.1 Timer Service:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note that the examples shown below are just for the sake of illustrating the usage of timerservice API and as such don't hold much meaning.&lt;br /&gt;&lt;br /&gt;Let's consider a very simple stateless session bean which exposes a remote business interface view:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;package org.jboss.ejb3.timerservice.example;&lt;br /&gt;&lt;br /&gt;public interface TimerOps&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * Schedules a timer for the passed &lt;code&gt;calendarSchedule&lt;/code&gt;&lt;br /&gt;    *   &lt;br /&gt;    * @param calendarSchedule The calendar expression based schedule&lt;br /&gt;    * @param taskName The name of the task, which will be passed an a info to the {@link Timer}&lt;br /&gt;    * &lt;br /&gt;    */&lt;br /&gt;   void scheduleTask(ScheduleExpression calendarSchedule, String taskName);&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;package org.jboss.ejb3.timerservice.example;&lt;br /&gt;&lt;br /&gt;import java.util.Date;&lt;br /&gt;&lt;br /&gt;import javax.annotation.Resource;&lt;br /&gt;import javax.ejb.Remote;&lt;br /&gt;import javax.ejb.ScheduleExpression;&lt;br /&gt;import javax.ejb.Stateless;&lt;br /&gt;import javax.ejb.Timeout;&lt;br /&gt;import javax.ejb.Timer;&lt;br /&gt;import javax.ejb.TimerConfig;&lt;br /&gt;import javax.ejb.TimerService;&lt;br /&gt;&lt;br /&gt;import org.jboss.ejb3.annotation.RemoteBinding;&lt;br /&gt;&lt;br /&gt;@Stateless&lt;br /&gt;@Remote (TimerOps.class)&lt;br /&gt;@RemoteBinding (jndiBinding = "timerservice-example-scheduler-remote")&lt;br /&gt;public class Scheduler implements TimerOps&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   @Resource&lt;br /&gt;   private TimerService timerService;&lt;br /&gt;   &lt;br /&gt;   @Override&lt;br /&gt;   public void scheduleTask(ScheduleExpression calendarSchedule, String taskName)&lt;br /&gt;   {&lt;br /&gt;      // TimerConfig can be passed to the timer service, during timer creation,&lt;br /&gt;      // to specify whether the timer is persistent and also pass any additional&lt;br /&gt;      // Serializable info. &lt;br /&gt;      TimerConfig timerConfig = new TimerConfig();&lt;br /&gt;      &lt;br /&gt;      // by default, timers are persistent. So we don't really have to&lt;br /&gt;      // set the persistence property on the TimerConfig. It's done here,&lt;br /&gt;      // just to demonstrate the usage&lt;br /&gt;      timerConfig.setPersistent(true);&lt;br /&gt;      &lt;br /&gt;      // set the "info" to be passed to the timers&lt;br /&gt;      timerConfig.setInfo(taskName);&lt;br /&gt;      &lt;br /&gt;      // Now, use the injected timerservice to create a timer instance,&lt;br /&gt;      // for the passed schedule and the timer config&lt;br /&gt;      Timer timer = this.timerService.createCalendarTimer(calendarSchedule, timerConfig);&lt;br /&gt;      &lt;br /&gt;      // that's it, we are done. The timer is now created and started (on successful completion&lt;br /&gt;      // of this method). When the scheduled timeout occurs, a method in this bean which is marked&lt;br /&gt;      // as the timeout callback method will be invoked. &lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   /**&lt;br /&gt;    * This method will be invoked by the server when a scheduled timeout occurs for timer(s)&lt;br /&gt;    * created through the timerservice corresponding to this bean.&lt;br /&gt;    * &lt;br /&gt;    * @param timer The {@link Timer} for which the timeout occurred&lt;br /&gt;    */&lt;br /&gt;   @Timeout&lt;br /&gt;   private void onTimeout(Timer timer)&lt;br /&gt;   {&lt;br /&gt;      // do some task here. for now, let's just print out to System.out&lt;br /&gt;      System.out.println("Timeout method invoked at " + new Date() + " for bean " + this.getClass().getSimpleName());&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So in the example above, we have a TimerOps interface which is exposed as the remote view for the Scheduler Stateless session bean. The TimerOps interface allows scheduling timers based on a javax.ejb.ScheduleExpression. This ScheduleExpression is used to express calendar based timeout expressions. We will see more of it, later in this article.&lt;br /&gt;&lt;br /&gt;Moving on to the Scheduler SLSB, you will notice that it expects the TimerService to be injected:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;&lt;br /&gt;   @Resource&lt;br /&gt;   private TimerService timerService;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The injection of timer service into beans, requires no more than annotating that field with the @javax.annotation.Resource annotation. The bean will then use the injected timerservice to create and operate on the timers.&lt;br /&gt;&lt;br /&gt;Let's look at the scheduleTask method in that bean:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt; @Override&lt;br /&gt;   public void scheduleTask(ScheduleExpression calendarSchedule, String taskName)&lt;br /&gt;   {&lt;br /&gt;      // TimerConfig can be passed to the timer service, during timer creation,&lt;br /&gt;      // to specify whether the timer is persistent and also pass any additional&lt;br /&gt;      // Serializable info. &lt;br /&gt;      TimerConfig timerConfig = new TimerConfig();&lt;br /&gt;      &lt;br /&gt;      // by default, timers are persistent. So we don't really have to&lt;br /&gt;      // set the persistence property on the TimerConfig. It's done here,&lt;br /&gt;      // just to demonstrate the usage&lt;br /&gt;      timerConfig.setPersistent(true);&lt;br /&gt;      &lt;br /&gt;      // set the "info" to be passed to the timers&lt;br /&gt;      timerConfig.setInfo(taskName);&lt;br /&gt;      &lt;br /&gt;      // Now, use the injected timerservice to create a timer instance,&lt;br /&gt;      // for the passed schedule and the timer config&lt;br /&gt;      Timer timer = this.timerService.createCalendarTimer(calendarSchedule, timerConfig);&lt;br /&gt;      &lt;br /&gt;      // that's it, we are done. The timer is now created and started (on successful completion&lt;br /&gt;      // of this method). When the scheduled timeout occurs, a method in this bean which is marked&lt;br /&gt;      // as the timeout callback method will be invoked. &lt;br /&gt;   }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It doesn't do much, actually. It first creates (an optional) javax.ejb.TimerConfig to pass during timer creation. The TimerConfig, is where you specify whether the timer has to be persistent and/or any additional Serializable "info" that needs to be associated with the Timer, so that it is available in the timeout callback method. &lt;br /&gt;&lt;br /&gt;In our example, above, we set the timer to be persistent (that's the default anyway) and also set the "info" to the taskName that was passed. This can be any Serializable info. Here we are just passing around some dummy String, for the sake of demonstrating the API usage. &lt;br /&gt;&lt;br /&gt;Then, we use the injected timerservice to create a calendar timer. A calendar timer is a Timer which is created based on a calendar schedule expression. A calendar schedule expression is represented by a ScheduleExpression which expresses a schedule based on the following attributes:&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt; 1) dayOfMonth :  Specifies the day of month when the timeout should occur&lt;br /&gt;  Default Value = "*" (which means, any day of month)&lt;br /&gt;  Example values = Last, 1, 2, 31, 28 etc...&lt;br /&gt; &lt;br /&gt; 2) dayOfWeek : Specifies the day of week when the timeout should occur&lt;br /&gt;  Default Value = "*" (which means, any day of month)&lt;br /&gt;  Example values = Sun, Wed, 2, 7 etc...&lt;br /&gt;&lt;br /&gt;    3) hour : Specifies the hour when the timeout should occur&lt;br /&gt;  Default Value = "0" &lt;br /&gt;  Example values = 12, 23, 18, 2 etc...&lt;br /&gt;  &lt;br /&gt; 4) minute : Specifies the minute when the timeout should occur&lt;br /&gt;   Default value = "0"&lt;br /&gt;   Example values = 10, 12, 35, 59 etc...&lt;br /&gt;   &lt;br /&gt; 5) second : Specifies the second when the timeout should occur&lt;br /&gt;  Default Value = "0";&lt;br /&gt;  Example values = 10, 15, 20 etc...&lt;br /&gt;  &lt;br /&gt; 6) month : Specifies the month when the timeout should occur&lt;br /&gt;  Default value = * (any month)&lt;br /&gt;  Example values = Jan, Mar, 4, 6 etc...&lt;br /&gt;  &lt;br /&gt; 7) year : Specifies the year when the timeout should occur&lt;br /&gt;  Default value = * (any year)&lt;br /&gt;  Example values = 2010, 2020 etc...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Please refer to the EJB3.1 spec for more details on ScheduleExpression.&lt;br /&gt;&lt;br /&gt;So, for example, if we want to schedule a timer to fire every Monday at 3:30 in the morning, then we can create the following ScheduleExpression:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt; ScheduleExpression everyMondayThreeThirty = new ScheduleExpression();&lt;br /&gt; everyMondayThreeThirty.dayOfWeek("Mon").hour(3).minute(30);&lt;br /&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Okay, so let's back to our Scheduler bean now. This is where we create the timer in the bean:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;Timer timer = this.timerService.createCalendarTimer(calendarSchedule, timerConfig);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So once the Scheduler bean's schedule method completes, the timer will be started (remember, timers are transactional, so the timer start waits for the transaction to complete). Once the timeout occurs for the timer, the server will invoke the timeout callback method on the bean. In our example, we have annotated our onTimeout() method as the timeout callback method (note the @Timeout annotation):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;   /**&lt;br /&gt;    * This method will be invoked by the server when a scheduled timeout occurs for timer(s)&lt;br /&gt;    * created through the timerservice corresponding to this bean.&lt;br /&gt;    * &lt;br /&gt;    * @param timer The {@link Timer} for which the timeout occurred&lt;br /&gt;    */&lt;br /&gt;   @Timeout&lt;br /&gt;   private void onTimeout(Timer timer)&lt;br /&gt;   {&lt;br /&gt;      // do some task here. for now, let's just print out to System.out&lt;br /&gt;      System.out.println("Timeout method invoked at " + new Date() + " for bean " + this.getClass().getSimpleName());&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So that was our bean and its remote interface. Now let's take a quick look at our client code which looks up the bean and schedules the timer:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;package org.jboss.ejb3.timerservice.example.client;&lt;br /&gt; &lt;br /&gt;import javax.naming.Context;&lt;br /&gt;import javax.naming.InitialContext;&lt;br /&gt;import javax.naming.NamingException;&lt;br /&gt;import org.jboss.ejb3.timerservice.example.*;&lt;br /&gt; &lt;br /&gt;public class Client&lt;br /&gt;{&lt;br /&gt;   public static void main(String[] args) throws Exception&lt;br /&gt;   {&lt;br /&gt; &lt;br /&gt;      Context ctx = new InitialContext();&lt;br /&gt;      // lookup the bean&lt;br /&gt;      TimerOps scheduler = (TimerOps) ctx.lookup("timerservice-example-scheduler-remote");&lt;br /&gt;      &lt;br /&gt;      // create a schedule&lt;br /&gt;      // Let's say, we want to fire a timeout every Monday at 3, 6 and 9 in the morning&lt;br /&gt;      ScheduleExpression everyMonAtThreeSixAndNineAM = new ScheduleExpression();&lt;br /&gt;      everyMonAtThreeSixAndNineAM.dayOfMonth("Mon").hour("3,6,9");&lt;br /&gt;      &lt;br /&gt;      // schedule our task&lt;br /&gt;      scheduler.scheduleTask(everyMonAtThreeSixAndNineAM, "Hello World Timer");&lt;br /&gt;      &lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the client code, we first lookup the TimerOps remote business view of the bean. We then create a calendar schedule which is expected to fire on every Monday at 3, 6 and 9 in the morning. We then use the bean to schedule the task. That's it. On Monday, every morning 3AM, 6AM and 9AM, you will see the timeout being fired.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;What next?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above example was just one part of the new features in EJB3.1 timer service. Here's another - let's assume that you want to avoid having an additional method on the bean just to create a timer. Let's say that you want a timer to be created and scheduled to fire every day at 8:30 in the morning, from the time the bean is deployed. EJB3.1 timer service allows that to be done! They are known as auto timers. Here's an example of the same (using annotations):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;package org.jboss.ejb3.timerservice.example;&lt;br /&gt;&lt;br /&gt;import javax.ejb.Schedule;&lt;br /&gt;import javax.ejb.ScheduleExpression;&lt;br /&gt;import javax.ejb.Stateless;&lt;br /&gt;import javax.ejb.Timeout;&lt;br /&gt;import javax.ejb.Timer;&lt;br /&gt;import javax.ejb.TimerConfig;&lt;br /&gt;import javax.ejb.TimerService;&lt;br /&gt;import javax.naming.Context;&lt;br /&gt;import javax.naming.InitialContext;&lt;br /&gt;&lt;br /&gt;@Stateless&lt;br /&gt;public class AutoScheduler &lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * This method will be invoked every day at 8:30:00 in the morning&lt;br /&gt;    * @param timer The timer instance&lt;br /&gt;    */&lt;br /&gt;   @Schedule (hour = "8", minute = "30")&lt;br /&gt;   private void executeEveryDayAtEightThirty(Timer timer)&lt;br /&gt;   {&lt;br /&gt;      // do some task here. for now, let's just print out to System.out&lt;br /&gt;      System.out.println("(Auto) timer method invoked at " + new Date() + " for bean " + this.getClass().getSimpleName());&lt;br /&gt;      &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see we have a Stateless (no-interface view) bean which just has this executeEveryDayAtEightThirty method. The important bit here is the @javax.ejb.Schedule annotation which is used on that method. The Schedule annotation is used to create auto timers. The server will look for methods on the bean with the @Schedule annotation and automatically create the timers when the bean is deployed. The schedule for the timers is passed through the annotation's attribute values. The method on which the @Schedule is used, is considered as the timeout callback method for that auto timer and will be invoked when the timeout occurs.&lt;br /&gt;&lt;br /&gt;In our example above, we are creating an auto-timer which will fire every day at 8:30 in the morning and the executeEveryDayAtEightThirty method will be called.  &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Want some more?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Those were just some of the examples for EJB3.1 timer service. There's much more you can try out. For example, there's also the @Schedules (note that it's not the same as @Schedule), which can be used to create multiple auto-timers for the same timeout callback method. Furthermore, if you don't want to use annotations, you can as well use the deployment descriptors. We also haven't covered the other APIs on the TimerService or the Timer in these examples. We can go on and on, but let's keep this short for now. &lt;br /&gt;But, do try out these new features and let us know if you run into any issues. Feel free to start a discussion about any issues around this, in our &lt;a href="http://community.jboss.org/community/ejb3"&gt;EJB3 User Forum&lt;/a&gt; or ping us on &lt;a href="http://www.jboss.org/ejb3/chat.html"&gt;IRC&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7753797756377443032?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7753797756377443032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7753797756377443032' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7753797756377443032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7753797756377443032'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/07/ejb31-timerservice-in-jboss-as-600m4.html' title='EJB3.1 TimerService in JBoss AS 6.0.0.M4'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-4807183023265649809</id><published>2010-05-05T21:47:00.000+05:30</published><updated>2010-05-05T22:05:50.055+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb31'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 6.0.0.M3 released</title><content type='html'>6.0.0.M3 version of JBoss AS has just been released. You can find the release notes &lt;a href="http://community.jboss.org/wiki/AS600M3ReleaseNotes" target="_blank"&gt; here&lt;/a&gt; and you can download the server from &lt;a href="http://www.jboss.org/jbossas/downloads.html" target="_blank"&gt;the JBoss AS downloads page&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This release in addition to bug fixes and other new features, includes support for EJB3.1 Singleton beans. You can find the details and an example &lt;a href="http://community.jboss.org/docs/DOC-15105" target="_blank"/&gt;here&lt;/a&gt;. So it's time to try out this new feature and report any issues in our EJB3 user forums &lt;a href="http://community.jboss.org/en/ejb3"&gt;here&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;Ofcourse, any JBoss AS specific issues can be discussed in the &lt;a href="http://community.jboss.org/community/jbossas"&gt;JBoss AS user forum&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-4807183023265649809?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/4807183023265649809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=4807183023265649809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4807183023265649809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4807183023265649809'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/05/jbossas-600m3-released.html' title='JBoss AS 6.0.0.M3 released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-3448358675628830256</id><published>2010-05-04T01:42:00.000+05:30</published><updated>2010-05-04T01:46:44.856+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='dzone'/><category scheme='http://www.blogger.com/atom/ns#' term='refcard'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss getting started, DZone RefCard published</title><content type='html'>JBoss EAP5/AS5 DZone RefCard has just been published today. It gives you a quick overview of JBoss server installation, deployment, management and its clustering capabilities. &lt;br /&gt;&lt;br /&gt;The RefCard has been authored by &lt;a href="http://community.jboss.org/people/smarlow%40redhat.com" target="_blank"&gt;Scott Marlow&lt;/a&gt;, &lt;a href="http://community.jboss.org/people/smcgowan%40redhat.com" target="_blank"&gt;Shelly McGowan&lt;/a&gt;, &lt;a href="http://bstansberry.wordpress.com/" target="_blank"&gt;Brian Stansberry&lt;/a&gt;, &lt;a href="http://swqetesting.blogspot.com/" target="_blank"&gt;Len DiMaggio&lt;/a&gt; and me. You can get a copy of it from &lt;a href="http://refcardz.dzone.com/refcardz/getting-started-jboss" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-3448358675628830256?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/3448358675628830256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=3448358675628830256' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/3448358675628830256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/3448358675628830256'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/05/jboss-getting-started-dzone-refcard.html' title='JBoss getting started, DZone RefCard published'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-4482414010973362249</id><published>2010-04-18T13:28:00.000+05:30</published><updated>2010-04-18T14:06:40.929+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='slf4j'/><category scheme='http://www.blogger.com/atom/ns#' term='logback'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse plugin'/><title type='text'>Eclipse Logback Plugin with JBoss AS</title><content type='html'>Recently in one of the &lt;a href="https://community.jboss.org/message/537771#537771" target="_blank"&gt;forum threads&lt;/a&gt; an user asked how to use Logback Eclipse Plugin along with slf4j logging framework in JBoss AS. Having been tired of all those logging frameworks out there, I wasn't really too interested in looking at the details. But during this weekend, I had this sudden urge of trying out some simple application on which I wouldn't have to spend too much time or energy. So I decided to see what it takes to get the Logback Eclipse Plugin running against JBoss AS. So here's what it takes (well, nothing much actually - around half an hour or less):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Pre-requisites:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;- JBoss Application Server 5.1.0 : Since this is the latest stable version, I decided to use this for testing. I don't see any reason why it shouldn't work against other version of the AS (4.x or 6.x).&lt;br /&gt;&lt;br /&gt;- Latest release of slf4j library (1.5.11 at the time of writing this article) : JBoss AS-5 (and even AS-6) already ships with the slf4j jar in its lib folder. But since this is just another third party library, each user app should be able to package their own version of the jar within the app (and apply the usual classloading isolation configurations to the app). You can download slf4j from &lt;a href="http://www.slf4j.org/download.html" target="_blank"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Logback library version 0.9.9 : The logback library can be downloaded from the download site &lt;a href="http://logback.qos.ch/download.html" target="_blank"&gt;here&lt;/a&gt;.  The only important thing to remember is to download version 0.9.9 (and *not* the latest one), because the latest versions of that plugin does not work due to a &lt;a href="http://stackoverflow.com/questions/2364738/cant-get-logback-eclipse-plugin-to-display-output/2386481#2386481" target="_blank"&gt;bug&lt;/a&gt;. Version 0.9.9 can be found &lt;a href="http://logback.qos.ch/dist/" target="_blank"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Eclipse IDE : I am currently on 3.4.1 Eclipse. I don't think the version of Eclipse would matter for this application.&lt;br /&gt;&lt;br /&gt;- Logback Eclipse Plugin : The details of this plugin can be found &lt;a href="http://logback.qos.ch/consolePlugin.html" target="_blank"&gt;here&lt;/a&gt;. It includes information on how to configure the plugin for Eclipse and where to download it from. At the time of writing this article, I found the plugin download  &lt;a href="http://logback.qos.ch/dist/ch.qos.logback.eclipse_1.1.0.zip" target="_blank"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sample application:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now that we have the required libraries and the setup ready, the next step is to write a simple application which makes use of slf4j logging framework backed by logback, to log some messages. Since this article is mainly meant as a quick start of getting logback Eclipse plugin working against JBossAS, I decide to use a simple servlet which does nothing more than log some messages.&lt;br /&gt;&lt;br /&gt;The servlet looks like this:&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;package org.myapp.servlet;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import javax.servlet.ServletException;&lt;br /&gt;import javax.servlet.http.HttpServlet;&lt;br /&gt;import javax.servlet.http.HttpServletRequest;&lt;br /&gt;import javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt;import org.slf4j.Logger;&lt;br /&gt;import org.slf4j.LoggerFactory;&lt;br /&gt;&lt;br /&gt;public class SimpleServlet extends HttpServlet&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   private static Logger slf4jLogger = LoggerFactory.getLogger(SimpleServlet.class);&lt;br /&gt;   &lt;br /&gt;   @Override&lt;br /&gt;   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException&lt;br /&gt;   {&lt;br /&gt;      slf4jLogger.info("******************************************");&lt;br /&gt;      slf4jLogger.info("***Hello World from a simple servlet***");&lt;br /&gt;      slf4jLogger.info("***Let's try out some logging messages***");&lt;br /&gt;      slf4jLogger.info("******************************************");&lt;br /&gt;      &lt;br /&gt;      slf4jLogger.debug("This is DEBUG message");&lt;br /&gt;      slf4jLogger.info("This one is INFO message");&lt;br /&gt;      slf4jLogger.warn("Let's also send out a WARN message");&lt;br /&gt;      slf4jLogger.error("Well, sometimes we run into ERROR messages too");&lt;br /&gt;      try&lt;br /&gt;      {&lt;br /&gt;         throw new Exception("Intentional exception for demo");&lt;br /&gt;      }&lt;br /&gt;      catch (Exception e)&lt;br /&gt;      {&lt;br /&gt;         slf4jLogger.error("Error with stacktrace", e);&lt;br /&gt;      }&lt;br /&gt;      slf4jLogger.info("******************************************");&lt;br /&gt;      slf4jLogger.info("***That's it, folks!!!***");&lt;br /&gt;      slf4jLogger.info("******************************************");&lt;br /&gt;      &lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It uses slf4j LoggerFactory to create a Logger and then use that logger to write out some log messages at different log levels. That's it.&lt;br /&gt;&lt;br /&gt;The web.xml, just maps this servlet to some URL:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;web-app&amp;gt;&lt;br /&gt;  &amp;lt;display-name&amp;gt;Logback example for JBossAS&amp;lt;/display-name&amp;gt;&lt;br /&gt;  &lt;br /&gt;    &amp;lt;servlet&amp;gt;&lt;br /&gt;         &amp;lt;servlet-name&amp;gt;SimpleServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;         &amp;lt;servlet-class&amp;gt;org.myapp.servlet.SimpleServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;     &amp;lt;/servlet&amp;gt;&lt;br /&gt;     &lt;br /&gt;     &amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;         &amp;lt;servlet-name&amp;gt;SimpleServlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;         &amp;lt;url-pattern&amp;gt;invokeServlet&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;     &amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;     &lt;br /&gt;&amp;lt;/web-app&amp;gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then there's jboss-web.xml for classloading configuration:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;jboss-web&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;class-loading&amp;gt;&lt;br /&gt;        &amp;lt;loader-repository&amp;gt;&lt;br /&gt;            org.myapp:classloader=logback-example&lt;br /&gt;            &amp;lt;loader-repository-config&amp;gt;java2ParentDelegation=false&amp;lt;/loader-repository-config&amp;gt;&lt;br /&gt;        &amp;lt;/loader-repository&amp;gt;&lt;br /&gt;    &amp;lt;/class-loading&amp;gt;&lt;br /&gt;&amp;lt;/jboss-web&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And finally, the important one, the logback.xml file which is responsible for configuring the consolePlugin:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;configuration debug="true"&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;consolePlugin /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Yes, that's all you need in the logback.xml to get it working. More details can be found in its documentation  &lt;a href="http://logback.qos.ch/consolePlugin.html" target="_blank"&gt;here&lt;/a&gt;. The above config file creates a SocketAppender which uses port 4321 (by default). The Logback Plugin in Eclipse (also by default) connects to this 4321 to receive the log messages (when they are logged).&lt;br /&gt;&lt;br /&gt;Note: The debug="true" in that logback.xml is just to show some debug messages when logback is reading that config file. You can remove that attribute, if you don't need such messages.&lt;br /&gt;&lt;br /&gt;So now that we have these files ready, we just need to create a deployable application to test it out. I decided to use a .war file in this demo. You can even use a .ear file. I won't get into the details of how to create the .war file. Use your favourite build tool or an IDE to generate the .war file. The final .war should look like this:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;myapp.war&lt;br /&gt; |&lt;br /&gt; |--- WEB-INF&lt;br /&gt; |      |&lt;br /&gt; |      |--- web.xml&lt;br /&gt; |      |--- jboss-web.xml&lt;br /&gt; |      |&lt;br /&gt; |      |---   lib&lt;br /&gt; |      |       |&lt;br /&gt; |      |       |--- logback-classic-0.9.9.jar&lt;br /&gt; |      |       |--- logback-core-0.9.9.jar&lt;br /&gt; |      |       |--- slf4j-api-1.5.11.jar&lt;br /&gt; |      |&lt;br /&gt; |      |&lt;br /&gt; |      |--- classes&lt;br /&gt; |      |       |&lt;br /&gt; |      |       |--- logback.xml&lt;br /&gt; |      |       |&lt;br /&gt; |      |       |---   org&lt;br /&gt; |      |       |       |--- myapp&lt;br /&gt; |      |       |       |       |--- servlet&lt;br /&gt; |      |       |       |       |       |--- SimpleServlet.class&lt;br /&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note that the logback.xml is placed in .war/WEB-INF/classes folder because logback looks for that file in the classpath. Also notice the contents of .war/WEB-INF/lib folder - those are the jars that you'll have to package in your application. logback-classic-0.9.9.jar and logback-core-0.9.9.jar can be found in the logback download (which you did in the pre-requisites section). slf4j-api-1.5.11.jar can be found in the slf4j download.&lt;br /&gt;&lt;br /&gt;Place this .war file in JBOSS_HOME/server/&lt; servername&gt;/deploy folder and start the server. Also open Eclipse IDE (if it's not already open) and open the "Logback View". Since we haven't yet logged anything from our application, the view will be empty (see image below). &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_SLRISZQqx40/S8rDPOG-gqI/AAAAAAAAAAc/cgrCxRaVsto/s1600/Eclipse+Logback+View+-+Empty.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 200px;" src="http://3.bp.blogspot.com/_SLRISZQqx40/S8rDPOG-gqI/AAAAAAAAAAc/cgrCxRaVsto/s400/Eclipse+Logback+View+-+Empty.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5461392164392960674" target="_blank"/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So now let's invoke our servlet which logs the messages. As shown in the web.xml, I have mapped the servlet to the "invokeServlet" URL. So from my web browser, I access http://localhost:8080/myapp/invokeServlet&lt;br /&gt;&lt;br /&gt;That's it, the servlet starts logging the messages and in the "Logback View" of Eclipse you will see the logged messages (see image below). &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_SLRISZQqx40/S8rDd3KrKsI/AAAAAAAAAAk/BkQoQM6zY1s/s1600/Eclipse+Logback+View+-+Log+messages.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 204px;" src="http://3.bp.blogspot.com/_SLRISZQqx40/S8rDd3KrKsI/AAAAAAAAAAk/BkQoQM6zY1s/s400/Eclipse+Logback+View+-+Log+messages.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5461392415932492482" target="_blank"/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You have now successfully configured Logback Eclipse Plugin to work against JBoss AS. Did not take long to get it working!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-4482414010973362249?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/4482414010973362249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=4482414010973362249' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4482414010973362249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4482414010973362249'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/04/eclipse-logback-plugin-with-jboss-as.html' title='Eclipse Logback Plugin with JBoss AS'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_SLRISZQqx40/S8rDPOG-gqI/AAAAAAAAAAc/cgrCxRaVsto/s72-c/Eclipse+Logback+View+-+Empty.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-2808799748419103641</id><published>2010-04-06T22:07:00.000+05:30</published><updated>2010-04-06T22:16:21.310+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jboss ejb31 javaee'/><title type='text'>EJB3.1 Singleton Bean support now available in JBoss AS trunk</title><content type='html'>For those, who have been waiting for EJB3.1 Singleton bean support in JBoss AS, here's some good news. This week, we updated the AS trunk to include support for singleton beans. JBoss AS 6.0.0 M3 will be released in the &lt;a href="http://community.jboss.org/wiki/AS600M3StatusExecutiveSummary"&gt;next few weeks&lt;/a&gt;. In the meantime, those of you who want to try out this feature, can follow the instructions &lt;a href="http://community.jboss.org/wiki/EJB31SingletonBeansinAS600M3"&gt;here&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Feel free to report any issues, in our &lt;a href="http://community.jboss.org/community/ejb3"&gt;EJB3 user forum&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-2808799748419103641?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/2808799748419103641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=2808799748419103641' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2808799748419103641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2808799748419103641'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/04/ejb31-singleton-bean-support-now.html' title='EJB3.1 Singleton Bean support now available in JBoss AS trunk'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-5530365017325958396</id><published>2010-02-17T15:32:00.000+05:30</published><updated>2010-02-17T15:47:04.296+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb3.1'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss AS 6.0.0.M2 released</title><content type='html'>JBoss AS 6.0.0.M2 has been released yesterday. This is the second milestone release of the JBoss AS-6 series. You can download it from &lt;a href="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-6.0.0.M2"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://bstansberry.wordpress.com/2010/02/16/jboss-application-server-6-0-0-m2-is-out/"&gt;Brian's blog&lt;/a&gt; contains details about what this new release contains. From the EJB3.1 point of view, this release contains the initial EJB3.1 support. See &lt;a href="http://community.jboss.org/wiki/EJB31inAS600M2"&gt;this wiki&lt;/a&gt; for more details.&lt;br /&gt;&lt;br /&gt;Other than the new features that have been added to 6.0.0.M2, you will also notice that this new version boots faster than the earlier 5.x and 6.0.0.M1 versions. There have been numerous (valid) complaints about slow boot time with AS-5.x and 6.0.0.M1. Although there have been performance improvements after 5.1.0 release, they weren't too noticeable. However, in this version of AS, there have been numerous performance fixes within the JBoss Microcontainer (JBoss MC) project and various other places which ultimately has resulted in a better boot time for JBoss AS. For those who believe in numbers, here's the boot time comparison on my local system:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JBoss AS-5.1.0 "default" server config:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;21:02:56,538 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 42s:792ms&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JBoss AS 6.0.0.M1 "default" server config:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;21:08:42,775 INFO  [AbstractServer] JBossAS [6.0.0.M1 (build: SVNTag=JBoss_6_0_0_M1 date=200911281333)] Started in 36s:156ms&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;JBoss AS 6.0.0.M2 "default" server config:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;15:22:01,708 INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] JBossAS [6.0.0.20100216-M2 (build: SVNTag=JBoss_6_0_0_20100216-M2 date=20100216)] Started in 22s:311ms&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So a boot time improvement of 20 seconds from 5.1.0 and 14 seconds from 6.0.0.M1.&lt;br /&gt;&lt;br /&gt;One important thing that users must be aware is that, JBoss AS 6.0.0.M2 has introduced the notion of lazy deployment of applications. While working on improving the boot time of AS, it was noticed that the admin-console (JBOSS_HOME/server/&lt; servername&gt;/deploy/admin-console.war) adds almost 25 to 30 seconds to the boot time of the AS. Obviously this isn't good. Furthermore, not many developers really use admin-console, atleast not very frequently while developing and testing their application. So deploying the admin-console (and any other such application) by default isn't of any value for such users. So it was decided that the notion of lazy deployments would be introduced. &lt;br /&gt;&lt;br /&gt;To put it in simple terms - although the admin-console.war, jmx-console.war and jbossws-console.war will be shipped by default in the AS, they will no longer be *deployed* by default. The first access to any of these applications is going to deploy them. The complete set of details can be found in this &lt;a href="http://community.jboss.org/thread/147220"&gt;forum thread&lt;/a&gt;. So in AS 6.0.0.M2, you will notice that these applications have now been moved to JBOSS_HOME/common/deploy folder. Note that, the admin-console is still a bit of heavy beast during deployment - you will see a slow response during admin-console deployment (so first access to this application is going to be slow). But this will no longer add to the boot time. There are plans to further improve the boot time of the AS in the next coming M3 release. So this is not the end of boot time performance improvements, but definitely a good start!&lt;br /&gt;&lt;br /&gt;So, go &lt;a href="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-6.0.0.M2"&gt;download&lt;/a&gt; the newly released version and try it out! Let us know of any issues you run into in our &lt;a href="http://community.jboss.org/community/jbossas"&gt;AS user forum&lt;/a&gt;. And if you have run into any EJB3(.1) issues, or have any questions around it, then feel free to ping us on #jboss-ejb3 (irc.freenode.net) or even vist our &lt;a href="http://community.jboss.org/community/ejb3"&gt;EJB3 user forum&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-5530365017325958396?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/5530365017325958396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=5530365017325958396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/5530365017325958396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/5530365017325958396'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/02/jboss-as-600m2-released.html' title='JBoss AS 6.0.0.M2 released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-4047073083663037906</id><published>2010-01-20T20:26:00.000+05:30</published><updated>2010-01-20T20:34:04.162+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jbossas'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb3.1'/><category scheme='http://www.blogger.com/atom/ns#' term='EJB'/><category scheme='http://www.blogger.com/atom/ns#' term='javaee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>EJB3.1 initial support in JBoss AS</title><content type='html'>Good news for those waiting for EJB3.1 support in JBoss AS :) The &lt;a href="http://lists.jboss.org/pipermail/jboss-development/2009-December/015174.html" target="_blank"&gt;upcoming&lt;/a&gt; JBoss AS 6.0.0.M2 will have the initial EJB3.1 support. The AS release is scheduled a few weeks from now. Last weekend we added some of the EJB3.1 support to the JBoss AS trunk. This includes the no-interface view for EJBs and also deployment of EJBs through .war files. So in it's present state, the AS trunk has these EJB3.1 features available.&lt;br /&gt;&lt;br /&gt;Those of you who want to try this out and provide feedback/bug reports etc... please follow &lt;a href="http://community.jboss.org/thread/147016?tstart=0" target="_blank"&gt;this&lt;/a&gt; thread in the EJB3 user forum. Good luck and let us know, in the forums, how it goes!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-4047073083663037906?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/4047073083663037906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=4047073083663037906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4047073083663037906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4047073083663037906'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2010/01/ejb31-initial-support-in-jboss-as.html' title='EJB3.1 initial support in JBoss AS'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-5837437145581090703</id><published>2009-09-25T19:22:00.000+05:30</published><updated>2009-09-25T19:38:39.447+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss Community Asylum - Cool place to get JBoss Community podcasts</title><content type='html'>It's been a while since i last blogged. Mainly because there wasn't anything interesting/useful that was worth sharing here. However, one of the news worth sharing, is the launch of &lt;a href="http://asylum.libsyn.com/"&gt;JBoss Community Asylum&lt;/a&gt;. It's been started by Max R Andersen (JBoss tooling), Emmanuel Bernard (Hibernate team) and Michael Neale (Drools team) and will be sharing podcasts related to JBoss Community and its projects: news, interviews etc.&lt;br /&gt;&lt;br /&gt;The first podcast has already been uploaded. So for those who missed the recent JBoss World event, this first podcast is an summary of what happened there. So don't miss it, you can get it &lt;a href="http://asylum.libsyn.com/index.php?post_id=529471"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And stay tuned to that site for more such podcasts in the near future!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-5837437145581090703?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/5837437145581090703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=5837437145581090703' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/5837437145581090703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/5837437145581090703'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2009/09/jboss-community-asylum-cool-place-to.html' title='JBoss Community Asylum - Cool place to get JBoss Community podcasts'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-3838017972955995046</id><published>2009-04-30T12:32:00.000+05:30</published><updated>2009-04-30T12:43:14.617+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBossAS now has an admin-console!</title><content type='html'>JBoss AS users have always asked why JBoss does not have an admin console. Personally, i have always liked working directly on the configuration files without needing any web application or any other tool for doing the same. That's because i like spending more and more time on the AS. But for users who want to just get things done without having to worry about how it is done or which file gets placed where and want to manage the deployments through a web application, a decent admin console was always a neccessity. Its good news now for all JBoss AS users - starting &lt;a href="http://www.jboss.org/jbossas/downloads/"&gt;5.1.0.CR1 version&lt;/a&gt;, JBoss AS now has an excellent admin console!&lt;br /&gt;&lt;br /&gt;I decided to give it a try, during this weekend, to see what features it provides. This article is just to give you some idea about what the admin-console has. The best place to look for all other details and feature list of the admin-console, is the &lt;a href="http://www.jboss.org/embjopr"&gt;Embedded Jopr project page&lt;/a&gt;. So here's an account of what i found about the admin-console. &lt;br /&gt;&lt;br /&gt;The admin console is available by default in the "default" and "all" server configurations. The application is available as a WAR file "admin-console.war" in the deploy folder of these configurations. You can access the admin-console at the following URL http://localhost:8080/admin-console. By default, the username for the application is "admin" and the password is "admin".&lt;br /&gt;&lt;br /&gt;Once you login to the admin-console, you will notice a list of menu items on the left hand side of the screen. The right hand side of the screen is a multi-tabbed details page. So let's click on the "Applications" menu item on the left hand side menu. This shows a list of all applications on the server. Each of these applications is categorized based on the type of the application. Some of the categories are : EJB2.x application, EJB3.x application, WAR, EAR, MC beans. There's also Embedded WARs - these are WAR files which are deployed within an EAR file. Apart from applications, the admin-console also displays resources like JMS factories, JMS destinations (queues/topics), datasources. For each of these applications and resources, the admin-console shows the status (UP/DOWN) of those applications/resources. You can delete existing resources or applications by clicking on the "Delete" button on the details page.&lt;br /&gt;&lt;br /&gt;The admin-console allows you to deploy new applications (WAR, EAR etc...) and also add new resources. So let's see how to deploy an EAR file. On the left hand side menu, click on the Enterprise Application (EARs) link under the Applications. Then on the details page, you will notice a "Add a new resource" button. Click on it. Use the Browse button to select the EAR you want to deploy. This page also gives you an option to deploy the EAR either as an archive or in a exploded format. Select appropriate option and click Continue. That's it, if the application is deployed successfully, you will see an appropriate message and also the status of the application will be shown as "UP". For all those who want to deploy applications in the traditional way (copying to deploy folder), you can still do it. The admin-console dynamically updates it list of deployed applications and on the next refresh, you will notice your application being listed. &lt;br /&gt;&lt;br /&gt;As i mentioned earlier, the details page is a multi-tabbed page. It has a Metrics tab, Control tab, Configuration tab etc... So let's see what the "Control" tab can be used for. Select the Enterprise Application link (from the left hand menu) and drill down to the application of your choice. Then click on the "Control" tab. You will notice options to "Start", "Stop" and "Restart" the application. The other tabs like "Configuration", "Metrics" show many details about the selected application or resource.  &lt;br /&gt;&lt;br /&gt;Overall, the admin-console is a great addition to JBoss AS and provides that you expect from a decent admin-console. Users who have long waited for such an admin-console in JBoss will finally get what they asked for! So go to the &lt;a href="http://www.jboss.org/jbossas/downloads/"&gt;JBossAS download page&lt;/a&gt; and get the latest 5.1.0.CR1 version and start playing with the console.&lt;br /&gt;&lt;br /&gt;As always, if you have any suggestions or issues to report, feel free to do so in the &lt;a href="http://www.jboss.org/index.html?module=bb&amp;op=viewforum&amp;f=294"&gt;Embedded Jopr forum&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-3838017972955995046?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/3838017972955995046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=3838017972955995046' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/3838017972955995046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/3838017972955995046'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2009/04/jbossas-now-has-admin-console.html' title='JBossAS now has an admin-console!'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-1698673966823685579</id><published>2009-04-07T13:39:00.000+05:30</published><updated>2009-04-07T13:46:12.750+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBoss EJB3 tutorials and docs</title><content type='html'>I thought i will blog this, since i have been seeing many of the community members looking for some documentation or tutorials for EJB3 on JBoss. Obviously, for anyone who's trying to learn a new technology, the best place to start will be the tutorials. Many of you might be already aware that the new JBossAS-5.x series have been released to the community. Just recently we uploaded a completely new set of EJB3 tutorials and reference documentation targeted for JBossAS-5. These tutorials and reference documentation is available &lt;a href="http://www.jboss.org/jbossejb3/docs/"&gt;here&lt;/a&gt;. The earlier set of tutorials which are targeted for AS-4.x are available &lt;a href="http://www.jboss.org/jbossejb3/docs/tutorial/"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;The new set of tutorials have been modified to work against AS5. The changes mainly include changes to deployment descriptors or any JBoss specific EJB3 features. The complete source code for the tutorials is available for download at the same URL. &lt;br /&gt;&lt;br /&gt;The important point to note is that these tutorials will be maintained to work against the latest release of EJB3 plugin. So what is EJB3 plugin? JBossAS-5 ships with EJB3 support by default. As you all know, the JBoss EJB3 project and the JBoss AS project are maintained separately and as such have their own release cycles. So what happens if we introduced something new in EJB3 or do a major bug fix for the community in EJB3 project? How do we make it available to the community who use EJB3 support provided by AS5? That's where the EJB3 plugin comes in picture. The EJB3 plugin provides a mechanism where you can patch newer versions of EJB3 into AS5. This way, if there are any major bug fixes or enhancements you are waiting for from the EJB3 community, then you can use the EJB3 plugin to patch it in AS5. &lt;br /&gt;&lt;br /&gt;The next question would be, when and where do i get the EJB3 plugin for the AS. EJB3 project has come up with a release cycle where, every 2nd and 4th Friday of the month there will be a EJB3 release. These releases are downloadable at the &lt;a href="http://www.jboss.org/jbossejb3/downloads/"&gt;JBoss EJB3 download page&lt;/a&gt; . So how do you use this plugin against the AS? It's pretty simple. All you need is:&lt;br /&gt;&lt;br /&gt;- JBossAS-5 installation&lt;br /&gt;- Ant 1.7&lt;br /&gt;&lt;br /&gt;Download the plugin which is nothing but a jar file and run the following command&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;java -jar jboss-ejb3-plugin-x.x.x-installer.jar &lt; path to JBossAS5.x &gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note that jboss-ejb3-plugin-x.x.x-installer.jar is the name of the jar file you downloaded.&lt;br /&gt;&lt;br /&gt;So that gives you an idea about what the plugin is. Coming back to the EJB3 tutorials, I mentioned earlier that these tutorials are maintained to work against the latest release of EJB3 plugin. What this means is, you won't find a tutorial in a broken state (tutorials that are no longer running). The tutorials are tested against every release of the EJB3 plugin. So if something in the tutorials breaks, then that's fixed at the right place before they are released to the community.  &lt;br /&gt;&lt;br /&gt;If anyone has any suggestions or questions about the tutorials or the EJB3 docs, feel free to start a discussion in the &lt;a href="http://www.jboss.org/index.html?module=bb&amp;op=viewforum&amp;f=221"&gt;JBoss EJB3 forum&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-1698673966823685579?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/1698673966823685579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=1698673966823685579' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/1698673966823685579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/1698673966823685579'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2009/04/jboss-ejb3-tutorials-and-docs.html' title='JBoss EJB3 tutorials and docs'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-5499750918740837916</id><published>2009-02-24T14:24:00.000+05:30</published><updated>2009-02-24T14:29:59.358+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBossAS 5.0.1 GA released</title><content type='html'>JBossAS-5.0.1 GA has been released today. The download is available on the &lt;a href="http://www.jboss.org/jbossas/downloads/"&gt;JBoss download site&lt;/a&gt;. One of the major issues that has been fixed in this release is the one that was &lt;a href="http://www.jboss.org/index.html?module=bb&amp;op=viewtopic&amp;t=147622"&gt;reported in the community&lt;/a&gt; and was related to "tmp" file handling of deployments by VFS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-5499750918740837916?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/5499750918740837916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=5499750918740837916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/5499750918740837916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/5499750918740837916'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2009/02/jbossas-501-ga-released.html' title='JBossAS 5.0.1 GA released'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-4414396329564192550</id><published>2009-01-14T17:34:00.000+05:30</published><updated>2009-01-15T16:36:57.325+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Recognition to community contributors - JBoss Community Leadership Awards</title><content type='html'>It's a well known fact that community support for an open source project is always necessary for the growth of the project. Support can be in any form - documentation, bug fixes, feature enhancements, active participation in the forums etc... JBoss has taken the initiative to recognize such community users who have contributed in a great way, towards the growth of various projects hosted at JBoss. The &lt;a href="http://www.jboss.org/community/poll.jspa"&gt;JBoss Community Leadership Awards&lt;/a&gt; aims at recognizing such community members. There are various categories for the awards - checkout the poll page. You can cast your vote under any of those categories. This is a chance to cast your vote for those who might have helped you, in some way or the other, while using projects hosted at JBoss :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-4414396329564192550?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/4414396329564192550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=4414396329564192550' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4414396329564192550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/4414396329564192550'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2009/01/recognition-to-community-contributors.html' title='Recognition to community contributors - JBoss Community Leadership Awards'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-1045530071347283195</id><published>2008-12-06T19:39:00.000+05:30</published><updated>2008-12-06T20:24:18.796+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>JBossAS-5.0 goes GA</title><content type='html'>JBossAS-5.0 GA community edition has been released a few days back!!! Many of you might be knowing that the JBoss-5.0 development was going on for a few years now. After 4 Betas and 2 CRs the application server is now GA. JBossAS-5.0 GA complies with JavaEE5.&lt;br /&gt;&lt;br /&gt;Some of you who keep an watch on the JBoss forums and mailing lists, might already be aware that JBoss-5 was completely rearchitectured. There have been a variety of architectural changes that have been introduced in JBoss-5. So what does this mean to a developer who's been using JBoss-4.x so far? The purpose of this article is to highlight the changes that have come in as part of JBoss-5. I won't be dwelling a lot into the technical details (i will leave it to the experts), but will try to give an overview of changes in this version from JBoss-4.x. This article is aimed at making you aware about things to keep in mind when you start using JBoss-5.&lt;br /&gt;&lt;br /&gt;So let's start!&lt;br /&gt;&lt;br /&gt;1) Additional server profiles/configurations :&lt;br /&gt;&lt;br /&gt;JBoss-4.x AS community users will be used to seeing 3 server profiles being shipped by JBoss in the %JBOSS_HOME%/server folder. The "all", "default" and the "minimal". JBoss-5.0 GA adds couple of more profiles to this. Now in JBoss-5 you have "all", "default", "minimal", "web" and "standard". &lt;br /&gt;&lt;br /&gt; * The "web" profile is meant to contain services which will allow simple web applications (servlet, jsps) to be deployed. It also has support for JTA, JCA and JPA. Some of you might ask how is it different from the "minimal" configuration. If you look in the deployers folder of "minimal" profile, you will find that there are no deployers available in the "deployers" folder nor any applications in the "deploy" folder. The "minimal" profile is mainly meant for letting the developers decide what services they want to be available. The "minimal" is just an empty profile which the users can build upon depending on their needs, whereas the "web" is a subset of the "default" and allows deploying web applications.&lt;br /&gt;&lt;br /&gt; * The "standard" profile is the one against which the tests for JavaEE support were run against.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) Separation of "deployers" and "deploy" :&lt;br /&gt;&lt;br /&gt;If you look in the "deploy" folder of a JBoss-4.x system, you will notice that it contains two types of deployables. Some of the deployables are meant to deploy other applications. For example: The jbossweb.deployer in the deploy folder is actually used for deploying web applications (WAR). With JBoss-5, there is now a clear separation between the deployer and the deployable. You will notice that in JBoss-5, there is a "deployers" folder under each server profile %JBOSS_HOME%/server/&lt; serverName&gt;/deployers. The jbossweb.deployer, which i used as an example earlier, is now in this "deployers" folder along with various other deployers. The actual applications that are to be deployed reside in the "deploy" folder %JBOSS_HOME%/server/&lt; serverName&gt;/deploy.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) Libraries are now moved to a common/lib folder:&lt;br /&gt;&lt;br /&gt;In JBoss-4.x, you will notice that the lib folder under each server profile contains almost the same set of jar files. This obviously leads to increased disk space usage. In JBoss-5.0 GA, these common jar files which are required by all these server profiles is now moved to %JBOSS_HOME%/common/lib folder. This common/lib will act as a parent to all server/&lt; serverName&gt;/lib folders. If you want to add any jar for a specific server profile, then you can add it to the %JBOSS_HOME%/server/&lt; serverName&gt;/lib folder. For example: The database drivers that are required by the datasources can be placed in the server profile specific lib folder (%JBOSS_HOME%/server/&lt; serverName&gt;/lib). With the addition of this new common/lib folder, two new JBoss system properties have been introduced:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt; * jboss.common.base.url - This evaluates to ${jboss.home.url}/common&lt;br /&gt; * jboss.common.lib.url - This evaluates to ${jboss.common.base.url}/lib&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;All other JBoss system properties available in JBoss-4.x &lt;a href="http://www.jboss.org/community/docs/DOC-10730"&gt;http://www.jboss.org/community/docs/DOC-10730&lt;/a&gt; continue to remain in JBoss-5.&lt;br /&gt;&lt;br /&gt;4) For Windows users, its now one step easier to run JBoss as a service :&lt;br /&gt;&lt;br /&gt;For JBoss-4.x Windows users, running the server as a service required downloading an appropriate version of JBoss Native and then using the service.bat in the JBoss Native to install the service. In JBoss-5.0 GA, its now one step less. JBossAS comes with JBoss Native installed by default. This way, the user no longer has to download the JBoss Native package separetely. The service.bat for installing the service can be found in the %JBOSS_HOME%/bin folder.&lt;br /&gt;&lt;br /&gt;5) New jmx-console :&lt;br /&gt;&lt;br /&gt;The jmx-console now comes with a better "professional looking" look :-)&lt;br /&gt;&lt;br /&gt;As i mentioned earlier, in this article, i'am going to leave out all the technical details about the changes that have come in JBoss-5. I'll leave it for my next articles, which i plan to do pretty soon after spending some time on this new GA version :-) But in the meantime, JBossAS enthusiasts can start playing with the GA version by downloading it from &lt;a href="http://www.jboss.org/jbossas/downloads/"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And yes, if you run into any issues using JBossAS-5, feel free to post in the AS-5 dedicated forum  &lt;a href="http://www.jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=287"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-1045530071347283195?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/1045530071347283195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=1045530071347283195' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/1045530071347283195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/1045530071347283195'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2008/12/jbossas-50-goes-ga.html' title='JBossAS-5.0 goes GA'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-8396523203424873234</id><published>2008-08-20T13:56:00.000+05:30</published><updated>2008-08-20T14:13:26.702+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>How to upgrade Hibernate in JBoss</title><content type='html'>JBoss comes shipped with Hibernate by default. Upgrading Hibernate is similar to upgrading any other 3rd party library in your application deployed on JBoss. As long as you understand how the classloading works in JBoss, the upgrading should be pretty straightforward. &lt;br /&gt;&lt;br /&gt;For a brief (well not so brief) background about classloaders in JBoss, have a look at these wiki articles:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wiki.jboss.org/wiki/JBossClassLoadingUseCases"&gt;How classloading works in JBoss&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wiki.jboss.org/wiki/ClassLoadingConfiguration"&gt;How to configure classloaders in JBoss&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Once you read through these wiki articles, you will understand that if your application needs to have its own version of a library (does not matter if it is Hibernate or some other 3rd party library), you will have to configure classloader scoping through the xml file. &lt;br /&gt;&lt;br /&gt;So why am i writing this stuff all over again, when these two wiki articles have enough details about classloading scoping? Its mainly because of some tricky issues, which have been reported in the JBoss forums, with upgrading Hibernate (specifically to Hibernate version 3.2.6) on JBoss-4.2.x (specifically JBoss-4.2.2 GA). The rest of the article tries to explain these issues and way to fix them. Though this is written to be more oriented towards upgrading Hibernate, whatever has been explained here will apply to almost every 3rd party library upgrade on JBoss.&lt;br /&gt;&lt;br /&gt;So let's start then!&lt;br /&gt;&lt;br /&gt;Details about the default installation of JBoss-4.2.2 GA:&lt;br /&gt;&lt;br /&gt;JBoss-4.2.2 GA ships with &lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;&lt;br /&gt;Hibernate EntityManager 3.2.1.GA&lt;br /&gt;Hibernate Annotations 3.2.1.GA&lt;br /&gt;Hibernate 3.2.4.sp1&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;What we intend to do is, upgrade Hibernate to use 3.2.6 GA. Let's assume, we have an EAR which will be deployed to JBoss:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;MyApp.ear&lt;br /&gt; |&lt;br /&gt; |--- META-INF&lt;br /&gt; |      |&lt;br /&gt; |      |&lt;br /&gt; |      |--- application.xml&lt;br /&gt; |      | &lt;br /&gt; |      |--- jboss-app.xml&lt;br /&gt; |&lt;br /&gt; |&lt;br /&gt; |--- lib&lt;br /&gt; |    |&lt;br /&gt; |    |--- [some jar files required by my app]&lt;br /&gt; |&lt;br /&gt; |&lt;br /&gt; |--- MyApp.war&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So first step would be package the upgraded Hibernate jar files in the application (MyApp.ear). Its crucial to understand that you have to be absolutely sure that you have packaged all the required hibernate jars and the correct versions of those jars in your application. &lt;a href="http://www.hibernate.org/6.html#A3"&gt;This&lt;/a&gt; Hibernate compatibility matrix will help you in picking up the correct versions. However, you still have to know "which" hibernate jars you need to package in the application. &lt;br /&gt;&lt;br /&gt;Based on what i have seen in the forums, the issues faced while upgrading Hibernate were more related to users missing out certain dependent hibernate jar files. Debugging such issues was not very easy since, the errors that got thrown were not simple ClassNotFoundException (which you usually associate with a missing jar). Various errors like ClassCastException, NoSuchMethodException were thrown mainly because Hibernate in this version (3.2.6 GA) refactored a lot of their code to move them to different "projects". For example, the org.hibernate.search package was earlier in the "Hibernate Annotations" project (hibernate-annotations.jar) but with this new release, it was moved to a separate "Hibernate Search" project (hibernate-search.jar). Same applies to org.hibernate.validator package which earlier was in the "Hibernate Annotations" project (hibernate-annotations.jar) but with this new release, it was moved to a separate "Hibernate Validator" project.&lt;br /&gt;&lt;br /&gt;So how does it matter if those hibernate packages were moved to a different project (jar)? Here's a very brief explanation of what happens:&lt;br /&gt;&lt;br /&gt;- JBoss, in its lib folder, has an older version of Hibernate (3.2.4) and other hibernate related jar files, including the hibernate-annotations.jar. In this version, the hibernate-annotations.jar contained the org.hibernate.search and org.hibernate.validator and various other packages.&lt;br /&gt;&lt;br /&gt;- You decide to upgrade Hibernate in your application by packaging the hibernate jars in your application and enabling classloader configuration. You package *only* the latest version of core hibernate jar, the hibernate-annotations.jar and maybe even the hibernate-entitymanager.jar.&lt;br /&gt;Note: You have NOT packaged the hibernate-validator.jar nor the hibernate-search.jar.&lt;br /&gt;&lt;br /&gt;- You start JBoss and the server tries to deploy your application. While deploying, for configuring Hibernate, various Hibernate classes are used, which includes the classes belonging to core hibernate jar and also org.hibernate.validator and org.hibernate.search packages. &lt;br /&gt;&lt;br /&gt;- Since you have configured classloader scoping for your application, JBoss loads the hibernate core classes, the hibernate entitymanager classes and the hibernate annotation classes from the upgraded jars packaged in your application.&lt;br /&gt;&lt;br /&gt;- But when a class belonging to org.hibernate.validator or org.hibernate.search package is being requested for, JBoss sees that these classes are not present the jars packaged in your application. So it delegates the classloading to the parent classloader which looks for the classes in the jar files present in the JBoss lib folder (%JBOSS_HOME%/server/&lt; serverName&gt;/lib folder). Here it finds that these packages are present in the hibernate-annotations.jar (older version) and loads those classes from there. While doing so, it also loads the related classes from various other hibernate packages (which might already have been loaded by a different classloader - remember the classes loaded from the jars in your application). Ultimately, this results to the same classes being loaded twice by different classloaders. Later on when you access these classes in your application you might run into ClassCastExceptions.&lt;br /&gt;&lt;br /&gt;This is just one example of what might go wrong. Infact, you might not get a clear picture based on this brief explanation. So if you are interested in understanding better (and have some time), then go through these forum discussions which have a lot more details (and which actually made me come up with this article):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;t=120419&amp;postdays=0&amp;postorder=asc&amp;start=10"&gt;ClassCastException for org.hibernate.search.event.FullTextIndexEventListener&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;t=133202"&gt;Again the ClassCastException for org.hibernate.search.event.FullTextIndexEventListener&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;t=140725&amp;postdays=0&amp;postorder=asc&amp;start=0"&gt;This time a NoSuchMethodException: org.hibernate.validator.ClassValidator.&lt;init&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So now that we have seen what kind of issues you might run into while upgrading, let's now come back to our original plan of upgrading hibernate :)&lt;br /&gt;&lt;br /&gt;1) Enable classloader scoping through jboss-app.xml:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;jboss-app&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;loader-repository&amp;gt;&lt;br /&gt;   org.myapp:loader=SomeClassloader&lt;br /&gt;   &amp;lt;loader-repository-config&amp;gt;&lt;br /&gt;      java2ParentDelegation=false&lt;br /&gt;   &amp;lt;/loader-repository-config&amp;gt;&lt;br /&gt; &amp;lt;/loader-repository&amp;gt; &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&amp;lt;/jboss-app&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note: The string org.myapp:loader=SomeClassloader is any unique ObjectName&lt;br /&gt;&lt;br /&gt;2) Include the following jar files in the application package:&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&lt;br /&gt;Hibernate Core jar (3.2.6 GA)&lt;br /&gt;Hibernate Annotations jar (3.2.x or 3.3.x)&lt;br /&gt;Hibernate EntityManager jar (3.2.x or 3.3.x)&lt;br /&gt;Hibernate Validator jar (3.0.x)&lt;br /&gt;Hibernate Search jar (3.0.x)&lt;br /&gt;and maybe even Lucene Core jar (lucene-core-2.2.0.jar)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note: Please follow &lt;a href="http://www.hibernate.org/6.html"&gt;this&lt;/a&gt; page for downloading and figuring out the correct version of hibernate jars required (compatibility matrix).&lt;br /&gt;&lt;br /&gt;So this is how your application packaging will look like finally:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;MyApp.ear&lt;br /&gt; |&lt;br /&gt; |--- META-INF&lt;br /&gt; |     |&lt;br /&gt; |     |&lt;br /&gt; |     |--- application.xml&lt;br /&gt; |     | &lt;br /&gt; |     |--- jboss-app.xml&lt;br /&gt; |&lt;br /&gt; |&lt;br /&gt; |--- lib&lt;br /&gt; |     |&lt;br /&gt; |     |--- [some jar files required by my app]&lt;br /&gt; |     |&lt;br /&gt; |     |--- hibernate3.jar (the hibernate core jar)&lt;br /&gt; |     | &lt;br /&gt; |     |--- hibernate-annotations.jar &lt;br /&gt; |     |&lt;br /&gt; |     |--- hibernate-entitymanager.jar &lt;br /&gt; |     |  &lt;br /&gt; |     |--- hibernate-validator.jar &lt;br /&gt; |     |&lt;br /&gt; |     |--- hibernate-search.jar &lt;br /&gt; |     |&lt;br /&gt; |     |--- lucene-core-2.2.0.jar&lt;br /&gt; | &lt;br /&gt; |&lt;br /&gt; |--- MyApp.war&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;That's it! The upgrade itself is simple enough. Note that, in this article, i have used an EAR as an example, but this applies to WAR files too. In WAR files, the jars will be placed in the WEB-INF/lib folder and the classloader configuration will be done through the jboss-web.xml file which will be in WEB-INF folder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-8396523203424873234?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/8396523203424873234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=8396523203424873234' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/8396523203424873234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/8396523203424873234'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2008/08/how-to-upgrade-hibernate-in-jboss.html' title='How to upgrade Hibernate in JBoss'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7849849994570325313</id><published>2008-07-12T10:53:00.000+05:30</published><updated>2008-07-12T11:06:34.471+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>SyntaxHighlighter - Great and simple to use javascript utility</title><content type='html'>This had been on my todo list for a long time now. I finally got the &lt;a href="http://code.google.com/p/syntaxhighlighter/"&gt;SyntaxHighlighter&lt;/a&gt; integrated in this blog. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Most of my posts in this blog include java code or xml content. And i always used to spend most of my time formatting the way the java code was rendered in the blog. I wont have to worry about that anymore. I am very much impressed by this excellent yet simple piece of utility! I have edited &lt;a href="http://jaitechwriteups.blogspot.com/2006/12/simple-webservice-on-jboss-using-axis.html"&gt;some of my earlier posts in the blog&lt;/a&gt; to make use of the &lt;a href="http://code.google.com/p/syntaxhighlighter/"&gt;SyntaxHighlighter&lt;/a&gt;. Editing wasn't a big deal. It was as simple as adding a "name" and "class" attribute to the "pre" tags.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7849849994570325313?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7849849994570325313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7849849994570325313' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7849849994570325313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7849849994570325313'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2008/07/syntaxhighlighter-great-and-simple-to.html' title='SyntaxHighlighter - Great and simple to use javascript utility'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-961658827782776693</id><published>2008-04-19T16:20:00.000+05:30</published><updated>2008-07-12T22:37:15.885+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Log4j'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>How do i use my own log4j properties or xml file in JBoss</title><content type='html'>This article is mainly for those who had a hard time configuring "their own" log4j.properties or log4j.xml within their application on JBoss. For a brief background on this, please read through this &lt;a href="http://wiki.jboss.org/wiki/ScopedLoggingConfig"&gt;JBoss wiki&lt;/a&gt;. As explained in that wiki, JBoss uses its own version of log4j.xml and log4j jar, making it difficult to use your own version of the log4j properties/xml files. The wiki also lists down the steps required to configure your application to use its own log4j config file. However, i have seen people complain in the forums that those steps either dont work for them or the steps are too involved and not worth a try.&lt;br /&gt;&lt;br /&gt;People at JBoss had taken note of these issues (see the &lt;a href="http://jira.jboss.org/jira/browse/JBAS-1853"&gt;related JIRA&lt;/a&gt;) and starting JBoss-4.2.x, the steps involved to configure your own log4j config file in JBoss are pretty simple and straight-forward. In this example, i will try to explain these steps for a EAR file as well as a WAR file. The version that i am using here is JBoss-4.2.2GA (which is the latest stable version at this point). In the examples here, i use a log4j.properties file. The steps are the same even for a log4j.xml.&lt;br /&gt;&lt;br /&gt;So here's what is required to get it working in a EAR file:&lt;br /&gt;&lt;br /&gt;1) Create a log4j.properties and package it with your application and make it available in the classpath (i placed the log4j.properties file at the root of the EAR file). &lt;br /&gt;&lt;br /&gt;2) Also package the appropriate version of log4j jar with your application (this step and the next step are important because you will have to ensure that log4j initializes separately for your application and picks up the log4j.properties file). Place this log4j jar file in the application package so that it is made available in the classpath (i placed it in a folder named lib of the EAR file - remember that any jars in the lib folder of the EAR are by default added to the classpath and made available to the entire application, starting JBoss-4.2.x version).&lt;br /&gt;&lt;br /&gt;3) Enable classloader isolation for your application. This is necessary as explained in step#2. You will have to create a jboss-app.xml file and place it in the META-INF folder of the EAR. The jboss-app.xml looks like:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;jboss-app&amp;gt;&lt;br /&gt; &amp;lt;loader-repository&amp;gt;&lt;br /&gt;   org.myapp:loader=MyClassLoader&lt;br /&gt;   &amp;lt;loader-repository-config&amp;gt;&lt;br /&gt;      java2ParentDelegation=false&lt;br /&gt;   &amp;lt;/loader-repository-config&amp;gt;&lt;br /&gt; &amp;lt;/loader-repository&amp;gt;&lt;br /&gt;   &lt;br /&gt;&amp;lt;/jboss-app&amp;gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;This is how the EAR file would look like:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;myApp.ear&lt;br /&gt;  |&lt;br /&gt;  |--- log4j.properties&lt;br /&gt;  |&lt;br /&gt;  |--- META-INF&lt;br /&gt;  |     |&lt;br /&gt;  |     |--- application.xml&lt;br /&gt;  |     |&lt;br /&gt;  |     |--- jboss-app.xml&lt;br /&gt;  |&lt;br /&gt;  |--- lib&lt;br /&gt;  |     |&lt;br /&gt;  |     |--- log4jxxx.jar &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;That's it! Your application now will use it own version of log4j config file as well log4j jar.&lt;br /&gt;&lt;br /&gt;Steps involved for a WAR file are similar (If the WAR file is part of an EAR file, then you don't have to follow the steps below. The steps mentioned above for an EAR file are sufficient for a WAR inside an EAR):&lt;br /&gt;&lt;br /&gt;1) Create a log4j.properties and package it with your application and make it available in the classpath (i placed the log4j.properties file in the WEB-INF/classes folder of the WAR).&lt;br /&gt;&lt;br /&gt;2) Also package the appropriate version of log4j jar with your application (this step and the next step are important because you will have to ensure that log4j initializes separately for your application and picks up the log4j.properties file). Place this log4j jar file in the application package so that it is made available in the classpath (i placed it in a WEB-INF/lib of the WAR file).&lt;br /&gt;&lt;br /&gt;3) Enable classloader isolation for your application. This is necessary as explained in step#2. You will have to create a jboss-web.xml file and place it in the WEB-INF folder of the WAR. The jboss-web.xml looks like:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;jboss-web&amp;gt;&lt;br /&gt;    &amp;lt;class-loading java2ClassLoadingCompliance="false"&amp;gt;&lt;br /&gt; &amp;lt;loader-repository&amp;gt;&lt;br /&gt; org.myapp:loader=MyClassLoader&lt;br /&gt; &amp;lt;loader-repository-config&amp;gt;java2ParentDelegation=false&amp;lt;/loader-repository-config&amp;gt;&lt;br /&gt; &amp;lt;/loader-repository&amp;gt;&lt;br /&gt; &amp;lt;/class-loading&amp;gt;&lt;br /&gt;&amp;lt;/jboss-web&amp;gt;  &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;This is how the WAR file would look like:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;myApp.war&lt;br /&gt;  |&lt;br /&gt;  |--- WEB-INF&lt;br /&gt;  |     |&lt;br /&gt;  |     |--- web.xml&lt;br /&gt;  |     |&lt;br /&gt;  |     |--- jboss-web.xml&lt;br /&gt;  |     |&lt;br /&gt;  |     |--- classes&lt;br /&gt;  |     |     |&lt;br /&gt;  |     |     |--- log4j.properties&lt;br /&gt;  | &lt;br /&gt;  |&lt;br /&gt;  |--- lib&lt;br /&gt;  |     |&lt;br /&gt;  |     |--- log4jxxx.jar &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-961658827782776693?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/961658827782776693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=961658827782776693' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/961658827782776693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/961658827782776693'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2008/04/how-do-i-use-my-own-log4j-properties-or.html' title='How do i use my own log4j properties or xml file in JBoss'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7300413982975113399</id><published>2007-10-06T13:37:00.001+05:30</published><updated>2008-07-12T22:39:15.722+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Why do i get NameNotFoundException while doing a JNDI lookup?</title><content type='html'>Many a times when you are doing a lookup in the JNDI tree, you see javax.naming.NameNotFoundException. A simple code that does the lookup will look something like:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Context ctx = new InitialContext();&lt;br /&gt;Object obj = ctx.lookup("somepath/somename");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This code just looks up the JNDI tree to get an object bound by the name "somepath/somename". Looks simple. However, chances are that you might even see this exception:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;javax.naming.NameNotFoundException: &lt;b&gt;somepath&lt;/b&gt; not bound&lt;br /&gt; at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)&lt;br /&gt; at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)&lt;br /&gt; at org.jnp.server.NamingServer.getObject(NamingServer.java:543)&lt;br /&gt; at org.jnp.server.NamingServer.lookup(NamingServer.java:267)&lt;br /&gt; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;br /&gt; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)&lt;br /&gt; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)&lt;br /&gt; at java.lang.reflect.Method.invoke(Method.java:585)&lt;br /&gt; at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)&lt;br /&gt; at sun.rmi.transport.Transport$1.run(Transport.java:153)&lt;br /&gt; at java.security.AccessController.doPrivileged(Native Method)&lt;br /&gt; at sun.rmi.transport.Transport.serviceCall(Transport.java:149)&lt;br /&gt; at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)&lt;br /&gt; at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)&lt;br /&gt; at java.lang.Thread.run(Thread.java:595)&lt;br /&gt; at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)&lt;br /&gt; at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)&lt;br /&gt; at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)&lt;br /&gt; at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)&lt;br /&gt; at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)&lt;br /&gt; at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)&lt;br /&gt; at javax.naming.InitialContext.lookup(InitialContext.java:351)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Look closely at the stacktrace. It shows that while looking up the JNDI tree it could not find the jndi name "somepath" (this name may vary). The reason is simple, the JNDI tree does not have any object bound by this name. &lt;br /&gt;&lt;br /&gt;To quote the javadocs of this exception "This exception is thrown when a component of the name cannot be resolved because it is not bound."&lt;br /&gt;&lt;br /&gt;So how do i know, what's the name to which my object is bound? Each application server, usually provides a JNDI view which can be used to see the contents of the JNDI tree. If you know what object you are looking for (ex: the name of the bean), then you can traverse this JNDI tree to see what name it is bound to. The JNDI view is specific to every application server.&lt;br /&gt;&lt;br /&gt;To give an example, JBoss provides its JDNI tree view, through the JMX console. Here are the steps, one has to follow to check the JNDI tree contents on JBoss:&lt;br /&gt;&lt;br /&gt;- Go to http://&lt; server&gt;:&lt; port&gt;/jmx-console (Ex: http://localhost:8080/jmx-console)&lt;br /&gt;- Search for service=JNDIView on the jmx-console page&lt;br /&gt;- Click on that link&lt;br /&gt;- On the page that comes up click on the &lt;i&gt;Invoke&lt;/i&gt; button beside the &lt;i&gt;list()&lt;/i&gt; method&lt;br /&gt;- The page that comes up will show the contents of the JNDI tree. &lt;br /&gt;&lt;br /&gt;Here's an sample of how the output looks like(just a small part of the entire output):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;java: Namespace&lt;br /&gt;&lt;br /&gt;  +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)&lt;br /&gt;  +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)&lt;br /&gt;  +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)&lt;br /&gt;  +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)&lt;br /&gt;  +- comp (class: javax.naming.Context)&lt;br /&gt;  +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)&lt;br /&gt;  +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)&lt;br /&gt;  +- jaas (class: javax.naming.Context)&lt;br /&gt;  |   +- dukesbank (class: org.jboss.security.plugins.SecurityDomainContext)&lt;br /&gt;  |   +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)&lt;br /&gt;  |   +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)&lt;br /&gt;  |   +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Global JNDI Namespace&lt;br /&gt;&lt;br /&gt;  +- ebankTxController (proxy: $Proxy79 implements interface com.sun.ebank.ejb.tx.TxControllerHome,interface javax.ejb.Handle)&lt;br /&gt;  +- ebankAccountController (proxy: $Proxy75 implements interface com.sun.ebank.ejb.account.AccountControllerHome,interface javax.ejb.Handle)&lt;br /&gt;  +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)&lt;br /&gt;  +- jmx (class: org.jnp.interfaces.NamingContext)&lt;br /&gt;  |   +- invoker (class: org.jnp.interfaces.NamingContext)&lt;br /&gt;  |   |   +- RMIAdaptor (proxy: $Proxy48 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)&lt;br /&gt;  |   +- rmi (class: org.jnp.interfaces.NamingContext)&lt;br /&gt;  |   |   +- RMIAdaptor[link -&gt; jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)&lt;br /&gt;  +- HTTPXAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)&lt;br /&gt;  +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)&lt;br /&gt;  +- ebankCustomer (proxy: $Proxy67 implements interface com.sun.ebank.ejb.customer.LocalCustomerHome)&lt;br /&gt;  +- UserTransactionSessionFactory (proxy: $Proxy14 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)&lt;br /&gt;  +- ebankCustomerController (proxy: $Proxy77 implements interface com.sun.ebank.ejb.customer.CustomerControllerHome,interface javax.ejb.Handle)&lt;br /&gt;  +- HTTPConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)&lt;br /&gt;  +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)&lt;br /&gt;  +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)&lt;br /&gt;  +- ebankAccount (proxy: $Proxy68 implements interface com.sun.ebank.ejb.account.LocalAccountHome)&lt;br /&gt;  +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)&lt;br /&gt;  +- UILXAConnectionFactory[link -&gt; XAConnectionFactory] (class: javax.naming.LinkRef)&lt;br /&gt;  +- UIL2XAConnectionFactory[link -&gt; XAConnectionFactory] (class: javax.naming.LinkRef)&lt;br /&gt;  +- queue (class: org.jnp.interfaces.NamingContext)&lt;br /&gt;  |   +- A (class: org.jboss.mq.SpyQueue)&lt;br /&gt;  |   +- testQueue (class: org.jboss.mq.SpyQueue)&lt;br /&gt;  |   +- ex (class: org.jboss.mq.SpyQueue)&lt;br /&gt;  |   +- DLQ (class: org.jboss.mq.SpyQueue)&lt;br /&gt;  |   +- D (class: org.jboss.mq.SpyQueue)&lt;br /&gt;  |   +- C (class: org.jboss.mq.SpyQueue)&lt;br /&gt;  |   +- B (class: org.jboss.mq.SpyQueue)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Let's see what this tells us. Let's consider the Global JNDI Namespace first. It contains (among other things) the following:&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;+- ebankTxController (proxy: $Proxy79 implements interface com.sun.ebank.ejb.tx.TxControllerHome,interface javax.ejb.Handle)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This tells me that an object which implements com.sun.ebank.ejb.tx.TxControllerHome and javax.ejb.Handle interfaces is bound to the JNDI tree by the jndi-name "ebankTxController". So if at all i have to lookup this object, my lookup code would be something like:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Context ctx = new InitialContext();&lt;br /&gt;ctx.lookup("ebankTxController");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Similarly in the same Global JDNI Namespace, we see :&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;+- queue (class: org.jnp.interfaces.NamingContext)&lt;br /&gt;  |   +- A (class: org.jboss.mq.SpyQueue)&lt;br /&gt;  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Make note of the nesting of the names here. This tells me that an object of type org.jboss.mq.SpyQueue is bound by the name "A under the path queue". So your lookup for this object should look like:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Context ctx = new InitialContext();&lt;br /&gt;ctx.lookup("queue/A");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now let's move on to the java: namespace in the JNDI tree view above. The difference between a Global JNDI namespace and the java: namespace is that, the object bound in the java: namespace can be looked-up ONLY by clients within the SAME JVM. Whereas, in case of Global JNDI namespace, the objects bound in this namespace can be looked-up by clients, even if they are not in the same JVM as the server. One would ask, how does this matter? Consider a standalone java program(client) which tries to lookup some object on the server (running in its own JVM). Whenever a standalone client is started (using the java command), a new JVM is instantiated. As a result, the server (which is started in its own JVM) and the client are running on different JVMs. Effectively, the client will NOT be able to lookup objects bound in the java: namespace of the server. However, the client can lookup the objects present in the Global JNDI namespace of the server.&lt;br /&gt;&lt;br /&gt;So, why are we discussing these details, in a topic which was meant to explain the NameNotFoundException? Let's consider the java: namespace output above. There's a &lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;+- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This tells me that there's an object bound to the name DefaultDS in the java: namespace. So my lookup code would be:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Context ctx = new InitialContext();&lt;br /&gt;ctx.lookup("java:/DefaultDS");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As explained above, this code is going to return you the object, if this piece of code runs in the same JVM as the server. However, if this piece of code is run from a client in different JVM (maybe a standalone client), then it's going to run into NameNotFoundException. The reason i explained the java: and the Global JNDI namespace is that, sometimes people are surprised that even though the JNDI view shows that the object is bound in the java: namespace(with the same name as the one they pass to the lookup method), they still run into NameNotFoundException. The probable reason might be, the client is in a different JVM.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7300413982975113399?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7300413982975113399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7300413982975113399' title='33 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7300413982975113399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7300413982975113399'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2007/10/why-do-i-get-namenotfoundexception.html' title='Why do i get NameNotFoundException while doing a JNDI lookup?'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>33</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-2048504929183242270</id><published>2007-04-18T16:29:00.000+05:30</published><updated>2008-07-12T22:13:01.510+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Webservice'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Webservice client using dynamic proxy</title><content type='html'>In one of my &lt;a href="http://jaitechwriteups.blogspot.com/2006/12/simple-webservice-on-jboss-using-axis.html"&gt;previous posts&lt;/a&gt;, i explained how to create a WebService and access it from a simple client. If you look at the client code which accesses the webservice, you will find that the client is using the stubs that were created at deploy time. Such clients which use "static stubs" for accessing webservices are known as "Static Stub Clients". In such approach, the clients will have to have the stubs in their classpath. &lt;br /&gt;&lt;br /&gt;Another approach of accessing the webservices is through Dynamic Proxies where the proxies are generated at runtime. I will be showing a simple client which uses dynamic proxies to access an webservice. I wont be explaining the steps to deploy the webservice (which i have already done in &lt;a href="http://jaitechwriteups.blogspot.com/2006/12/simple-webservice-on-jboss-using-axis.html"&gt;my other post&lt;/a&gt;). This example assumes that the webservice is already deployed on the server.&lt;br /&gt;&lt;br /&gt;The client code will be accessing the HelloWorld service and invoking the sayHelloTo method on that service (Refer &lt;a href="http://jaitechwriteups.blogspot.com/2006/12/simple-webservice-on-jboss-using-axis.html"&gt;my other post&lt;/a&gt; to see how the service has been deployed onto the server)&lt;br /&gt;&lt;br /&gt;Here's the code for the client:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package org.myapp.service.client;&lt;br /&gt;&lt;br /&gt;import java.net.MalformedURLException;&lt;br /&gt;import java.net.URL;&lt;br /&gt;&lt;br /&gt;import javax.xml.namespace.QName;&lt;br /&gt;import javax.xml.rpc.Service;&lt;br /&gt;import javax.xml.rpc.ServiceException;&lt;br /&gt;import javax.xml.rpc.ServiceFactory;&lt;br /&gt;&lt;br /&gt;import org.myapp.service.HelloWorldService;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Simple webservice client which uses dynamic proxy&lt;br /&gt; *&lt;br /&gt; * @author Jaikiran Pai&lt;br /&gt; */&lt;br /&gt;public class DynamicProxyClient {&lt;br /&gt;&lt;br /&gt;    public static void main(String args[]) {&lt;br /&gt;&lt;br /&gt;        try {&lt;br /&gt;            &lt;br /&gt;            // ServiceFactory instance&lt;br /&gt;            ServiceFactory serviceFactory = ServiceFactory.newInstance();&lt;br /&gt;            System.out.println("Got the service factory");&lt;br /&gt;            String wsdlURLString = "http://localhost:8080/axis/services/HelloWorld?wsdl";&lt;br /&gt;            URL wsdlURL = new URL(wsdlURLString);&lt;br /&gt;            String serviceName = "HelloWorldServiceService";&lt;br /&gt;            String nameSpaceURI = "http://jaikiran.com";&lt;br /&gt;            String portName = "HelloWorld";&lt;br /&gt;            // get hold of the service by passing the URL of the wsdl and the&lt;br /&gt;            // service name&lt;br /&gt;            Service service = serviceFactory.createService(wsdlURL, new QName(&lt;br /&gt;                    nameSpaceURI, serviceName));&lt;br /&gt;            System.out.println("Got the service: " + service);&lt;br /&gt;            // create the service proxy&lt;br /&gt;            HelloWorldService serviceProxy = (HelloWorldService) service&lt;br /&gt;                    .getPort(new QName(nameSpaceURI, portName),&lt;br /&gt;                            HelloWorldService.class);&lt;br /&gt;            System.out.println("Got the service proxy: " + serviceProxy);&lt;br /&gt;            System.out.println("Invoking method on service proxy........");&lt;br /&gt;            System.out.println(serviceProxy.sayHelloTo("Dynamic user"));&lt;br /&gt;&lt;br /&gt;        } catch (ServiceException e) {&lt;br /&gt;            // TODO Auto-generated catch block&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        } catch (MalformedURLException e) {&lt;br /&gt;            // TODO Auto-generated catch block&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;1) Our first step would be to create a ServiceFactory instance, using which we can get access to a deployed service.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;ServiceFactory serviceFactory = ServiceFactory.newInstance();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2) Once the ServiceFactory has been created, we will be getting hold of the service which is deployed on the server. To do this, we require&lt;br /&gt; a) The url of the wsdl of the deployed service. In this example it will be http://localhost:8080/axis/services/HelloWorld?wsdl&lt;br /&gt; &lt;br /&gt; b) The namespace uri. In this example it will be http://jaikiran.com (You can get this uri from the wsdl file)&lt;br /&gt; &lt;br /&gt; c) The name of the service which you want to access. In this example it will be HelloWorldServiceService&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;String wsdlURLString = "http://localhost:8080/axis/services/HelloWorld?wsdl";&lt;br /&gt;URL wsdlURL = new URL(wsdlURLString);&lt;br /&gt;String serviceName = "HelloWorldServiceService";&lt;br /&gt;String nameSpaceURI = "http://jaikiran.com";&lt;br /&gt;&lt;br /&gt;// get hold of the service by passing the URL of the wsdl and the&lt;br /&gt;// service name&lt;br /&gt;Service service = serviceFactory.createService(wsdlURL, new QName(&lt;br /&gt;                    nameSpaceURI, serviceName));&lt;br /&gt;                    &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3) At this point you have got access to the service. But in order to invoke an method on the service, you will have to create a proxy (dynamic proxy) from this service. The Service class, has an API getPort, which creates the proxy. In order to create the proxy, we will have to pass the portName of the service (again, this can be obtained in the wsdl file), the namespace uri and the class type of the service. In this example the service interface is org.myapp.service.HelloWorldService, so we will be passing this as the class as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;String portName = "HelloWorld";&lt;br /&gt;// create the service proxy&lt;br /&gt;HelloWorldService serviceProxy = (HelloWorldService) service&lt;br /&gt;                    .getPort(new QName(nameSpaceURI, portName),&lt;br /&gt;                     org.myapp.service.HelloWorldService.class);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;                     &lt;br /&gt;4) At this point we have got the service proxy which is of type org.myapp.service.HelloWorldService. We can now invoke our sayHelloTo method on this proxy:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;System.out.println(serviceProxy.sayHelloTo("Dynamic user"));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Simple, isnt it? You have successfully invoked the webservice through a standalone client using dynamic proxy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-2048504929183242270?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/2048504929183242270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=2048504929183242270' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2048504929183242270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2048504929183242270'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2007/04/webservice-client-using-dynamic-proxy.html' title='Webservice client using dynamic proxy'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-8173928952828911221</id><published>2007-01-04T19:31:00.000+05:30</published><updated>2008-07-12T10:40:23.596+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><title type='text'>How to read a properties file in a web application</title><content type='html'>The code to do this is pretty simple. But going by the number of people who keep asking this question, i thought i would post the code over here. Let's consider that you have a war file named SampleApp.war which has a properties file named myApp.properties at it's root : &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;SampleApp.war&lt;br /&gt;   |&lt;br /&gt;   |-------- myApp.properties&lt;br /&gt;   |&lt;br /&gt;   |-------- WEB-INF&lt;br /&gt;                |&lt;br /&gt;                |---- classes&lt;br /&gt;                         |&lt;br /&gt;                         |----- org&lt;br /&gt;                                 |------ myApp&lt;br /&gt;                                           |------- MyPropertiesReader.class&lt;br /&gt;                                           &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;                               &lt;br /&gt;   &lt;br /&gt;Let's assume that you want to read the property named "abc" present in the properties file:&lt;br /&gt;&lt;br /&gt;----------------&lt;br /&gt;myApp.properties:&lt;br /&gt;----------------&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;abc=some value&lt;br /&gt;xyz=some other value&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Let's consider that the class org.myApp.MyPropertiesReader present in your application wants to read the property. Here's the code for the same:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&lt;br /&gt;package org.myapp;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.InputStream;&lt;br /&gt;import java.util.Properties;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * Simple class meant to read a properties file&lt;br /&gt; * &lt;br /&gt; * @author Jaikiran Pai&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;public class MyPropertiesReader {&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Default Constructor&lt;br /&gt;     * &lt;br /&gt;     */&lt;br /&gt;    public MyPropertiesReader() {&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Some Method&lt;br /&gt;     * &lt;br /&gt;     * @throws IOException&lt;br /&gt;     * &lt;br /&gt;     */&lt;br /&gt;    public void doSomeOperation() throws IOException {&lt;br /&gt;        // Get the inputStream&lt;br /&gt;        InputStream inputStream = this.getClass().getClassLoader()&lt;br /&gt;                .getResourceAsStream("myApp.properties");&lt;br /&gt;&lt;br /&gt;        Properties properties = new Properties();&lt;br /&gt;&lt;br /&gt;        System.out.println("InputStream is: " + inputStream);&lt;br /&gt;&lt;br /&gt;        // load the inputStream using the Properties&lt;br /&gt;        properties.load(inputStream);&lt;br /&gt;        // get the value of the property&lt;br /&gt;        String propValue = properties.getProperty("abc");&lt;br /&gt;&lt;br /&gt;        System.out.println("Property value is: " + propValue);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Pretty straight-forward. Now suppose the properties file is not at the root of the application, but inside a folder (let's name it config) in the web application, something like:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;SampleApp.war&lt;br /&gt;   |&lt;br /&gt;   |-------- config&lt;br /&gt;   |           |------- myApp.properties   &lt;br /&gt;   |           &lt;br /&gt;   |&lt;br /&gt;   |-------- WEB-INF&lt;br /&gt;                |&lt;br /&gt;                |---- classes&lt;br /&gt;                         |&lt;br /&gt;                         |----- org&lt;br /&gt;                                 |------ myApp&lt;br /&gt;                                           |------- MyPropertiesReader.class&lt;br /&gt;                                           &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There will just be one line change in the above code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;&lt;br /&gt;  public void doSomeOperation() throws IOException {&lt;br /&gt;        //Get the inputStream--&amp;gt;This time we have specified the folder name too.&lt;br /&gt;        InputStream inputStream = this.getClass().getClassLoader()&lt;br /&gt;                .getResourceAsStream("config/myApp.properties");&lt;br /&gt;        &lt;br /&gt;        Properties properties = new Properties();&lt;br /&gt;         &lt;br /&gt;        System.out.println("InputStream is: " + inputStream);&lt;br /&gt;        &lt;br /&gt;        //load the inputStream using the Properties&lt;br /&gt;        properties.load(inputStream);&lt;br /&gt;        //get the value of the property&lt;br /&gt;        String propValue = properties.getProperty("abc");&lt;br /&gt;        &lt;br /&gt;        System.out.println("Property value is: " + propValue);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt; That's all that is required to get it working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-8173928952828911221?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/8173928952828911221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=8173928952828911221' title='29 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/8173928952828911221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/8173928952828911221'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2007/01/how-to-read-properties-file-in-web.html' title='How to read a properties file in a web application'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>29</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-2296523205344856577</id><published>2006-12-10T15:37:00.000+05:30</published><updated>2008-07-12T10:47:45.349+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Webservice'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Simple Webservice on JBoss using Axis</title><content type='html'>Download the latest stable version of Axis from &lt;a href="http://ws.apache.org/axis/java/releases.html"&gt;Axis Releases&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1) Deploying Axis web application on JBoss:&lt;br /&gt;&lt;br /&gt;I used Axis 1.4 on JBoss-4.0.4 GCA. Assuming you downloaded Axis to D: , copy the "axis" folder present in D:\Axis-1.4\webapps folder to %JBOSS_HOME%\server\default\deploy folder. The "axis" folder that you copied is nothing but an web application (containing of some servlets and jsps provided by Axis). In JBoss for a web application to be deployed, it has to be named *.war, so rename the "axis" folder in  %JBOSS_HOME%\server\default\deploy to axis.war. At this point, the axis web application is ready to be deployed on JBoss. But before starting JBoss, delete the commons-logging-x.x.x.jar and log4j-x.x.x.jar present in %JBOSS_HOME%\server\default\deploy\axis.war\WEB-INF\lib directory, since JBoss maintains its own versions of these jars and packaging these jars in your application will throw exceptions of JBoss startup. After you have deleted these jars, start the JBoss server using the run.bat present in %JBOSS_HOME%\bin folder.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) Verify Axis web application is deployed and running:&lt;br /&gt;&lt;br /&gt;After JBoss has started successfully, go to the following URL to check whether axis is deployed properly:&lt;br /&gt;&lt;br /&gt;http://localhost:8080/axis&lt;br /&gt;&lt;br /&gt;If Axis was deployed successfully, you will see a welcome page which will have a few links, one of them named "List" which can be used to view the already deployed webservices. Axis by default comes with a few sample webservices which you can see on clicking the "List" link.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3) Writing our own webservice:&lt;br /&gt;&lt;br /&gt;3a - The Java classes/interfaces:&lt;br /&gt;&lt;br /&gt;Lets create a simple webservice which will echo a message to the user who passes his name. We will have an interface named HelloWorldService:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package org.myapp.service;&lt;br /&gt;&lt;br /&gt;public interface HelloWorldService {&lt;br /&gt;    &lt;br /&gt;    public String sayHelloTo(String userName);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And here's the implementing class:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package org.myapp.service;&lt;br /&gt;&lt;br /&gt;public class HelloWorldServiceImpl implements HelloWorldService {&lt;br /&gt;&lt;br /&gt;    public String sayHelloTo(String userName) {&lt;br /&gt; &lt;br /&gt; //message&lt;br /&gt;        String hello = "Hello " + userName + ". You are being watched";&lt;br /&gt;&lt;br /&gt;        System.out.println(hello);&lt;br /&gt;        &lt;br /&gt; //return the message&lt;br /&gt;        return hello;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Do you see anything special in this class or the interface? No, you wont. So how do you convert these into webservices? Read on...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3b - Create a wsdl file:&lt;br /&gt;&lt;br /&gt;Now that we have the interface and the class ready, lets create a wsdl file out of these java classes. Axis comes with utilities which allow you to create the wsdl file from a java file. I wrote a small ant target which will do this for me:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;!--  Sets classpath for build  --&amp;gt;&lt;br /&gt;&amp;lt;path id="classpath"&amp;gt;&lt;br /&gt; &amp;lt;pathelement path="${java.class.path}" /&amp;gt;&lt;br /&gt; &amp;lt;fileset dir="${lib}"&amp;gt;&lt;br /&gt;  &amp;lt;include name="**/*.jar" /&amp;gt;&lt;br /&gt; &amp;lt;/fileset&amp;gt;&lt;br /&gt; &amp;lt;pathelement path="${classes.dir}" /&amp;gt;&lt;br /&gt;&amp;lt;/path&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;taskdef name="axis-java2wsdl" classname="org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask" &amp;gt;&lt;br /&gt;         &amp;lt;classpath refid="classpath"/&amp;gt;&lt;br /&gt;&amp;lt;/taskdef&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;target name="generateWSDL" description="Generates wsdl files from the java service interfaces"&amp;gt;&lt;br /&gt; &amp;lt;mkdir dir="${wsdl.dir}"/&amp;gt;&lt;br /&gt; &amp;lt;axis-java2wsdl classpathref="classpath"&lt;br /&gt;   output="${wsdl.dir}/HelloWorld.wsdl"&lt;br /&gt;   location="http://localhost:8080/axis/services/HelloWorld"&lt;br /&gt;   namespace="http://jaikiran.com"&lt;br /&gt;   classname="org.myapp.service.HelloWorldService"&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;mapping namespace="http://jaikiran.com" package="org.myapp.service"/&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;/axis-java2wsdl&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note: You can find the entire build.xml, that i used, at the end of this article.&lt;br /&gt;&lt;br /&gt;You will require the org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask class which is provided by axis to be in the classpath of Ant. This class comes  bundled in the axis-ant.jar which i have included in the classpath of this task using the classpathref.&lt;br /&gt;&lt;br /&gt;In this target you specify parameters like:&lt;br /&gt;location - this is where the webservice will be deployed.&lt;br /&gt;namespace - the namespace for your webservice&lt;br /&gt;classname - the fully qualified name of the interface which you wrote in step 3a, above.&lt;br /&gt;and also a mapping between the webservice namespace and your application packages.&lt;br /&gt;&lt;br /&gt;This target will generate the wsdl file named HelloWorld.wsdl in the directory which you specified in the 'output' parameter of the target.&lt;br /&gt;&lt;br /&gt;3c - Create the deploy.wsdd, undeploy.wsdd and the stubs:&lt;br /&gt;&lt;br /&gt;Now that you have created a wsdl for your webservice, lets go ahead and create the deploy.wsdd (used for deploying a webservice on the server), undeploy.wsdd (used for undeploying a webservice from the server) and the required stubs for invoking the webservice from a java client.&lt;br /&gt;Again, Axis provides utilities for creating these files. Axis accepts the wsdl file, which we created in step 3b as an input to create these files. Here's the Ant target which does this for us:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;taskdef name="axis-wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask" &amp;gt;&lt;br /&gt; &amp;lt;classpath refid="classpath"/&amp;gt;&lt;br /&gt;&amp;lt;/taskdef&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;target name="generateWSDD" description="Generates wsdd files from the wsdl files"&amp;gt;&lt;br /&gt; &amp;lt;mkdir dir="${wsdd.dir}"/&amp;gt;&lt;br /&gt; &amp;lt;axis-wsdl2java&lt;br /&gt;       output="${wsdd.dir}"&lt;br /&gt;       deployscope="Application"&lt;br /&gt;       serverside="true"&lt;br /&gt;       url="${wsdl.dir}\HelloWorld.wsdl"&amp;gt;&lt;br /&gt; &amp;lt;/axis-wsdl2java&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This single target creates the deploy.wsdd, undeploy.wsdd and the stubs. As already mentioned, this target takes the wsdl file as an input which we have specified in the 'url' parameter of the axis-wsdl2java target. The files will be created in the directory mentioned in the 'output' parameter of this target. The deploy.wsdd file that gets generated will contain something like:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;!-- Use this file to deploy some handlers/chains and services      --&amp;gt;&lt;br /&gt;&amp;lt;!-- Two ways to do this:                                           --&amp;gt;&lt;br /&gt;&amp;lt;!--   java org.apache.axis.client.AdminClient deploy.wsdd          --&amp;gt;&lt;br /&gt;&amp;lt;!--      after the axis server is running                          --&amp;gt;&lt;br /&gt;&amp;lt;!-- or                                                             --&amp;gt;&lt;br /&gt;&amp;lt;!--   java org.apache.axis.utils.Admin client|server deploy.wsdd   --&amp;gt;&lt;br /&gt;&amp;lt;!--      from the same directory that the Axis engine runs         --&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;deployment&lt;br /&gt;    xmlns="http://xml.apache.org/axis/wsdd/"&lt;br /&gt;    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;!-- Services from HelloWorldServiceService WSDL service --&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;service name="HelloWorld" provider="java:RPC" style="rpc" use="encoded"&amp;gt;&lt;br /&gt;      &amp;lt;parameter name="wsdlTargetNamespace" value="http://jaikiran.com"/&amp;gt;&lt;br /&gt;      &amp;lt;parameter name="wsdlServiceElement" value="HelloWorldServiceService"/&amp;gt;&lt;br /&gt;      &amp;lt;parameter name="wsdlServicePort" value="HelloWorld"/&amp;gt;&lt;br /&gt;      &amp;lt;parameter name="className" value="com.jaikiran.HelloWorldSoapBindingImpl"/&amp;gt;&lt;br /&gt;      &amp;lt;parameter name="wsdlPortType" value="HelloWorldService"/&amp;gt;&lt;br /&gt;      &amp;lt;parameter name="typeMappingVersion" value="1.2"/&amp;gt;&lt;br /&gt;      &amp;lt;operation name="sayHelloTo" qname="operNS:sayHelloTo" xmlns:operNS="http://jaikiran.com" returnQName="sayHelloToReturn" returnType="rtns:string" xmlns:rtns="http://www.w3.org/2001/XMLSchema" soapAction="" &amp;gt;&lt;br /&gt;        &amp;lt;parameter qname="in0" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/&amp;gt;&lt;br /&gt;      &amp;lt;/operation&amp;gt;&lt;br /&gt;      &amp;lt;parameter name="allowedMethods" value="sayHelloTo"/&amp;gt;&lt;br /&gt;      &amp;lt;parameter name="scope" value="Application"/&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/service&amp;gt;&lt;br /&gt;&amp;lt;/deployment&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You might notice that during all these steps we never mentioned our implementing class (HelloWorldServiceImpl) in any of the targets. As you can see above in the deploy.wsdd, Axis has created its own implementing class for the HelloWorldService and provided default implementations in that class. In the deploy.wsdd file, it mentioned the implementation class as follows:&lt;br /&gt;&lt;br /&gt;&amp;lt;parameter name="className" value="com.jaikiran.HelloWorldSoapBindingImpl"/&amp;gt;&lt;br /&gt;&lt;br /&gt;The reason why Axis created this implementing class is that it never knew that we had created our own implementation. The input that we provided to Axis for generating the wsdd files was a wsdl file through which Axis could never have known that we already have a implementation class.&lt;br /&gt;&lt;br /&gt;Our next step would be to modify the deploy.wsdd file to mention our implementation class, in place of Axis'. So let's change the 'className' parameter to:&lt;br /&gt;&lt;br /&gt;&amp;lt;parameter name="className" value="org.myapp.service.HelloWorldServiceImpl"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3d - Deploy the webservice onto the server:&lt;br /&gt;&lt;br /&gt;Now we are almost ready to deploy the webservice onto the server. But before doing that, we will have to make the HelloWorldService.class and HelloWorldServiceImpl.class available in the server's classpath so that when we use this webservice, the server wont throw ClassNotFoundException. So let's compile these 2 classes and place the class files in the %JBOSS_HOME%\server\default\deploy\axis.war\WEB-INF\classes folder. Here's the Ant target that i used to compile these classes:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;target name="compile" description="Compiles java source code"&amp;gt;&lt;br /&gt; &amp;lt;mkdir dir="${classes.dir}"/&amp;gt;&lt;br /&gt; &amp;lt;javac destdir="${classes.dir}" classpathref="classpath" fork="true" srcdir="${compile.src}" excludes="org/myapp/service/client/**/*.java"/&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once this is done, we are ready to deploy the webservice onto the server. Axis again provides a utility to do this. Here's the target for deploying the service onto the server. This target just invokes the org.apache.axis.client.AdminClient java class passing it the deploy.wsdd file as an argument.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;target name="deployWebservice" description="Deploys the webservice onto the server, using the wsdd file and Axis' AdminClient"&amp;gt;&lt;br /&gt; &amp;lt;java classname="org.apache.axis.client.AdminClient" classpathref="classpath" fork="true"&amp;gt;&lt;br /&gt;  &amp;lt;arg value="${wsdd.dir}/com/jaikiran/deploy.wsdd"/&amp;gt;&lt;br /&gt; &amp;lt;/java&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now that we have deployed the webservice, lets verify whether its deployed successfully. Let's again go to http://localhost:8080/axis . Here again lets click the "List" link to see all the available webservices. This time you will notice that our HelloWorld service is also listed over here. You can view the wsdl of this webservice, by clicking the wsdl link next to it. Our webservice has been deployed at http://localhost:8080/axis/services/HelloWorld as you can see from the wsdl contents. So let's hit this url. You will see a message like:&lt;br /&gt;&lt;br /&gt;HelloWorld&lt;br /&gt;&lt;br /&gt;Hi there, this is an AXIS service!&lt;br /&gt;Perhaps there will be a form for invoking the service here...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) Java client for accessing the webservice that we created:&lt;br /&gt;&lt;br /&gt;Let's now create a simple java client which accesses the webservice that we just deployed on the server.&lt;br /&gt;You might remember that in step 3c, we even created the stubs required to access the webservice. We will use these stubs in our java client to access the webservice. Here's the simple java client:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package org.myapp.service.client;&lt;br /&gt;&lt;br /&gt;import com.jaikiran.HelloWorldService;&lt;br /&gt;import com.jaikiran.HelloWorldServiceServiceLocator;&lt;br /&gt;&lt;br /&gt;public class ServiceClient {&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * @param args&lt;br /&gt;     */&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;        try {&lt;br /&gt;        &lt;br /&gt;            //Get hold of the webservice using the locator provided by Axis  &lt;br /&gt;            HelloWorldService helloWorldService = new HelloWorldServiceServiceLocator().getHelloWorld();&lt;br /&gt;&lt;br /&gt;     //Invoke the method on the webservice  &lt;br /&gt;            String message = helloWorldService.sayHelloTo("someUserName");&lt;br /&gt;            &lt;br /&gt;            System.out.println("Client received: " + message);&lt;br /&gt;            &lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this class you will notice that we are using HelloWorldServiceServiceLocator and the HelloWorldService which Axis generated for us. Running this client will invoke the webservice deployed on the server.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5) Ant build file&lt;br /&gt;&lt;br /&gt;Here's the complete build.xml that i used as part of this example:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;project name="MyApp" basedir=".." default="compile"&amp;gt;&lt;br /&gt; &lt;br /&gt;  &amp;lt;property name="conf.dir" location="${basedir}/conf" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="build.dir" location="${basedir}/build"/&amp;gt;&lt;br /&gt;  &amp;lt;property name="classes.dir" location="${build.dir}/classes" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="compile.src" location="${basedir}/src" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="lib" location="${basedir}/lib" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="wsdl.dir" location="${build.dir}/wsdl" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="wsdd.dir" location="${build.dir}/wsdd" /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;  &amp;lt;!--  Sets classpath for build  --&amp;gt;&lt;br /&gt;  &amp;lt;path id="classpath"&amp;gt;&lt;br /&gt;   &amp;lt;pathelement path="${java.class.path}" /&amp;gt;&lt;br /&gt;   &amp;lt;fileset dir="${lib}"&amp;gt;&lt;br /&gt;    &amp;lt;include name="**/*.jar" /&amp;gt;&lt;br /&gt;   &amp;lt;/fileset&amp;gt;&lt;br /&gt;   &amp;lt;pathelement path="${classes.dir}" /&amp;gt;&lt;br /&gt;  &amp;lt;/path&amp;gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &amp;lt;taskdef name="axis-java2wsdl" classname="org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask" &amp;gt;&lt;br /&gt;         &amp;lt;classpath refid="classpath"/&amp;gt;&lt;br /&gt;   &amp;lt;/taskdef&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;taskdef name="axis-wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask" &amp;gt;&lt;br /&gt;          &amp;lt;classpath refid="classpath"/&amp;gt;&lt;br /&gt; &amp;lt;/taskdef&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="clean-all" description="Cleans(Deletes) the contents of all output directories"&amp;gt;&lt;br /&gt;  &amp;lt;delete dir="${classes.dir}"/&amp;gt;&lt;br /&gt;  &amp;lt;delete dir="${wsdl.dir}"/&amp;gt;&lt;br /&gt;  &amp;lt;delete dir="${wsdd.dir}"/&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="build-all" description="Builds the entire project" depends="clean-all,compile,generateWSDL,generateWSDD,compileStubs,compile-client"&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;target name="compile" description="Compiles java source code"&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${classes.dir}"/&amp;gt;&lt;br /&gt;  &amp;lt;javac destdir="${classes.dir}" classpathref="classpath" fork="true" srcdir="${compile.src}" excludes="org/myapp/service/client/**/*.java"/&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="compile-client" description="Compiles the webservice client" depends="compile"&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${classes.dir}"/&amp;gt;&lt;br /&gt;  &amp;lt;javac destdir="${classes.dir}" classpathref="classpath" fork="true" srcdir="${compile.src}" includes="org/myapp/service/client/**/*.java"/&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="generateWSDL" description="Generates wsdl files from the java service interfaces"&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${wsdl.dir}"/&amp;gt;&lt;br /&gt;  &amp;lt;axis-java2wsdl classpathref="classpath"&lt;br /&gt;           output="${wsdl.dir}/HelloWorld.wsdl"&lt;br /&gt;           location="http://localhost:8080/axis/services/HelloWorld"&lt;br /&gt;           namespace="http://jaikiran.com"&lt;br /&gt;           classname="org.myapp.service.HelloWorldService"&amp;gt;&lt;br /&gt;     &amp;lt;mapping namespace="http://jaikiran.com" package="org.myapp.service"/&amp;gt;&lt;br /&gt;  &amp;lt;/axis-java2wsdl&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="generateWSDD" description="Generates wsdd files from the wsdl files"&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${wsdd.dir}"/&amp;gt;&lt;br /&gt;  &amp;lt;axis-wsdl2java&lt;br /&gt;        output="${wsdd.dir}"&lt;br /&gt;        deployscope="Application"&lt;br /&gt;        serverside="true"&lt;br /&gt;        url="${wsdl.dir}\HelloWorld.wsdl"&amp;gt;&lt;br /&gt;  &amp;lt;/axis-wsdl2java&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="compileStubs" description="Compiles the java classes(stubs) generated by Axis using the wsdl2java task"&amp;gt;&lt;br /&gt;  &amp;lt;mkdir dir="${classes.dir}"/&amp;gt;&lt;br /&gt;  &amp;lt;javac destdir="${classes.dir}" classpathref="classpath" fork="true" srcdir="${wsdd.dir}"/&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="deployWebservice" description="Deploys the webservice onto the server, using the wsdd file and Axis' AdminClient"&amp;gt;&lt;br /&gt;  &amp;lt;java classname="org.apache.axis.client.AdminClient" classpathref="classpath" fork="true"&amp;gt;&lt;br /&gt;   &amp;lt;arg value="${wsdd.dir}/com/jaikiran/deploy.wsdd"/&amp;gt;&lt;br /&gt;  &amp;lt;/java&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="undeployWebservice" description="Undeploys webservice using the wsdd file and the Axis' AdminClient"&amp;gt;&lt;br /&gt;  &amp;lt;java classname="org.apache.axis.client.AdminClient" classpathref="classpath" fork="true"&amp;gt;&lt;br /&gt;   &amp;lt;arg value="${wsdd.dir}/com/jaikiran/undeploy.wsdd"/&amp;gt;&lt;br /&gt;  &amp;lt;/java&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;target name="runWebserviceClient" description="Executes the java client which access the webservice"&amp;gt;&lt;br /&gt;   &amp;lt;java classname="org.myapp.service.client.ServiceClient" classpathref="classpath" fork="true"/&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;br /&gt;  &lt;br /&gt;&amp;lt;/project&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6) The project directory structure&lt;br /&gt;&lt;br /&gt;This is how my project's directory structure looks like (just in case you want to create a similar one):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sample Webservice&lt;br /&gt; |&lt;br /&gt; |&lt;br /&gt; |------------- src&lt;br /&gt; |               | &lt;br /&gt; |               |---- org&lt;br /&gt; |                      |--- myapp&lt;br /&gt; |                             |---- service&lt;br /&gt; |                                     |------- HelloWorldService.java&lt;br /&gt; |                                     |&lt;br /&gt; |                                     |------- HelloWorldServiceImpl.java&lt;br /&gt; |                                     |&lt;br /&gt; |                                     |----- client&lt;br /&gt; |                                              |-------- ServiceClient.java&lt;br /&gt; |&lt;br /&gt; |&lt;br /&gt; |------------- build&lt;br /&gt; |                |----- build.xml&lt;br /&gt; |&lt;br /&gt; |&lt;br /&gt; |------------- lib&lt;br /&gt;                 | &lt;br /&gt;                 |----- activation.jar&lt;br /&gt;                 |----- axis.jar&lt;br /&gt;                 |----- axis-ant.jar&lt;br /&gt;                 |----- commons-discovery-0.2.jar&lt;br /&gt;                 |----- commons-logging-1.0.4.jar&lt;br /&gt;                 |----- jaxrpc.jar&lt;br /&gt;                 |----- mailapi_1_3_1.jar&lt;br /&gt;                 |----- saaj.jar&lt;br /&gt;                 |----- wsdl4j-1.5.1.jar&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-2296523205344856577?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/2296523205344856577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=2296523205344856577' title='87 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2296523205344856577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/2296523205344856577'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/12/simple-webservice-on-jboss-using-axis.html' title='Simple Webservice on JBoss using Axis'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>87</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-7758777114422914952</id><published>2006-10-31T11:31:00.000+05:30</published><updated>2006-10-31T11:41:23.469+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><title type='text'>How to package an application into a ear file</title><content type='html'>This is for those who want to know the ideal and most common way an application is packaged in the form of an ear file. Here's how the application structure will look like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;myApp.ear&lt;br /&gt; |&lt;br /&gt; |--------- META-INF&lt;br /&gt; |            |&lt;br /&gt; |            |---------- application.xml&lt;br /&gt; |&lt;br /&gt; |--------- myEJB.jar&lt;br /&gt; |            |&lt;br /&gt; |            |--------- META-INF&lt;br /&gt; |            |            |&lt;br /&gt; |            |            |-------- ejb-jar.xml  &lt;br /&gt; |            |&lt;br /&gt; |            |------ org&lt;br /&gt; |            |         |----- myApp&lt;br /&gt; |            |                 |------- ejb&lt;br /&gt; |                                        |-------- *.class&lt;br /&gt; |&lt;br /&gt; |---------- myWeb.war&lt;br /&gt; |              |&lt;br /&gt; |              |----- WEB-INF&lt;br /&gt; |                      |------ web.xml&lt;br /&gt; |                      |&lt;br /&gt; |                      |------ jsp&lt;br /&gt; |                               |---- *.jsp&lt;br /&gt; |&lt;br /&gt; |---------- commonUtil.jar&lt;br /&gt;               |&lt;br /&gt;               |--------- org&lt;br /&gt;                           |----- myApp&lt;br /&gt;                                    |------ common&lt;br /&gt;                                             |----- *.class&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The application.xml present in the META-INF folder of the ear will contain the following:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd"&amp;gt;&lt;br /&gt;&amp;lt;application&amp;gt;&lt;br /&gt; &amp;lt;display-name&amp;gt;helloworld&amp;lt;/display-name&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;module&amp;gt;&lt;br /&gt;  &amp;lt;java&amp;gt;commonUtil.jar&amp;lt;/java&amp;gt;&lt;br /&gt; &amp;lt;/module&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;module&amp;gt;&lt;br /&gt;  &amp;lt;web&amp;gt;&lt;br /&gt;   &amp;lt;web-uri&amp;gt;myWeb.war&amp;lt;/web-uri&amp;gt;&lt;br /&gt;   &amp;lt;context-root&amp;gt;/myWeb&amp;lt;/context-root&amp;gt;&lt;br /&gt;  &amp;lt;/web&amp;gt;&lt;br /&gt; &amp;lt;/module&amp;gt;&lt;br /&gt; &lt;br /&gt; &amp;lt;module&amp;gt;&lt;br /&gt;  &amp;lt;ejb&amp;gt;myEJB.jar&amp;lt;/ejb&amp;gt;&lt;br /&gt; &amp;lt;/module&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;/application&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-7758777114422914952?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/7758777114422914952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=7758777114422914952' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7758777114422914952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/7758777114422914952'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/10/how-to-package-application-into-ear.html' title='How to package an application into a ear file'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115643390456699330</id><published>2006-08-24T21:05:00.000+05:30</published><updated>2006-10-30T19:21:44.677+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>inverse attribute in Hibernate - What does it mean?</title><content type='html'>&lt;span&gt;&lt;br /&gt;&lt;br /&gt;This is the best explanation, that i have seen till date, about Hibernate's "inverse" attribute:&lt;br /&gt;&lt;a href="http://blogs.warwick.ac.uk/colinyates/entry/hibernates_bizzare_interpretation/"&gt;Meaning of "inverse" in Hibernate&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115643390456699330?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115643390456699330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115643390456699330' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115643390456699330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115643390456699330'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/08/inverse-attribute-in-hibernate-what.html' title='inverse attribute in Hibernate - What does it mean?'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115642264706547400</id><published>2006-08-24T18:00:00.000+05:30</published><updated>2006-10-30T19:21:44.606+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>Evict collection from Hibernate second level cache</title><content type='html'>&lt;span&gt;&lt;br /&gt;Hibernate allows persistent objects to be cached in its second level cache(The first level cache in Hibernate is the Session object which is ON by default). Applications can switch on the second level cache.  When a object is being retrieved by the application through Hibernate, Hibernate first checks in its Session cache and then the Second level cache to see if the object has be retrieved already. If it finds it either the Session cache or the Second level cache, it will NOT fire a query to the database.&lt;br /&gt;While configuring second level cache, the object can be cached and also the collections contained in the object can be cached. Have a look at the following example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;hibernate-mapping default-lazy=&amp;quot;false&amp;quot; &amp;gt; &lt;br /&gt; &amp;lt;class name=&amp;quot;org.myapp.ho.Parent&amp;quot; table=&amp;quot;Parent&amp;quot;&amp;gt; &lt;br /&gt;    &amp;lt;b&amp;gt;&amp;lt;cache usage=&amp;quot;read-only&amp;quot; /&amp;gt; &amp;lt;/b&amp;gt;&lt;br /&gt;    &amp;lt;id name=&amp;quot;id&amp;quot; type=&amp;quot;Integer&amp;quot; column=&amp;quot;ID&amp;quot; /&amp;gt; &lt;br /&gt;  &amp;lt;set name=&amp;quot;myChildren&amp;quot;&amp;gt; &lt;br /&gt;     &amp;lt;b&amp;gt; &amp;lt;cache usage=&amp;quot;read-only&amp;quot;/&amp;gt; &amp;lt;/b&amp;gt;&lt;br /&gt;     &amp;lt;one-to-many class=&amp;quot;org.myapp.ho.Child&amp;quot;/&amp;gt; &lt;br /&gt;  &amp;lt;/set&amp;gt; &lt;br /&gt; &amp;lt;/class&amp;gt; &lt;br /&gt;&amp;lt;/hibernate-mapping&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;hibernate-mapping default-lazy=&amp;quot;false&amp;quot; &amp;gt; &lt;br /&gt;   &amp;lt;class name=&amp;quot;org.myapp.ho.Child&amp;quot; table=&amp;quot;Child&amp;quot;&amp;gt;&lt;br /&gt;      &amp;lt;b&amp;gt;&amp;lt;cache usage=&amp;quot;read-only&amp;quot; /&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;      &amp;lt;id name=&amp;quot;id&amp;quot; type=&amp;quot;Integer&amp;quot; column=&amp;quot;ID&amp;quot; /&amp;gt; &lt;br /&gt;   &amp;lt;/class&amp;gt; &lt;br /&gt;&amp;lt;/hibernate-mapping&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Note that we have used the cache setting at 3 places:&lt;br /&gt; 1) The org.myapp.ho.Parent object&lt;br /&gt; 2) The "myChildren" collection in the org.myapp.ho.Parent object&lt;br /&gt; 3) The org.myapp.ho.Child object&lt;br /&gt;When you configure a collection to be second level cached in Hibernate, it internally maintains a SEPERATE cache for these collection than the one which it uses to cache the parent objects. So in the example above, the “myChildren” will be cached separately than the org.myapp.ho.Parent object.&lt;br /&gt;There might be cases where applications would want to evict objects from the cache. If its the Session cache from which the application has to evict the object then the call to Session.evict will cascade even to collections and will evict the collection from the *Session cache*. However, if the object(and the collections contained in it) have to be evicted from the second level cache, then the application has to *explicitly* call the evictCollection method on the SessionFactory to remove the *collection* contained in the Parent object. The reason behind this is, as already mentioned, the collections are cached separately, than the parent objects, in the second level cache.&lt;br /&gt;So, in our example above, if we have to evict the Parent with id 500 and its collection from the second level cache, then here’s what has to be done:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SessionFactory sf = MyUtil.getSessionFactory();&lt;br /&gt;//this will evict the Parent Object from the second level cache&lt;br /&gt;sf.evict(org.myapp.ho.Parent.class,new Integer(500)); &lt;br /&gt;//this will evict the collection from the second level cache for the Parent with id=500&lt;br /&gt;sf.evictCollection(org.myapp.ho.Parent.class.getName() +  ".myChildren", new Integer(500)); &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The first parameter to the evictCollection method is the ‘roleName’ of the collection. The roleName is formed as follows:&lt;br /&gt;&lt;br /&gt;roleName = NameOfTheParentClass + "." + NameOfTheCollectionInsideTheParent&lt;br /&gt;&lt;br /&gt;The second parameter the evictCollection method is the id of the parent object, to which this collection belongs. &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115642264706547400?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115642264706547400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115642264706547400' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115642264706547400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115642264706547400'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/08/evict-collection-from-hibernate-second.html' title='Evict collection from Hibernate second level cache'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115642085225158748</id><published>2006-08-24T17:29:00.000+05:30</published><updated>2008-07-12T22:14:49.356+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>Custom reverse engineering strategy in Hibernate</title><content type='html'>&lt;span&gt;&lt;br /&gt;Hibernate has tools to create mapping files(hbm files) and domain model classes from database schemas(reverse engineering). &lt;jdbcconfguration&gt; can be used as part of ant task to do this. Hibernate creates the property names using its default reverse engineering strategy. Hibernate also, provides a way through which the user can specify his own custom reverse engineering strategy through which he can follow his own naming conventions etc…&lt;br /&gt;&lt;br /&gt;There is a reversestrategy attribute which can be set to some custom class, which implements org.hibernate.cfg.reveng.ReverseEngineeringStrategy, in the &lt;jdbcconfiguration&gt;. Here’s an example:&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;jdbcconfiguration configurationfile=&amp;quot;hibernate.cfg.xml&amp;quot;  &lt;br /&gt;&lt;br /&gt;    packagename=&amp;quot;${package.name}&amp;quot;  &lt;br /&gt;&lt;br /&gt;    revengfile=&amp;quot;hibernate.reveng.xml&amp;quot;  &lt;br /&gt;&lt;br /&gt;    reversestrategy=&amp;quot;org.myapp.hibernate.tool.SampleReverseEngineeringStrategy&amp;quot;/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The org.myapp.hibernate.tool.SampleReverseEngineeringStrategy is our own custom class which implements org.hibernate.cfg.reveng.ReverseEngineeringStrategy. In this example, our SampleReverseEngineeringStrategy, overrides the columnToPropertyName(TableIdentifier table, String column) method to provide a custom implementation for generating property names out of a column name. Here’s the SampleReverseEngineeringStrategy code:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package org.myapp.hibernate.tool;  &lt;br /&gt;&lt;br /&gt;import java.util.regex.Matcher;  &lt;br /&gt;import java.util.regex.Pattern;  &lt;br /&gt;import org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy;  &lt;br /&gt;import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;  &lt;br /&gt;import org.hibernate.cfg.reveng.TableIdentifier;  &lt;br /&gt;/**  &lt;br /&gt; *  &lt;br /&gt; * @author Jaikiran Pai  &lt;br /&gt; *  &lt;br /&gt; */  &lt;br /&gt;public class SampleReverseEngineeringStrategy extends DelegatingReverseEngineeringStrategy {  &lt;br /&gt;/**  &lt;br /&gt;  * Constructor  &lt;br /&gt;  *  &lt;br /&gt;  * @param delegate {@link org.hibernate.cfg.reveng.ReverseEngineeringStrategy}  &lt;br /&gt;  */  &lt;br /&gt; public SampleReverseEngineeringStrategy(ReverseEngineeringStrategy delegate) {  &lt;br /&gt;  super(delegate);  &lt;br /&gt; }  &lt;br /&gt;&lt;br /&gt;/**  &lt;br /&gt;  * Changes the default behaviour of naming the property. &lt;br&gt;  &lt;br /&gt;  * Does the following replacements(not neccessarily in the order) and returns the resulting  &lt;br /&gt;  * {@link String} as property name:&lt;br /&gt;  *  - Converts the first letter of the &lt;code&gt;column&lt;/code&gt; to uppercase&lt;br /&gt;  *  - Converts the letters following a ‘_’ character to uppercase in the &lt;code&gt;column&lt;/code&gt;  &lt;br /&gt;  *  - Removes any underscores present from &lt;code&gt;column&lt;/code&gt;  &lt;br /&gt;  *  &lt;br /&gt;  * @see org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy  &lt;br /&gt;  * @see org.hibernate.cfg.reveng.ReverseEngineeringStrategy  &lt;br /&gt;  *  &lt;br /&gt;  * @param table {@link TableIdentifier}  &lt;br /&gt;  * @param column  &lt;br /&gt;  * @return Returns the propert name after converting it appropriately  &lt;br /&gt;  */  &lt;br /&gt;public String columnToPropertyName(TableIdentifier table, String column) {  &lt;br /&gt;&lt;br /&gt;  String replacedColumn = replaceFirstLetterToUpperCase(column);  &lt;br /&gt;   &lt;br /&gt;   replacedColumn = removeUnderScoresAndConvertNextLetterToUpperCase(replacedColumn);  &lt;br /&gt;&lt;br /&gt;   if (anyReplacementsMadeToOriginalColumnName(column,replacedColumn)) {  &lt;br /&gt;  &lt;br /&gt;  return replacedColumn;  &lt;br /&gt;&lt;br /&gt;   }  &lt;br /&gt;&lt;br /&gt;   /*  &lt;br /&gt;    * Let DelegatingReverseEngineeringStrategy handle this  &lt;br /&gt;    */  &lt;br /&gt;   return super.columnToPropertyName(table, column);  &lt;br /&gt; }  &lt;br /&gt;&lt;br /&gt; /**  &lt;br /&gt;  *  &lt;br /&gt;  * Returns true if the &lt;code&gt;originalString&lt;/code&gt; and &lt;code&gt;replacedString&lt;/code&gt; are NOT equal  &lt;br /&gt;  * (meaning there was some replacement done to the original column name). Else returns false.&lt;br /&gt;  *  &lt;br /&gt;  * @param originalString The original column name  &lt;br /&gt;  * @param replacedString The column name after doing necessary replacements  &lt;br /&gt;  * @return Returns true if the &lt;code&gt;originalString&lt;/code&gt; and &lt;code&gt;replacedString&lt;/code&gt; are NOT equal  &lt;br /&gt;  * (meaning there was some replacement done to the original column name). Else returns false.  &lt;br /&gt;  *   &lt;br /&gt;  * @throws {@link NullPointerException} if &lt;code&gt;originalString&lt;/code&gt; is null.  &lt;br /&gt;  */  &lt;br /&gt; protected boolean anyReplacementsMadeToOriginalColumnName(String originalString, String replacedString) {  &lt;br /&gt;  if (originalString.equals(replacedString)) {  &lt;br /&gt;    return false;  &lt;br /&gt;&lt;br /&gt;   }  &lt;br /&gt;&lt;br /&gt;   return true;  &lt;br /&gt; }  &lt;br /&gt;&lt;br /&gt; /**  &lt;br /&gt;  * Converts the first letter of the &lt;code&gt;input&lt;/code&gt; to uppercase and  &lt;br /&gt;  * returns the resultant {@link String}.  &lt;br /&gt;  *   &lt;br /&gt;  * Ex: If the &lt;code&gt;input&lt;/code&gt; is startDate then the resulting {@link String}  &lt;br /&gt;  * after replacement will be StartDate  &lt;br /&gt;  *  &lt;br /&gt;  * @param input The {@link String} whose contents have to be replaced  &lt;br /&gt;  * @return Returns a {@link String} after doing the appropriate replacements  &lt;br /&gt;  */  &lt;br /&gt; protected String replaceFirstLetterToUpperCase(String input) {  &lt;br /&gt;&lt;br /&gt;   /*  &lt;br /&gt;    * The pattern to match a String starting with lower case  &lt;br /&gt;    */  &lt;br /&gt;   final String startsWithLowerCasePattern = "^[a-z]";  &lt;br /&gt;   &lt;br /&gt;   Pattern patternForReplacingLowerCase = Pattern.compile(startsWithLowerCasePattern);  &lt;br /&gt;   Matcher regexMatcher = patternForReplacingLowerCase.matcher(input);  &lt;br /&gt;&lt;br /&gt; /*  &lt;br /&gt;  * This will hold the replaced contents  &lt;br /&gt;  */  &lt;br /&gt; StringBuffer replacedContents = new StringBuffer();  &lt;br /&gt;&lt;br /&gt; /*  &lt;br /&gt;  * Check whether the first letter starts with lowercase.  &lt;br /&gt;  * If yes, change it to uppercase, else pass on the control to  &lt;br /&gt;  * DelegatingReverseEngineeringStrategy  &lt;br /&gt;  *  &lt;br /&gt;  */  &lt;br /&gt; if (regexMatcher.find()) {  &lt;br /&gt;&lt;br /&gt;  String firstCharacter = regexMatcher.group();  &lt;br /&gt;  /*  &lt;br /&gt;   * Convert it to uppercase  &lt;br /&gt;   */  &lt;br /&gt;  regexMatcher.appendReplacement(replacedContents,firstCharacter.toUpperCase());  &lt;br /&gt;  regexMatcher.appendTail(replacedContents);  &lt;br /&gt;  regexMatcher.reset();  &lt;br /&gt;  &lt;br /&gt;  /*  &lt;br /&gt;   * Return the replaced contents  &lt;br /&gt;   */  &lt;br /&gt;    return replacedContents.toString();  &lt;br /&gt;&lt;br /&gt;   }  &lt;br /&gt;&lt;br /&gt;        //no replacements to do, just return the original input  &lt;br /&gt;        return input;  &lt;br /&gt;&lt;br /&gt; }  &lt;br /&gt;&lt;br /&gt; /**  &lt;br /&gt;  * Converts the letters following a ‘_’ character to uppercase and also removes  &lt;br /&gt;  * the ‘_’ character from the &lt;code&gt;input&lt;/code&gt; and returns the resulting {@link String}.   &lt;br /&gt;  * Carries out a 2 pass strategy to do the replacements. During the first pass,  &lt;br /&gt;  * replaces all the letters that immidiately follow a ‘_’ to uppercase.  &lt;br /&gt;  * Ex: If the &lt;code&gt;input&lt;/code&gt; is _start_Date__today_ then after the first pass of replacement, the  &lt;br /&gt;  * resultant string will be _Start_Date__Today_  &lt;br /&gt;  *   &lt;br /&gt;  * This replaced {@link String} is then passed ahead for second pass (if no replacements were  &lt;br /&gt;  * done during first pass, then the original {@link String} is passed). During the second pass  &lt;br /&gt;  * the underscores are removed.  &lt;br /&gt;  * Ex: If the &lt;code&gt;input&lt;/code&gt; is _start_Date__today_ then after BOTH the passes the  &lt;br /&gt;  * resultant string will be StartDateToday  &lt;br /&gt;  *  &lt;br /&gt;  * @param input The {@link String} whose contents have to be replaced  &lt;br /&gt;  * @return Returns a {@link String} after doing the appropriate replacements  &lt;br /&gt;  */  &lt;br /&gt; protected String removeUnderScoresAndConvertNextLetterToUpperCase(String input) {  &lt;br /&gt;&lt;br /&gt;   /*  &lt;br /&gt;    * The pattern which matches a String that starts with a letter immidiately after  &lt;br /&gt;    * a ‘_’ character  &lt;br /&gt;    */  &lt;br /&gt;   final String stringFollowingUnderScore = "[.]*_[a-zA-Z]+";  &lt;br /&gt;&lt;br /&gt;   Pattern patternForReplacingLowerCase = Pattern.compile(stringFollowingUnderScore);  &lt;br /&gt;          Matcher regexMatcher = patternForReplacingLowerCase.matcher(input);  &lt;br /&gt;          /*  &lt;br /&gt;           * This will hold the replaced contents  &lt;br /&gt;           */  &lt;br /&gt;          StringBuffer replacedContents = new StringBuffer();  &lt;br /&gt;&lt;br /&gt;          boolean foundAnyMatch = false;  &lt;br /&gt;&lt;br /&gt;          while (regexMatcher.find()) {  &lt;br /&gt;   foundAnyMatch = true;  &lt;br /&gt;   String matchedString = regexMatcher.group();  &lt;br /&gt;       /*  &lt;br /&gt;          * The character immidiately following the underscore  &lt;br /&gt;   * Example:  &lt;br /&gt;          * If matchedString is _tMn then originalCharAfterUnderScore will be the  &lt;br /&gt;          * character t  &lt;br /&gt;          */  &lt;br /&gt;&lt;br /&gt;        char originalCharAfterUnderScore = matchedString.charAt(1);  &lt;br /&gt;         /*  &lt;br /&gt;          * Convert the character to uppercase  &lt;br /&gt;          */  &lt;br /&gt;&lt;br /&gt;        String replacedCharAfterUnderScore = String.valueOf(originalCharAfterUnderScore).toUpperCase();  &lt;br /&gt;&lt;br /&gt;        /*  &lt;br /&gt;          * Now place this replaced character back into the matchedString  &lt;br /&gt;          */  &lt;br /&gt;&lt;br /&gt;        String replacement = matchedString.replace(originalCharAfterUnderScore,replacedCharAfterUnderScore.charAt(0));  &lt;br /&gt;&lt;br /&gt;        /*  &lt;br /&gt;   * Append this to the replacedColumn, which will be returned back to the user  &lt;br /&gt;          */  &lt;br /&gt;  regexMatcher.appendReplacement(replacedContents,replacement);  &lt;br /&gt;&lt;br /&gt;     } //end of while  &lt;br /&gt;&lt;br /&gt;        regexMatcher.appendTail(replacedContents);  &lt;br /&gt; regexMatcher.reset();  &lt;br /&gt; &lt;br /&gt; /*  &lt;br /&gt;         * Now the input string has been replaced to contain uppercase letters after the underscore.  &lt;br /&gt;         * Ex: If input string was "_start_Date_today" then at this point after the above processing,  &lt;br /&gt;        * the replaced string will be "_Start_Date_Today"  &lt;br /&gt;  * The only thing that remains now is to remove the underscores from the input string.  &lt;br /&gt;        * The following statements do this part.  &lt;br /&gt;        *  &lt;br /&gt;        */  &lt;br /&gt;&lt;br /&gt;      if (foundAnyMatch) {  &lt;br /&gt;       return removeUnderScores(replacedContents.toString());  &lt;br /&gt;       &lt;br /&gt;   } else {  &lt;br /&gt;     return removeUnderScores(input);  &lt;br /&gt;     &lt;br /&gt;   }  &lt;br /&gt;&lt;br /&gt; }  &lt;br /&gt;&lt;br /&gt; /**  &lt;br /&gt;  * Removes any underscores present from &lt;code&gt;input&lt;/code&gt; and returns the  &lt;br /&gt;  * resulting {@link String}  &lt;br /&gt;  * Ex: If the &lt;code&gt;input&lt;/code&gt; is _start_Date__today_ then the resulting {@link String}  &lt;br /&gt;  * after replacement will be startDatetoday  &lt;br /&gt;  *&lt;br /&gt;  * @param input The {@link String} whose contents have to be replaced  &lt;br /&gt;  * @return Returns a {@link String} after doing the appropriate replacements  &lt;br /&gt;  */  &lt;br /&gt; protected String removeUnderScores(String input) {  &lt;br /&gt;&lt;br /&gt;   /*  &lt;br /&gt;  * Pattern for matching underscores  &lt;br /&gt;     */  &lt;br /&gt;  Pattern patternForUnderScore = Pattern.compile("[.]*_[.]*");  &lt;br /&gt;&lt;br /&gt;    Matcher regexMatcher = patternForUnderScore.matcher(input);  &lt;br /&gt;  /*  &lt;br /&gt;      * This will hold the return value  &lt;br /&gt;   */  &lt;br /&gt;    StringBuffer returnVal = new StringBuffer();  &lt;br /&gt;       boolean foundAnyMatch = false;  &lt;br /&gt;   &lt;br /&gt;     while (regexMatcher.find()) {  &lt;br /&gt;        foundAnyMatch = true;  &lt;br /&gt;&lt;br /&gt;     String matchedString = regexMatcher.group();  &lt;br /&gt;&lt;br /&gt;     /*  &lt;br /&gt;       * Remove the underscore  &lt;br /&gt;   */  &lt;br /&gt;     regexMatcher.appendReplacement(returnVal,"");  &lt;br /&gt;&lt;br /&gt;      }  &lt;br /&gt;&lt;br /&gt;      regexMatcher.appendTail(returnVal);  &lt;br /&gt; regexMatcher.reset();  &lt;br /&gt;&lt;br /&gt;      /*  &lt;br /&gt;        * If any match was found(and replaced) then return the replaced string.  &lt;br /&gt;        * Else return the original input.  &lt;br /&gt;  */  &lt;br /&gt;      if (foundAnyMatch) {  &lt;br /&gt;        return returnVal.toString();  &lt;br /&gt;&lt;br /&gt;      }  &lt;br /&gt; return input;  &lt;br /&gt;&lt;br /&gt; }  &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the example above, the columnToPropertyName method is overridden to do the following:&lt;br /&gt;&lt;br /&gt;- Creates property names that start with a Capital case(By default, Hibernate creates property names in camel-case)&lt;br /&gt;- Converts the letter, that follows a ‘_’ (underscore character) to uppercase in the property name&lt;br /&gt;- Removes any underscores in the property name&lt;br /&gt;&lt;br /&gt;Ex: If the column name is start_Date_today, then the resulting property name after using the SampleReverseEngineeringStrategy would be StartDateToday.&lt;br /&gt;&lt;br /&gt;Here’s a documentation from Hibernate about &lt;a href="http://www.hibernate.org/hib_docs/tools/reference/en/html/reverseengineering.html"&gt;Controlling Reverse Engineering &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115642085225158748?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115642085225158748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115642085225158748' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115642085225158748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115642085225158748'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/08/custom-reverse-engineering-strategy-in.html' title='Custom reverse engineering strategy in Hibernate'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115642008050965644</id><published>2006-08-24T17:17:00.000+05:30</published><updated>2008-07-12T22:15:19.360+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Convert exception stacktrace to String object</title><content type='html'>&lt;span&gt;&lt;br /&gt;Usually whenever a exception occurs, we use the method printStackTrace() on the exception object to display the stacktrace. However, if the stacktrace has to be stored into a String  object then the following piece of code will prove handy:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;  /**&lt;br /&gt;     * Creates and returns a {@link java.lang.String} from &lt;code&gt;t&lt;/code&gt;’s stacktrace &lt;br /&gt;     * @param t Throwable whose stack trace is required&lt;br /&gt;     * @return String representing the stack trace of the exception&lt;br /&gt;     */&lt;br /&gt;    public String getStackTrace(Throwable t) {&lt;br /&gt;        StringWriter stringWritter = new StringWriter();&lt;br /&gt;        PrintWriter printWritter = new PrintWriter(stringWritter, true);&lt;br /&gt;        t.printStackTrace(printWritter);&lt;br /&gt;        printWritter.flush();&lt;br /&gt;        stringWritter.flush(); &lt;br /&gt;&lt;br /&gt;       return stringWritter.toString();&lt;br /&gt;    } &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115642008050965644?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115642008050965644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115642008050965644' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115642008050965644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115642008050965644'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/08/convert-exception-stacktrace-to-string.html' title='Convert exception stacktrace to String object'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115641797492077417</id><published>2006-08-24T16:42:00.000+05:30</published><updated>2008-07-12T22:16:52.834+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><title type='text'>Lookup an EJB from a different application, deployed on the same server, in JBoss</title><content type='html'>&lt;span&gt;&lt;br /&gt;Question:&lt;br /&gt;I have a web application through which i want to access an EJB which is deployed as a separate appliaction on the same server. How do i do it?&lt;br /&gt;Answer:&lt;br /&gt;In the web.xml of your war(the web application through which you want to access the EJB), have the following entry:&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ejb-ref&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ejb-ref-name&amp;gt;GiveAnNameByWhichYouWouldLikeToReferTheBeanInYourWebApp&amp;lt;/ejb-ref-name&amp;gt;&lt;br /&gt;    &amp;lt;ejb-ref-type&amp;gt;session&amp;lt;/ejb-ref-type&amp;gt;&lt;br /&gt;    &amp;lt;home&amp;gt;packageName.ClassNameOfTheHomeObjectOfTheBeanYouWantToRefer&amp;lt;/home&amp;gt;&lt;br /&gt;    &amp;lt;remote&amp;gt;packageName.ClassNameOfTheRemoteObjectOfTheBeanYouWantToRefer&amp;lt;/remote&amp;gt;&lt;br /&gt;  &amp;lt;/ejb-ref&amp;gt;&lt;br /&gt;  &lt;br /&gt;&lt;/pre&gt; &lt;br /&gt;In the jboss-web.xml of your war, have the following entry:&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;ejb-ref&amp;gt;&lt;br /&gt;      &amp;lt;!--The ejb-ref-name should be same as the one given in the web.xml above --&amp;gt;&lt;br /&gt;      &amp;lt;ejb-ref-name&amp;gt;GiveANameByWhichYouWouldLikeToReferTheBeanInYourWebApp&amp;lt;/ejb-ref-name&amp;gt;&lt;br /&gt;      &amp;lt;!--Example:somecontext/somejndiName.YouWillFindThisJndiNameInTheJboss.xmlOfTheEJB--&amp;gt;&lt;br /&gt;      &amp;lt;jndi-name&amp;gt;TheJndiNametoWhichTheBeanIsBound&amp;lt;/jndi-name&amp;gt;&lt;br /&gt;   &amp;lt;/ejb-ref&amp;gt;&lt;br /&gt;   &lt;br /&gt;  &lt;/pre&gt;&lt;br /&gt;For more info, have a look at the dtds of web.xml (http://java.sun.com/dtd/web-app_2_3.dtd) and jboss-web.xml(http://www.jboss.org/j2ee/dtd)&lt;br /&gt;In your code, do the lookup as:&lt;br /&gt; &lt;br /&gt;&lt;pre name="code" class="java"&gt; &lt;br /&gt;Context ic = new InitialContext();&lt;br /&gt;Object home=ic.lookup("java:comp/env/TheNameThatYouHadGivenInEjb-ref-nameTagOfJbossWeb.xml");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;br /&gt;Here’s an example:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;web.xml:&lt;/b&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;ejb-ref&amp;gt;&lt;br /&gt;    &amp;lt;ejb-ref-name&amp;gt;MyTestBean&amp;lt;/ejb-ref-name&amp;gt;&lt;br /&gt;    &amp;lt;ejb-ref-type&amp;gt;session&amp;lt;/ejb-ref-type&amp;gt;&lt;br /&gt;    &amp;lt;home&amp;gt;com.test.ejb.MyBeanHome&amp;lt;/home&amp;gt;&lt;br /&gt;    &amp;lt;remote&amp;gt;com.test.ejb.MyBeanRemote&amp;lt;/remote&amp;gt;&lt;br /&gt;  &amp;lt;/ejb-ref&amp;gt;&lt;br /&gt;  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;jboss-web.xml:&lt;/b&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt; &amp;lt;ejb-ref&amp;gt;&lt;br /&gt;   &amp;lt;ejb-ref-name&amp;gt;MyTestBean&amp;lt;/ejb-ref-name&amp;gt;&lt;br /&gt;   &amp;lt;jndi-name&amp;gt;myejb/test/MyTestBean&amp;lt;/jndi-name&amp;gt;&lt;br /&gt;  &amp;lt;/ejb-ref&amp;gt;&lt;br /&gt; &lt;br /&gt; &lt;/pre&gt;&lt;br /&gt;Lookup code:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Context ic = new InitialContext();&lt;br /&gt;  Object ejbHome = ic.lookup("java:comp/env/MyTestBean");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115641797492077417?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115641797492077417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115641797492077417' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115641797492077417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115641797492077417'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/08/lookup-ejb-from-different-application.html' title='Lookup an EJB from a different application, deployed on the same server, in JBoss'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115641723637641389</id><published>2006-08-24T16:29:00.000+05:30</published><updated>2010-09-20T12:34:18.830+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>How to create a Queue/Topic in JBoss?</title><content type='html'>&lt;span&gt;&lt;br /&gt;Queues/Topics are known as administered objects and in jboss they can be deployed through ServiceDotXml files. Let’s name our file, myapp-destination-service.xml. The contents of the file should look like:&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;server&amp;gt;&lt;br /&gt;   &amp;lt;!--My queue, named: myAppQueue --&amp;gt;&lt;br /&gt;  &amp;lt;mbean code=&amp;quot;org.jboss.mq.server.jmx.Queue&amp;quot;&lt;br /&gt;  name=&amp;quot;jboss.mq.destination:service=Queue,name=myAppQueue&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;depends optional-attribute-name=&amp;quot;DestinationManager&amp;quot;&amp;gt;jboss.mq:service=DestinationManager&amp;lt;/depends&amp;gt;&lt;br /&gt;  &amp;lt;/mbean&amp;gt;&lt;br /&gt;   &amp;lt;!-- My topic, named: myAppTopic --&amp;gt;&lt;br /&gt;  &amp;lt;mbean code=&amp;quot;org.jboss.mq.server.jmx.Topic&amp;quot;&lt;br /&gt;  name=&amp;quot;jboss.mq.destination:service=Topic,name=myAppTopic&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;depends optional-attribute-name=&amp;quot;DestinationManager&amp;quot;&amp;gt;jboss.mq:service=DestinationManager&amp;lt;/depends&amp;gt;&lt;br /&gt;  &amp;lt;/mbean&amp;gt;&lt;br /&gt;    &lt;br /&gt;  &amp;lt;/server&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Place this file in your %JBOSS_HOME%/server/default/deploy directory and start the server.&lt;br /&gt;(Note: If you are using the ‘all’ configuration or the ‘minimal’ configuration then you will have to place this file in the %JBOSS_HOME%/server/all/deploy  or %JBOSS_HOME%/server/minimal/deploy   directory, as appropriate).&lt;br /&gt;&lt;br /&gt;The above queue/topic will be bound to the jndi name: queue/myAppQueue and topic/myAppTopic respectively.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;&lt;br /&gt;1) The above file is meant for JBoss-3.2.3. Though there might be slight changes to later versions of JBoss, the basic configuration mechanism remains the same.&lt;br /&gt;&lt;br /&gt;2) JBoss also comes with preconfigured queues/topics. These configurations can be found in the &lt;strong&gt;jbossmq-destinations-service.xml&lt;/strong&gt; file which is present in %JBOSS_HOME%/server/default/deploy/jms directory&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Update:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For JBoss AS 6.x see this &lt;a href="http://community.jboss.org/wiki/HowtocreateJMSqueuetopicinAS6" target="blank"&gt;FAQ&lt;/a&gt; for more details on how to configure JMS queue/topics&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115641723637641389?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115641723637641389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115641723637641389' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115641723637641389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115641723637641389'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/08/how-to-create-queuetopic-in-jboss.html' title='How to create a Queue/Topic in JBoss?'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115641688503559904</id><published>2006-08-24T16:23:00.000+05:30</published><updated>2006-10-30T19:21:44.230+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>How to enable Garbage Collection (GC) logs</title><content type='html'>&lt;span&gt;&lt;br /&gt;To enable GC logs, the -Xloggc:logFileName option will have to be passed when java command is being executed. Additionally if the detailed log of the GC is required, then an additional -XX:+PrintGCDetails option will have to be passed.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Example: java -Xloggc:D:/log/myLogFile.log -XX:+PrintGCDetails myProg &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115641688503559904?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115641688503559904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115641688503559904' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115641688503559904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115641688503559904'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/08/how-to-enable-garbage-collection-gc.html' title='How to enable Garbage Collection (GC) logs'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115270337772667612</id><published>2006-07-12T14:52:00.000+05:30</published><updated>2008-07-12T22:18:43.897+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Log4j'/><title type='text'>Create your own logging level in log4j</title><content type='html'>&lt;span&gt;&lt;br /&gt;If you need to add your own logging level in log4j, then you can do it as follows. You will have to create your own class which will extend from Level. Here's a sample code for the same: &lt;br /&gt;&lt;br /&gt;MyTraceLevel.java: &lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package org.myapp.log;&lt;br /&gt;&lt;br /&gt;import org.apache.log4j.Level;&lt;br /&gt;/**&lt;br /&gt; * My own {@link org.apache.log4j.Level} for logging. &lt;br /&gt; * &lt;br /&gt; * @author Jaikiran Pai &lt;br /&gt; * &lt;br /&gt; */ &lt;br /&gt;public class MyTraceLevel extends Level { &lt;br /&gt;&lt;br /&gt; /** &lt;br /&gt;  * Value of my trace level. This value is lesser than &lt;br /&gt;  * {@link org.apache.log4j.Priority#DEBUG_INT} &lt;br /&gt;  * and higher than {@link org.apache.log4j.Level#TRACE_INT} &lt;br /&gt;  */ &lt;br /&gt; public static final int MY_TRACE_INT = DEBUG_INT - 10; &lt;br /&gt; &lt;br /&gt; /** &lt;br /&gt;  * {@link Level} representing my log level &lt;br /&gt;  */ &lt;br /&gt; public static final Level MY_TRACE = new MyTraceLevel(MY_TRACE_INT,"MY_TRACE",7);&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;       * Constructor&lt;br /&gt;        *&lt;br /&gt;       * @param arg0&lt;br /&gt;       * @param arg1&lt;br /&gt;       * @param arg2&lt;br /&gt;        */&lt;br /&gt;     protected MyTraceLevel(int arg0, String arg1, int arg2) {&lt;br /&gt;         super(arg0, arg1, arg2);&lt;br /&gt;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;      * Checks whether sArg is "MY_TRACE" level. If yes then returns &lt;br /&gt;      * {@link MyTraceLevel#MY_TRACE}, else calls &lt;br /&gt;      * {@link MyTraceLevel#toLevel(String, Level)} passing it &lt;br /&gt;      * {@link Level#DEBUG} as the defaultLevel.&lt;br /&gt;       *&lt;br /&gt;       * @see Level#toLevel(java.lang.String)&lt;br /&gt;       * @see Level#toLevel(java.lang.String, org.apache.log4j.Level)&lt;br /&gt;       *&lt;br /&gt;       */&lt;br /&gt;     public static Level toLevel(String sArg) {&lt;br /&gt;         if (sArg != null &amp;&amp; sArg.toUpperCase().equals("MY_TRACE")) {&lt;br /&gt;             return MY_TRACE;&lt;br /&gt;         }&lt;br /&gt;         return (Level) toLevel(sArg, Level.DEBUG);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;      * Checks whether val is {@link MyTraceLevel#MY_TRACE_INT}. &lt;br /&gt;  * If yes then returns {@link MyTraceLevel#MY_TRACE}, else calls &lt;br /&gt;  * {@link MyTraceLevel#toLevel(int, Level)} passing it {@link Level#DEBUG}&lt;br /&gt;  * as the defaultLevel&lt;br /&gt;  *&lt;br /&gt;       * @see Level#toLevel(int)&lt;br /&gt;       * @see Level#toLevel(int, org.apache.log4j.Level)&lt;br /&gt;       *&lt;br /&gt;       */&lt;br /&gt;     public static Level toLevel(int val) {&lt;br /&gt;         if (val == MY_TRACE_INT) {&lt;br /&gt;             return MY_TRACE;&lt;br /&gt;         }&lt;br /&gt;         return (Level) toLevel(val, Level.DEBUG);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;      * Checks whether val is {@link MyTraceLevel#MY_TRACE_INT}. &lt;br /&gt;      * If yes then returns {@link MyTraceLevel#MY_TRACE},&lt;br /&gt;      * else calls {@link Level#toLevel(int, org.apache.log4j.Level)}&lt;br /&gt;      *&lt;br /&gt;      * @see Level#toLevel(int, org.apache.log4j.Level)&lt;br /&gt;      */&lt;br /&gt;     public static Level toLevel(int val, Level defaultLevel) {&lt;br /&gt;         if (val == MY_TRACE_INT) {&lt;br /&gt;             return MY_TRACE;&lt;br /&gt;         }&lt;br /&gt;         return Level.toLevel(val,defaultLevel);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;      * Checks whether sArg is "MY_TRACE" level. &lt;br /&gt;  * If yes then returns {@link MyTraceLevel#MY_TRACE}, else calls&lt;br /&gt;  * {@link Level#toLevel(java.lang.String, org.apache.log4j.Level)}&lt;br /&gt;  *&lt;br /&gt;  * @see Level#toLevel(java.lang.String, org.apache.log4j.Level)&lt;br /&gt;  */&lt;br /&gt; public static Level toLevel(String sArg, Level defaultLevel) {     &lt;br /&gt;        if(sArg != null &amp;&amp; sArg.toUpperCase().equals("MY_TRACE")) {&lt;br /&gt;            return MY_TRACE;&lt;br /&gt;        }&lt;br /&gt;        return Level.toLevel(sArg,defaultLevel);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, you will have to configure your log4j.xml: &lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&amp;gt; &lt;br /&gt;&amp;lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"debug="false"&amp;gt; &lt;br /&gt;&amp;lt;!-- ================================= --&amp;gt; &lt;br /&gt;&amp;lt;!-- Preserve messages in a local file --&amp;gt; &lt;br /&gt;&amp;lt;!-- ================================= --&amp;gt; &lt;br /&gt;&amp;lt;!-- A size based rolling appender --&amp;gt; &lt;br /&gt;&amp;lt;appender name="FILE" class="org.apache.log4j.FileAppender"&amp;gt; &lt;br /&gt;&amp;lt;param name="File" value="D:/log/myLogFile.log"/&amp;gt; &lt;br /&gt;&amp;lt;param name="Append" value="false"/&amp;gt; &lt;br /&gt;&amp;lt;layout class="org.apache.log4j.PatternLayout"&amp;gt; &lt;br /&gt;&amp;lt;param name="ConversionPattern" value="%d{ISO8601} %-5p [%c] %m%n"/&amp;gt; &lt;br /&gt;&amp;lt;/layout&amp;gt; &lt;br /&gt;&amp;lt;/appender&amp;gt; &lt;br /&gt;&amp;lt;!-- ============================== --&amp;gt; &lt;br /&gt;&amp;lt;!-- Append messages to the console --&amp;gt; &lt;br /&gt;&amp;lt;!-- ============================== --&amp;gt; &lt;br /&gt;&amp;lt;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&amp;gt; &lt;br /&gt;&amp;lt;param name="Target" value="System.out"/&amp;gt; &lt;br /&gt;&amp;lt;param name="Threshold" value="INFO"/&amp;gt; &lt;br /&gt;&amp;lt;layout class="org.apache.log4j.PatternLayout"&amp;gt; &lt;br /&gt;&amp;lt;!-- The default pattern: Date Priority [Category] Message\n --&amp;gt; &lt;br /&gt;&amp;lt;param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1}] %m%n"/&amp;gt; &lt;br /&gt;&amp;lt;/layout&amp;gt; &lt;br /&gt;&amp;lt;/appender&amp;gt; &lt;br /&gt;&amp;lt;!-- ================ --&amp;gt; &lt;br /&gt;&amp;lt;!-- Limit categories --&amp;gt; &lt;br /&gt;&amp;lt;!-- ================ --&amp;gt; &lt;br /&gt;&amp;lt;category name="org.myapp"&amp;gt; &lt;br /&gt;&amp;lt;priority value="MY_TRACE" class="org.myapp.log.MyTraceLevel" /&amp;gt; &lt;br /&gt;&amp;lt;appender-ref ref="FILE"/&amp;gt; &lt;br /&gt;&amp;lt;/category&amp;gt; &lt;br /&gt;&amp;lt;!-- ======================= --&amp;gt; &lt;br /&gt;&amp;lt;!-- Setup the Root category --&amp;gt; &lt;br /&gt;&amp;lt;!-- ======================= --&amp;gt; &lt;br /&gt;&amp;lt;root&amp;gt; &lt;br /&gt;&amp;lt;appender-ref ref="CONSOLE"/&amp;gt; &lt;br /&gt;&amp;lt;/root&amp;gt; &lt;br /&gt;&amp;lt;/log4j:configuration&amp;gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here's a test program which can be used for testing whether the new log level that you introduced is being identified or not: &lt;br /&gt;&lt;br /&gt;TestMyLogLevel.java:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package org.myapp.core; &lt;br /&gt;&lt;br /&gt;import org.apache.log4j.Level; &lt;br /&gt;import org.apache.log4j.Logger; &lt;br /&gt;import org.myapp.log.MyTraceLevel; &lt;br /&gt;&lt;br /&gt;/** &lt;br /&gt; * Tests whether the new log level {@link org.myapp.log.MyTraceLevel#MY_TRACE} &lt;br /&gt; * is working &lt;br /&gt; * &lt;br /&gt; * @author Jaikiran Pai &lt;br /&gt; * &lt;br /&gt; */ &lt;br /&gt;public class TestMyLogLevel { &lt;br /&gt;&lt;br /&gt; /** &lt;br /&gt;  * Writes a log message with {@link org.myapp.log.MyTraceLevel#MY_TRACE} &lt;br /&gt;  * and another message with {@link Level#DEBUG}&lt;br /&gt;       *&lt;br /&gt;       * @param args&lt;br /&gt;       */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  Logger logger = Logger.getLogger(TestMyLogLevel.class);&lt;br /&gt;  logger.log(MyTraceLevel.MY_TRACE,"I am MY_TRACE log");&lt;br /&gt;  logger.log(Level.DEBUG ,"I am a debug message");&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally, here's the log file that got generated: &lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;2006-07-12 13:45:40,633 MY_TRACE [org.myapp.core.TestMyLogLevel] I am MY_TRACE log &lt;br /&gt;2006-07-12 13:45:40,633 DEBUG [org.myapp.core.TestMyLogLevel] I am a debug message &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Points to note: &lt;br /&gt;&lt;br /&gt;- The int value that you specify for your log level is important. Here i have defined "MY_TRACE" log level is to be higher than the DEBUG level but lower than the TRACE level provided by log4j. So whenever you have set a priority level to DEBUG on the category(in your log4j.xml file), the MY_TRACE level logs will *NOT* make it to the log file. &lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115270337772667612?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115270337772667612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115270337772667612' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115270337772667612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115270337772667612'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/07/create-your-own-logging-level-in-log4j.html' title='Create your own logging level in log4j'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115211186260064253</id><published>2006-07-05T20:27:00.000+05:30</published><updated>2006-10-30T19:21:43.883+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Log4j'/><title type='text'>I get "log4j:WARN No appenders could be found for logger" message</title><content type='html'>&lt;span style="font-family:georgia;font-size:85%;"&gt;While using log4j in your application, sometimes you might encounter the following message:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#660000;"&gt;log4j:WARN No appenders could be found for logger(somePackageName.someClassName).&lt;br /&gt;log4j:WARN Please initialize the log4j system properly.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The reason why you see this message is that your log4j configuration file(i.e. log4j.xml or log4j.properties) is NOT found in the classpath. Placing the log4j configuration file in the applications classpath should solve the issue. If you want to find out how log4j tries to configure itself, have a look at my earlier post :&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jaitechwriteups.blogspot.com/2006/07/know-how-log4j-tries-to-configure.html" target="_blank()"&gt;Know how log4j tries to configure itself&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115211186260064253?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115211186260064253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115211186260064253' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115211186260064253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115211186260064253'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/07/i-get-log4jwarn-no-appenders-could-be.html' title='I get &quot;log4j:WARN No appenders could be found for logger&quot; message'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115200668776820895</id><published>2006-07-04T15:14:00.000+05:30</published><updated>2006-10-30T19:21:43.820+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Log4j'/><title type='text'>Know how log4j tries to configure itself</title><content type='html'>&lt;span style="font-family:georgia;font-size:85%;"&gt;Large number of applications use &lt;a href="http://logging.apache.org/log4j/docs/documentation.html" target="_blank()"&gt;log4j&lt;/a&gt; for logging. Sometimes you may encounter cases where you sense that log4j is using some other configurations, other than the one that you expected it to use. You can debug the same by switching on the debug flag on log4j. Here's how you can do it:&lt;br /&gt;&lt;br /&gt;Add &lt;span style="color:#660000;"&gt;&lt;strong&gt;-Dlog4j.debug&lt;/strong&gt; &lt;/span&gt;to the command line. log4j will output info to std. out. telling you how it tries to configure itself.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115200668776820895?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115200668776820895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115200668776820895' title='29 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115200668776820895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115200668776820895'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/07/know-how-log4j-tries-to-configure.html' title='Know how log4j tries to configure itself'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>29</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115200247714809892</id><published>2006-07-04T13:40:00.000+05:30</published><updated>2008-07-12T22:20:06.594+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='EJB'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='JAAS'/><title type='text'>Accessing a secure EJB through a standalone java client</title><content type='html'>&lt;span style="font-family:georgia;font-size:85%;"&gt;To access a secure resource(may be a EJB), from a standalone client, you need to do a JAAS login. Here's an simple example which shows how to implement the same. But before going to the example, here's the reason why we need to do a login. Consider a secured EJB "MyTestEJB", deployed on a app server. The normal proceedure that you follow in a web-application to lookup the EJB and invoke a method on the same is as follows:&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Context context = new InitialContext(); &lt;br /&gt;//lookup the home object &lt;br /&gt;Object lookupObj = context.lookup("MyTestEJBHomeJndiName"); &lt;br /&gt;MyTestEJBHome home = (MyTestEJBHome) PortableRemoteObject.narrow(lookupObj, MyTestEJBHome.class); &lt;br /&gt;//create the bean object from the home object &lt;br /&gt;MyTestEJB myBean = home.create(); &lt;br /&gt;//invoke the method on the bean &lt;br /&gt;myBean.someMethod(); &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;In the steps above, when the method create is called on the home object, the app server internally checks whether the user who is doing this operation, is authenticated and authorised to do the same. If not, it will throw a SecurityException. The above statements will usually work in a web-application where usually you have a login page to carry out the login process.&lt;br /&gt;&lt;br /&gt;Now, consider the case with a standalone java client which has just got a main method and which needs to invoke the secure bean. The application server will have no knowledge about which user is trying to do the operations on the bean(is he authenticated or authorised?). This is the reason why the standalone client needs to do a JAAS login, to let the application server know which user is trying to do the operation on the bean. Now lets look at the code for doing the same. Here we have a standalone java client with a main() method:&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package myapp;&lt;br /&gt;&lt;br /&gt;import javax.ejb.CreateException;&lt;br /&gt;import javax.naming.Context;&lt;br /&gt;import javax.naming.InitialContext;&lt;br /&gt;import javax.naming.NamingException;&lt;br /&gt;import javax.rmi.PortableRemoteObject;&lt;br /&gt;import javax.security.auth.login.LoginContext;&lt;br /&gt;import javax.security.auth.login.LoginException;&lt;br /&gt;import java.io.Serializable;&lt;br /&gt;import java.rmi.RemoteException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * Stand-alone client invoking a method on a secure EJB&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;public final class SomeStandAloneClient {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Default constructor&lt;br /&gt;  *&lt;br /&gt;  */&lt;br /&gt; public SomeStandAloneClient() {&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Main method&lt;br /&gt;  *&lt;br /&gt;  * @param args Command line arguments&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;  //obtain the username and password which are passed as part of command line arguments&lt;br /&gt;  String userName = args[0];&lt;br /&gt;  String password = args[1];&lt;br /&gt;&lt;br /&gt;  System.out.println("Logging in user: " + userName);&lt;br /&gt;&lt;br /&gt;  /*&lt;br /&gt;   * The name of the file which will contain the login configurations&lt;br /&gt;   */&lt;br /&gt;  final String authFile = "someFilename.someExtension";&lt;br /&gt;&lt;br /&gt;  /*&lt;br /&gt;   * Set the filename above, as part of system property, so that while doing a login,&lt;br /&gt;   * this file will be used to check the login configurations&lt;br /&gt;   */&lt;br /&gt;  System.setProperty("java.security.auth.login.config", authFile);&lt;br /&gt;&lt;br /&gt;  /*&lt;br /&gt;   * During the login process(i.e. when the login() method on the LoginContext is called),&lt;br /&gt;   * the control will be transferred to a CallbackHandler. The CallbackHandler will be&lt;br /&gt;   * responsible for populating the Callback object with the username and password, which&lt;br /&gt;   * will be later on used by the login process&lt;br /&gt;   *&lt;br /&gt;   * The "MyCallbackHandler" is your own class and you can give any name to it. MyCallbackHandler&lt;br /&gt;   * expects the username and password to be passed through its constructor, but this is NOT&lt;br /&gt;   * mandatory when you are writing your own callback handler.&lt;br /&gt;   *&lt;br /&gt;   *&lt;br /&gt;   */&lt;br /&gt;  MyCallbackHandler handler = new MyCallbackHandler(userName,password);&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * Create a login context. Here, as the first parameter, you will specify which&lt;br /&gt;    * configuration(mentioned in the "authFile" above) will be used. Here we are specifying&lt;br /&gt;    * "someXYZLogin" as the configuration to be used. Note: This has to match the configuration&lt;br /&gt;    * specified in the someFilename.someExtension authFile above.&lt;br /&gt;    * The login context expects a CallbackHandler as the second parameter. Here we are specifying&lt;br /&gt;    * the instance of MyCallbackHandler created earlier. The "handle()" method of this handler&lt;br /&gt;    * will be called during the login process.&lt;br /&gt;    */&lt;br /&gt;   LoginContext lc = new LoginContext("someXYZLogin",handler);&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * Do the login&lt;br /&gt;    */&lt;br /&gt;   lc.login();&lt;br /&gt;&lt;br /&gt;   System.out.println("Successfully logged in user: " + userName);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  } catch (LoginException le) {&lt;br /&gt;&lt;br /&gt;   System.out.println("Login failed");&lt;br /&gt;   le.printStackTrace();&lt;br /&gt;   return;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  try{&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * Now that the user has logged in, invoke the method on the EJB&lt;br /&gt;    */&lt;br /&gt;&lt;br /&gt;   Context context = new InitialContext();&lt;br /&gt;&lt;br /&gt;   //lookup the home object&lt;br /&gt;   Object lookupObj = context.lookup("MyTestEJBHomeJndiName");&lt;br /&gt;   MyTestEJBHome home = (MyTestEJBHome) PortableRemoteObject.narrow(lookupObj, MyTestEJBHome.class);&lt;br /&gt;&lt;br /&gt;   //create the bean object from the home object&lt;br /&gt;   MyTestEJB myBean = home.create();&lt;br /&gt;&lt;br /&gt;   //invoke the method on the bean&lt;br /&gt;   myBean.someMethod();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  } catch (RemoteException re) {&lt;br /&gt;&lt;br /&gt;   System.out.println("Remote exception: ");&lt;br /&gt;   re.printStackTrace();&lt;br /&gt;   return;&lt;br /&gt; &lt;br /&gt;  } catch (NamingException ne) {&lt;br /&gt;&lt;br /&gt;   System.out.println("NamingException: ");&lt;br /&gt;   ne.printStackTrace();&lt;br /&gt;   return;&lt;br /&gt; &lt;br /&gt;  } catch (CreateException ce) {&lt;br /&gt; &lt;br /&gt;   System.out.println("CreateException: ");&lt;br /&gt;   ce.printStackTrace();&lt;br /&gt;   return;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; } //end of main()&lt;br /&gt;&lt;br /&gt;} //end of SomeStandAloneClient&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;Now the CallbackHandler:&lt;/span&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;package myapp;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import javax.security.auth.callback.Callback;&lt;br /&gt;import javax.security.auth.callback.CallbackHandler;&lt;br /&gt;import javax.security.auth.callback.NameCallback;&lt;br /&gt;import javax.security.auth.callback.PasswordCallback;&lt;br /&gt;import javax.security.auth.callback.UnsupportedCallbackException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * CallbackHandler which will be invoked by the login module during the login&lt;br /&gt; * process of the client. This is a simple CallbackHandler which sets the username&lt;br /&gt; * and password, which will be later used by the Login module for authorizing the&lt;br /&gt; * subject. This class only handles NameCallback and PasswordCallback. It throws&lt;br /&gt; * an UnsupportedCallbackException, if the Callback is other than the two mentioned&lt;br /&gt; * above.&lt;br /&gt; * The username and password are provided as input to this class through its constructor.&lt;br /&gt; *&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;public class MyCallbackHandler implements CallbackHandler {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Username which will be set in the NameCallback, when NameCallback is handled&lt;br /&gt;  */&lt;br /&gt; private String username;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Password which will be set in the PasswordCallback, when PasswordCallback is handled&lt;br /&gt;  */&lt;br /&gt; private String password;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * Constructor&lt;br /&gt;  * @param username The username&lt;br /&gt;  * @param password The password&lt;br /&gt;  */&lt;br /&gt; public MyCallbackHandler(String username, String password) {&lt;br /&gt;  this.username = username;&lt;br /&gt;  this.password = password;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; /** &lt;br /&gt;  * @param callbacks Instances of Callbacks &lt;br /&gt;  * @throws IOException IOException &lt;br /&gt;  * @throws UnsupportedCallbackException If Callback is other than NameCallback or PasswordCallback &lt;br /&gt;  */ &lt;br /&gt; public void handle(Callback callbacks[]) throws IOException, UnsupportedCallbackException {&lt;br /&gt;&lt;br /&gt;  for(int i = 0; i &lt; callbacks.length; i++) {&lt;br /&gt;      if(callbacks[i] instanceof NameCallback) {&lt;br /&gt;   NameCallback nc = (NameCallback)callbacks[i];&lt;br /&gt;   nc.setName(username);&lt;br /&gt;      } else if(callbacks[i] instanceof PasswordCallback) {&lt;br /&gt;   PasswordCallback pc = (PasswordCallback)callbacks[i];&lt;br /&gt;   pc.setPassword(password.toCharArray());&lt;br /&gt;      } else {&lt;br /&gt;   throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;The file containing the login configuration(in our case "someFilename.someExtension"):&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;color:#660000;"&gt;someXYZLogin{&lt;br /&gt;org.jboss.security.ClientLoginModule required;&lt;br /&gt;};&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;Remember, the someXYZLogin configuration name is the same that i provided to the constructor of the LoginContext. The contents of the above file let the LoginContext know, which class will be actually responsible for doing the login. In this case, since i am using jboss, we have specified "org.jboss.security.ClientLoginModule" as the class.&lt;br /&gt;&lt;br /&gt;Please make sure that the login configuration file is under the same directory from where you will be running your client.&lt;br /&gt;&lt;br /&gt;The command to run your client is the same that you would use to run a normal java class:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;color:#660000;"&gt;java SomeStandAloneClient someUsername somePassword&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;The someUsername and somePassword will be the arguments that you will pass to the main() method.&lt;br /&gt;&lt;br /&gt;This is just a simple example. Internally, there are a lot of things, that go on as part of login. The following link has a great explanation about the same(JAAS related things are explained starting from the "An Introduction to JAAS" section in that article). I highly recommend, to go through it atleast once:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.huihoo.com/jboss/online_manual/3.2.3/Chap8.html"&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;Article on Security&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:georgia;font-size:85%;color:#660000;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115200247714809892?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115200247714809892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115200247714809892' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115200247714809892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115200247714809892'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/07/accessing-secure-ejb-through.html' title='Accessing a secure EJB through a standalone java client'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30587633.post-115192145110623396</id><published>2006-07-03T15:39:00.000+05:30</published><updated>2006-10-30T19:21:43.703+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Introductory post</title><content type='html'>Thought of putting in one place, all the technical stuff that i get to learn while working as a software developer in J2EE field.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30587633-115192145110623396?l=jaitechwriteups.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaitechwriteups.blogspot.com/feeds/115192145110623396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30587633&amp;postID=115192145110623396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115192145110623396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30587633/posts/default/115192145110623396'/><link rel='alternate' type='text/html' href='http://jaitechwriteups.blogspot.com/2006/07/introductory-post.html' title='Introductory post'/><author><name>Jaikiran</name><uri>http://www.blogger.com/profile/08503182723143814781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
