Skip navigation
alesj

Blog @ In Relation To

Posted by alesj Aug 21, 2010

Currently blogging at "In Relation To":

* http://relation.to/Bloggers/Ales

Again, just in case you missed it - which would be quite hard, since we did 'invest' into publicity this time. :-)

JBoss Application Server 5.0.0.CR1 has been released and is available for download from

https://sourceforge.net/project/showfiles.php?group_id=22866&package_id=16942&release_id=610469

 

Detailed Release Notes:

https://sourceforge.net/project/shownotes.php?release_id=610469&group_id=22866

And the publicity that I've mentioned:

Dimitris talks about it here:

http://www.infoq.com/news/2008/06/jboss-as5-rc1

 

And Sacha's blog:

http://sacha.labourey.com/2008/06/28/jboss-as-50-status

It's been great to finally see it come out.

 

 

OK, back to the usual - my Spring deployer. ;-)
With a few changes in the deployers and complete classloading re-wamp, Spring deployer also needed a minor update.
Here is the latest build:
- SpringDeployer 3.1 at SourceForge

Alongside Microcontainer project a new VFS project was developed. VFS stands for Virtual File System, a simple read-only framework abstracting the way we look at the 'file' system.
The two key points there are that we don't limit ourselves with the underlying 'file' system, meaning the file can be basically anything that has specific 'file' semantics, ranging of course from plain/real file system to in-memory byte 'file' representation (the two that we currently implement), or perhaps even some LDAP or relational database. The other key point is the way you traverse over path. We've seen a lot of duplicate code all over the place where the code was asking the resources whether they are plain files/directories or archives, asking the URL connection if it's plain file or jar connection, ... With VFS you just put in a path or URL, and the framework abstracts all the details for you, hiding them behind simple VirtualFile API.
But of course something like that comes with a cost, expecting other written frameworks not to understand VFS protocol, since they mostly limit itself to what default JDK provides (a horrible URL handling code for Windows ;-).
We first encountered this with Facelets while deploying Seam apps. So here is the fix: And with connection to SpringDeployer and Spring's ability to do scanning for components, this issue poped-up:
- Spring deployer and component scanning on JBoss forum
The fix is already part of SpringDeployer 3.1, or you can use just the VFS based resource pattern resolver from here:
- VFS and ResourcePatternResolver

 

 

Aha, not to forget, JBoss5 has a whole new forum dedicated just to the issues with the new CR1 (and future JBoss5) release.
- JBoss5 forum

 

OK, that's it from me.
Probably till next JBoss5 release. ;-)
For all those who missed yesterday's announcement: - JBossAS5 Beta3
I won't go into details, the massive release docs say it all.
But let me just say it's been a complete revamp of AS, down to the core aka kernel. :-)

 

 

 

 

For those more interested in the new kernel - JBoss Micocontainer - here's where you can now learn more: - JBoss Microcontainer 2.0 User Guide
The current version of JBoss Microcontainer is Beta9, which is also used in current JBossAS5 Beta3, and can be easily used via our Maven2 repository: JBoss Microcontainer Maven2 repository

 

 

Since all my previous blog posts included an update of Spring Deployer, this one is no exception.
With the new AS kernel there came a new much improved Deployers architecture as well. As such, the old SpringDeployer wasn't compatible any more. So, I've rewritten the existing SpringDeployer to be compatible with the new style deployers. Since new deployers are more fine grained, this meant splitting the existing deployer into two aspect deployers - one able to recognize -spring.xml files, the second one instantiating BeanFactory and binding it into JNDI.
The rest of the Spring beans injection logic remained the same.
Here's the link to the binaries: Spring Deployer 3.0
As before, simply drop the jboss-spring.deployer into JBOSS_HOME/server/your_config_here/deployers directory. This will currently pick up all meatdata files that end with -spring.xml. To support the old .spring archive, simply rename them to .jar :-), or add a .spring suffix to JARStructure - for more details, turn to our forum.

 

 

And since it's almost holidays time, happy Xmas and successful year 2008 to you all. I know we're gonna have a blast, JBoss5 star is looking bright!
Finally found some time - after Spring 2.0 release - to make SpringDeployer compatible with it.

 

The changes weren't very drastic. Spring reworked their xml parsing stuff - lot less xml and (better) xsd support. They simply deprecated some XML parsing classes - which were easily replaceable - updating my slightly changed parser.

 

What's new with this release, else than compatibility? I added 'bean by type' support to @Spring annotation. What this means is, that you don't have to define bean's name if you are aware that there is exactly one bean which satisifies class type requirement. If there are multiple such beans - which satisfy class type requirement - we use default name. What is default name - in case of the field it is filed's name, in case of method it is a simple pojo setter/getter name. Since a code tells more than words, here it is :-)

private Object getObjectFromBeanFactory(Spring spring, String defaultBeanName, Class beanType) throws Exception

{

   BeanFactory beanFactory = (BeanFactory) Util.lookup(spring.jndiName(), BeanFactory.class);

   String beanName = spring.bean();

   if (beanName != null && beanName.length() > 0)

   {

      return beanFactory.getBean(beanName, beanType);

   }

   else

   {

      // by type injection

      if (beanFactory instanceof ListableBeanFactory)

      {

         ListableBeanFactory lbf = (ListableBeanFactory) beanFactory;

         Map beans = lbf.getBeansOfType(beanType);

         if (beans.size() > 1)

         {

            Object bean = beans.get(defaultBeanName);

            if (bean == null)

            {

               throw new IllegalArgumentException("More than one bean of type: " + beanType);

            }

            return bean;

         }

         else if (beans.size() == 1)

         {

            return beans.values().iterator().next();

         }

         else

         {

            throw new IllegalArgumentException("No such bean by type: " + beanType);

         }

      }

      else

      {

         // bean factory is not listable - use default bean name

         return beanFactory.getBean(defaultBeanName, beanType);

      }

   }

Here I would like to thank c.vidal from the forum, for initializing the whole thing - also writing much of the code / patch. This has been a long time on my todo list, just needed a little kick. ;-)

 

Ok, we are slowly getting unnecessary definition info out of the @Spring annotation. Currently working on getting that jndiName attribute out too. Should be done something similar to EJB3 PersistenceContext default unit name - when there is just one persistence context in your deployment, you don't need to supply unit name.

 

As JBoss Microcontainer is getting more and more momentum - with new JBoss5 and its deployers - work in progress also involves rewriting SpringDeployer to new deployers concept - see JIRA JBMICROCONT-26.

 

Just like to invite everybody to my JBossWorld Berlin presentation - Microcontainer and contextual injection.

 

Have fun using compatible SpringDeployer :-).

 

ps: if somebody needs some examples redone / fixed - just let me know on the forum (didn't have time to test them ... but did test Deployer with my current job project - it works :-)
alesj

JBoss-Spring example fix

Posted by alesj Aug 3, 2006
As I was greatfully warned in the forum - the example shipped with Spring deployer wasn't working with the latest JBossAS + EJB3.

 

So here is the bug fix - forgot about new EJB3 JNDI naming :-( - JBoss-Spring.ear fix.

 

Thanks to the reporter - skedrf.

 

Rgds, Ales

alesj

My JBossWorld in Las Vegas

Posted by alesj Jun 24, 2006
It's been an amazing week in Las Vegas.
If you ever have a chance to go to LV, don't hesitate - a must see!

 

 

It's all about entertainment - gambling, shows, beautiful women, ...
And JBW was no exception. Ok, not the same kind of entertainment :-), but still a lot of fun. Atmosphere was exceptionally relaxed, great RedHat merger for sure doing its part. Each day ending with easy going coctail party, with a lot of interesting conversations going on - with other attendees as well as JBoss' core developers. And I think that fameous JBoss party doesn't need any introduction, fabulous pictures tell it all: JBossWorld party by Michael Yuan.

 

 

I attended many different sessions. When looking back at the topics that they covered you really see how huge JBoss JEMS really is. And the stuff is keep on being implemented and integrated - new Messaging and Transactions, Drools, ESB, ...

 

 

The main attraction of the conference was definitely JBoss Seam and its founder Gavin King. Yep, he's a rock star :-).

 

 

My session was good - or probably you should ask the people that listened to what I had to say. I did cover everything that my JBoss Spring intergation involves in connection to JBoss AS and EJB3. Definitely my talking skills have to improve - practice practice practice. It definitely is not easy for non native speaker to talk about subject which is not totally trivial. There were some interesting questions at the end, and Dimitris pointed out an obvious solution / fix to my deployer implementation - it is already work in progress.

 

 

But the main point of JBW for me was to finally personally meet people I often communicate with (via MSN, forum topics, emails, ...) - Bill, Julien, Emmanuel, Gavin, Adrian, Dimitris, Thomas, Bela, Scott, Jason, Koen, ...

 

 

And [remember], shaking hands with Marc was cool too :-).

 

 

Rgds, Ales
Uf, finally some update on JBoss/Spring Integration stuff.

 

 

First there is update on the EJB3 compatible stuff with JBoss AS 4.0.4.GA.

 

 

The second release is update with EJB3 preview RC8.

 

 

http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=161914

 

 

Try it out. Report any bugz on the forum. :-)

 

 

Rgds, Ales
alesj

My first JBoss blog

Posted by alesj Jun 2, 2006
Thanx to Bill I now have my own JBoss blog.

 

 

How do I fit into this picture?

 

 

This is how I became a small part of JBoss family: Spring and EJB 3.0 in Harmony

 

 

One week from tomorrow I'm off to Las Vegas for JBoss World. Looking at the agenda one can see that it is going to be a great event - lots of interesting JEMS sessions, presented to you by the lead developers themself. There is also my session if you are interested - as you can see, it is a continuation of previously mentioned article.

 

 

Currently my interest is on JBoss Portal, Seam and of course EJB3 - since we are in the middle of developing a new enterprise application, using best of all three projects.

 

 

When you are using a lot of EJB3 stuff, embeddable EJB3 container comes real handy with unit testing - and I believe Bill just did a new release - check it out!

 

 

Just in case any JBoss/Spring user stumbles on this before Sunday - new release compatible with the latest EJB3 release in JBoss AS 4.0.4.GA is coming at the end of the weekend, in the worst case on Monday morning.

 

 

Rgds, Ales

Filter Blog

By date:
By tag: