2-5 years, j2ee will be a thing of the past.
i believe it has failed in achieving it's aims. i'm not sure what those aims were exactly, but i find j2ee hard to use. people have tried to make it easy to use by adding further frameworks on top, e.g. spring/struts. i always believed that servlets and jsps were enough, with a good bit of design to seperate display logic, business logic and database logic. that's the kind of design you should apply in any type of application (e.g. .net, php), not just j2ee.
let's face it, ejbs were always a bit rubbish. ejb3 has tried to become the silver bullet object-relational-mapping solution but i'm just not convinced there's very little modularity about ejbs. your application is tightly coupled to the interfaces they declare and there's no getting away from that. if the implementation of those interfaces are not available your application will not work. ok so an ejb may be used by several applications, but in reality... i've never seen that! further more it isn't as though you can have code dynamically contributing application functionality at runtime with a web app. and don't get me started on the hibernate nightmare!
so step aside j2ee and welcome osgi. i believe it's already starting to happen. some of the big app servers are already moving over to an osgi based architecture; ibm's websphere was already there, of course. my worry is that they'll do it wrong and it's such a simple thing to get right. rather than producing app-servers they should be producing high quality, enterprise capable osgi compliant frameworks. creating a web app as an osgi plugin is already easy since there should be an http-service running in your framework. you can just look it up, register your servlet and away you go. the ibms and weblogics of the world should focus on making it happen fast and reliably. i think you can forget sun on this one though. my impression is they see osgi as a threat and are deliberately trying to avoid it, though before long osgi or something like it will become part of the java specification.
and anyway, back to databases. since this is java we're talking about shouldn't we be doing things with objects and not having to worry about mapping them to a relational schema? which leads me to my next prediction...
5-10 years, rdbms will be a thing of the past.
rdmbs are great for procedural languages, but most modern languages deal with objects. pretty much every modern language deals with objects. what a waste of time mapping objects to a relational schema when you could just be storing your objects directly in to a oodbms. oracle 9i (i think, definately 10) has object support in it, but you still access the database in a relational way. i think the team over at db4o have the right idea and their solution works for all versions of java and .net. great stuff! and it runs in an osgi container. even better.