Vaadin OSGI Application

Hi,

I am trying to develop a simple Vaadin-OSGI application.
I have gone through various Vaadin-OSGI samples available but not able to understand how to convert simple vaadin application into Vaadin-OSGI application.

Is there any way to create a Vaadin-OSGI project by default ?

I am using Eclipse IDE which has OSGI framewrok already installed.

Haven’t tried it out myself, but there’s at least
this example
that you can try out.

You can also check :


http://wiki.rpgnextgen.com/doku.php?id=vaadin_7_osgi_web_application

I have been also sturggling to get my vaadin plugin working with OSGi for the last few days. Have made some little progress. Will tell you what I did and am planning to do. If you need some help please ask.

1 : Started by having all the vaadin plusigns in thelib folder of my plugin (all plugins have all the vaadin modules) and the packaging type war.
2 : Next step was to move from war to bundle
3 : One of the most crucial step was moving all my Vaadin related libraries to karaf. This is where the example I mentioned above helped me.

The main reason the example mentioned by Kim diodnt worked for me was that I am using old setup (OSGI : 4.1.1, Vaadin : 7.3.3 and Java 6).

The next immediate step for me would be have different Vaadin based submodules which could be deployed and undeployed from OSGi at runtime.

Any such simple demo for Eclipse (Equinox)?

you can try this


https://github.com/niveo/vaadin-osgi-glassfish

Thanks Niveo for such simple and elegant example.

By going through the source i am able to understand the concept but still not able to understand how to create a fresh new vaadin-osgi based application.
Do i need to create a Plugin based project or Maven project or vaadin project?
Still a bit confused in creating a new application using eclipse.
Any guide for same will be helpful.

Go ahead with the maven based project. I havent created a vaadin or plugin project in eclipse. But I think it just gives you extra features and boilerplate code which you would have to write yourself if you start from a normal project. So, you can create any of these projects and remove the parts that are not needed or start from bare bones and gradually move towards your goal.

I would also hijack your post abit :slight_smile: and ask Niveo or if someone knows that how can I add resources to my submodules. It would be great if you could look into https://vaadin.com/forum#!/thread/10136425

Hi Salman,

After creation of Maven Project , do we need to manually add Bundle Activator Class which gets created automatically in case of Plugin project?
Also i am still not able to understand how to thereafter link Osgi bundle with Vaadin i.e. linkage of osgi environment and vaadin server environment.

Any basic working step guide of vaadin-osgi using eclipse will be of great help

Hi,

I have managed to create an OSGI Declarative Service using Eclipse.

In my service implementation i am trying to notify user with Notification class.

But in MANIFEST.MF i am not able to export com.vaadin.ui package which is required to use this service.
While exporting service error comes “com.vaadin.ui” package not found.

There is no compilation error and i have manually added vaadin jars in build path of project

Any solution for same?

Error log is as follows

4/6/15 12:50:08 AM IST

Eclipse Compiler for Java™ v20150120-1634, 3.10.2, Copyright IBM Corp 2000, 2013. All rights reserved.


  1. ERROR in C:\Users\Abhishek\Desktop\Abhi Data\MODCMS\MMI_Workspace\ServiceFactory\src\modcms\cms\servicefactory\ComponentServiceImp.java (at line 3)
    import com.vaadin.ui.Notification;
    ^^^^^^^^^^
    The import com.vaadin cannot be resolved

  1. ERROR in C:\Users\Abhishek\Desktop\Abhi Data\MODCMS\MMI_Workspace\ServiceFactory\src\modcms\cms\servicefactory\ComponentServiceImp.java (at line 33)
    Notification.show(“This notification is part of OSGI Service Bundle”);
    ^^^^^^^^^^^^
    Notification cannot be resolved

2 problems (2 errors)