I am looking for a powerfull up to date Java OSGI framework for WEB,
which would allow
Modular architecture (OSGI)
Flexible Views (JavaScript, HTML, Templates...)
String MVC separation
Maybe preimplemented CMS modules?
Is developed actively and open source
What I found was
ZEND for PHP. Does the Java world offer something comparable?
Spring Spliced may be the solution
Eclipse RAP, can OSGI but does not offer Views which are flexible enough
... ?
Take any std. framework of your choice and deploy it on top of Karaf (if you don't want to hassle with building your own OSGi runtime environment), or if you want to build everything up from scratch take also Pax-Web into account it also supports Servlet 3.0 and OSGi take a look at the home page of Pax-Web.
I'm quite fond of Vaadin, it plays nice with OSGi, and it's quite active.
It's a UI toolkit, based on Google GWT.
Mind you, you still have quite some decisions to make: You can use an OSGi framework 'straight up', like Felix or Equinox, but perhaps you'll be better off using an application server, like Apache Karaf or Eclipse Virgo.
You should look at Apache (Felix) Sling or its commercial version CQ5 (formerly Day Software). It is fully based on OSGi.
I'm developing OSGi based web applications on a daily base. We have a slightly alternative approach which works very well:
RESTful web services implemented using OSGi services
Modular AngularJS based user interface, packaged in OSGi bundles
Although AngularJS is obviously not a Java web framework, it fits modern web development perfectly. If you are familiar with Java MVC web frameworks it's also easy to understand Angular.
The main question is how to modularize your code. At the backend we implement everything as OSGi services. RESTful webservices are implemented with JAX-RS using the Amdatu (amdatu.org). With Amdatu you can use JAX-RS in a way that fits OSGi well. Each RESTful resource and lower level services are packaged in separate bundles as well, so the backend is fully modular.
To modularize the UI itself we separate functional different parts of the application as different Angular applications. Each Angular application is packaged in separate bundles as well, using the Amdatu resource provider.
You could test Konekti a Open Source OSGi business platform powered by Eclipse Virgo OSGi Container developed by Thingtrack.
Vaadin.
Spring.
JasperReport.
Quartz.
JBoss JBmp, drools.
Apache Camel, ActiveMQ.
And many more
http://www.konekti.org
Related
I am creating a new web application where I am using JPA, EJB and all the goodnes from JavaEE. However, I have been doing some JSF in the past (yes the latest version) and I personally don't like that much. So I have been introduced to Play Framework which is pretty awesome from what I have read so far. Now I want to use the Java EE backend with the Play framework. How would you do that? In order to use EJBs etc you need a EJB container and all that is provided by servers such as Glassfish, JBoss etc and Play framework use Netty (if I am correct). So how would you make these technologies talk together? Webservice (REST), RMI...?
And would the performance/lag be very high? I will have both servers running on the same VPS.
If you are using Play 1.x (which I suspect that you would be since it sounds like you are looking to use Java, not Scala?), then you could use the Play Spring Module.
I have not personally used this module with Play, I have stuck with the out-of-the-box structure (which uses JPA, btw).
AFAIK, you'll have two options:
Use an embeddable EJB container and start it in the Play 2.0 Global.onStart(). It exists these kinds of containers for various Java EE servers (JBoss, Glassfish etc...)
Use webservices served from your Java EE app, but it will add a new "layer", and it should be slower.
I've started looking at osgi with the main purpose to achieve the task ahead of me. Basically i would be able to distribute an web based application and build specific features of the whole web app separately in such a way that i can deploy at A my web app with features a,b,c and deploy at B with features a,c,d.
A little like how one can install plugin in joomla. So for example when i want to add a different aspect of the web application, i would build a small war with all the html and its admin section and have this feature admin section available in the main admin panel.
Second question is about Spring DM. most likely i will be using Spring and it seem logical i see what Spring DM has to offer.After downloading Spring DM .1.2.1 i found out that its lib folder contains spring jars for version 2.5.6.SEC01 but i planned on using 3.1.2 so am a little confuse as how everything will play nice together.
Thanks for reading
I've just been doing such an exercise so I can shed some light how you do it without the overhead of Spring. I've made a clear division: all application code is in the browser, all data handling is in the server. With HTML5 the browser has grown up to an impressive, portable, and powerful application environment. One has multiprocessing, messaging, modularity, and amazing visuals. I am using angularjs as the framework in the browser.
Angular works with a central routing table mapping the hash part of the page url to "modules" in Javascript. This makes it very easy to define what modules are part of the application. The server can easily control this part.
On the server side I have bundles that carry the Javascript code, the html fragments and the data handling. I based this on the OSGi Http Server model since it is more flexible. However, I added proper support for static resources in bundles: caching, streaming, ranges, etc.
In the server I used DS and bndtools to develop the bundles. This is an impressive development experience since it works like Smalltalk. You change and it is immediately reflected in the server. Adding bundles, removing bundles, the server keeps on running. Server restarts are rare during development.
The disadvantage is that there are unfortunately very few components that leverage OSGi. Most components, with Spring being the archetypical example, rely heavily on class loading hacks to wire applications from a central point. This is fundamentally not modular. For this reason I had to develop many highly cohesive and uncoupled components that leverage the OSGi service model. Once I get time I will donate them to an open source project.
I'm not sure you need to be considering OSGi, at least not directly, to achieve your state requirements. You said:
Basically i would be able to distribute an web based application and
build specific features of the whole web app separately in such a way
that i can deploy at A my web app with features a,b,c and deploy at B
with features a,c,d.
If these are youre requirements, then you don't actually need to concern yourself with OSGi directly, but rather find a web app framework that supports modular extensions. Which most likely means that the framework itself uses OSGi. I'm not familiar with Spring, but I do know that Struts 2 ( a comparable web app framework ) has an OSGi based plugin meant to achieve your use case.
On the other hand, if your idea is to play with OSGi, then I suggest you pick a lower level task, such as writing a web application framework, rather than a web app itself.
Is there any tutorial on web for developing a simple web service(Spring framework)from scratch in ibm rad 7.5?
See Which framework is better CXF or Spring-WS?
Tutorials:
Spring WS
Apache CFX
There are a lot of tutorials on the Spring site for Spring Web Services, especially since they just came out with v 2.0 today. I'm not aware of any that deal with a specific IDE environment, unless its maybe the new Spring flavor of Eclipse they've released, STS. One thing to keep in mind is that Spring web services are "contract first", so you have to create all your XML schemas for your service data structures, vs the code first that a lot of us are used to using Jax-WS, though there are many that say that contract first is THE way to go, for a lot of reasons.
YMMV
I am intermediate in java now I am planning to move to java web-services...
How can i get started with web-services?
What are the prerequisites?
Thanks...
To get started with web services in Java, I would recommend to use the Java API for XML Web Services A.K.A. JAX-WS. The reference implementation of this API (JAX-WS RI) is included in Java 6 (since Java 6 update 4) so you don't have anything to install if you are using Java 6u4+. Like the other APIs of Java EE, JAX-WS uses annotations to simplify the development and deployment of web service clients and endpoints. This API supports both Java-first and contract-first approaches (the former begin debatable but, well, this is the easiest way to get started).
You'll find many good tutorials on the NetBeans website, see Getting Started with JAX-WS Web Services or Developing JAX-WS Web Service Clients for example. When it comes to web services, I must say that NetBeans has actually far more better support than Eclipse and would be my recommend IDE. I do not want to go to much into the details (because things will become confusing) so I'd just recommend to use GlassFish for the deployment of your JAX-WS web services, it has everything required included 1.
But please, forget Axis 2 and its horrible deployment model (to be honest, I don't understand why people keep mentioning Axis 2, maybe only because it has been promoted by IBM with its Eclipse support).
You'll find plenty of other resources on Glen Mazza's Weblog, for example the "famous" DoubleIt tutorial.
If you want to go further, have a loot at this great online Web Services Course from JavaPassion (great resources, as always).
1 If really you want to know, the web services stack in GlassFish is called Metro. Metro includes JAX-WS RI (the reference implementation of JAX-WS) and WSIT (that provides an implementation of others WS-* standards for Secure, Reliable, Transactional and Interoperable Web services). Another implementation of JAX-WS is Apache CXF. You may find all these terms in the literature. For now, I'd stick with JAX-WS RI with GlassFish as container and NetBeans as IDE.
This is a must if you plan to provide (SOAP based) webservices or want to get a feeling on how to consume services: soapUI
And I am quite happy with eclipse's web tools platform when it comes to designing xml schemas and wsdl files.
One of the most common java libraries is apache axis2. Pretty sure, they have a lot of documentation and tutorials on their pages.
Just start with apache tomcat and run a web-application in it with a small servlet or JSP, and then once you master a bit how to create web applications for tomcat, go and check axis2, this is a web application that gets installed in tomcat, then you will be able to run your own web services in axis2.
If you one something more advanced you could go and check EJB3 and create a stateless session bean that will work as a web service... but this is more advanced and is much more difficult to set up an EJB3 project, I advise starting with tomcat/axis2.
good luck.
Do you know a technology which can provide me a portlet-like interface?
But I do not want to use JSR 168/268 portlet specifications and a portlet container.
The reason is: My web app is a product which can be installed on the client's server (it can be weblogic/websphere/tomcat).
Packing the portlets container along with my application to be installed on clients web server is just too much.
Besides, there are a lot of features this technology offers which I don't need. Actually, all I need is the porlets look and feel (dragable and customizable windows,adding and removing windows and so on).
I know there is also the possibility to do it with client technology (like jquery) and that is cool, but I would like to know if there is any kind of java technology out there which will also give me that.
So, if you know something like a struts or a spring-mvc component library which does this job or maybe a third party product, I would like to know.
If you think my whole approach is wrong I would also like to know that.
Take a look at gwtportlets. From their site;
GWT Portlets is a free open source web
framework for building GWT (Google Web
Toolkit) applications. It defines a
very simple & productive, yet powerful
programming model to build good
looking, modular GWT applications.
The programming model is somewhat
similar to writing JSR168 portlets for
a portal server (Liferay, JBoss Portal
etc.). The "portal" is your
application built using the GWT
Portlets framework as a library.
Application functionality is developed
as loosely coupled Portlets each with
an optional server side DataProvider.
Take a look at the demo here
Another suggestion would be JSF 2.0 which provide AJAX support for updating part of the HTML-page out of the box.
Have a look at this series to get an idea of the possibilities:
http://www.ibm.com/developerworks/java/library/j-jsf2fu1/index.html