Skip to main content



      Home
Home » Eclipse Projects » Virgo » How to deploy Vaadin app to Virgo Jetty Server?(I would like to deploy Kai Tödter's excellent Vaadin & OSGi demo app to Virgo.)
How to deploy Vaadin app to Virgo Jetty Server? [message #728247] Thu, 22 September 2011 15:21 Go to next message
Eclipse UserFriend
Hi,

Kai Tödter has a great Vaadin and OSGi demo app:
http://www.toedter.com/blog/?p=412

I wanted to deploy it to Virgo Jetty Server, so I created the following plan:
<?xml version="1.0" encoding="UTF-8"?>
<plan name="osgi_vaadin_demo.plan" version="1.0.0" scoped="true"
	atomic="true" xmlns="http://www.eclipse.org/virgo/schema/plan"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
		        http://www.eclipse.org/virgo/schema/plan
		        http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd">

	<artifact type="bundle" name="javax.servlet" version="2.5.0.v200910301333" />
	<artifact type="bundle" name="slf4j.api" version="1.6.1" />
	<artifact type="bundle" name="ch.qos.logback.classic" version="0.9.28" />
	<artifact type="bundle" name="com.vaadin" version="6.5.7" />
	<artifact type="bundle" name="ch.qos.logback.core" version="0.9.28" />
	<artifact type="bundle" name="org.vaadin.osgi" version="1.0.1" />
	<artifact type="bundle" name="org.vaadin.osgi.staticres" version="1.0.1" />
	<artifact type="bundle" name="com.siemens.ct.pm.model.minimal" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.pm.model" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.pm.model.basic" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.treeview" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.theme" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.tableview" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.saveaction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.runoraction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.reindeeraction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.printaction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.main" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.logback" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.bundleview" version="1.0.0.201109132107" />
</plan>


I copied the bundle jars into the $SERVER_HOME/repository/usr/ directory, then I started the server.
Once the server started I copied the above plan into the $SERVER_HOME/pickup/ directory, and the plan was successfully started.

However when I tried to open the demo URL, I got a Jetty error.
I tried the following URLs, but none of them worked:
http://localhost/com.siemens.ct.osgi.vaadin.pm.main
http://localhost:8080/com.siemens.ct.osgi.vaadin.pm.main

Please let me know what I am doing wrong.

Many thanks,
Marton
Re: How to deploy Vaadin app to Virgo Jetty Server? [message #728249 is a reply to message #728247] Thu, 22 September 2011 15:33 Go to previous messageGo to next message
Eclipse UserFriend
Some of the bundles that you are deploying are already started. You might be running into a situation described here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=357850

Try this plan definition:

<?xml version="1.0" encoding="UTF-8"?>
<plan name="osgi_vaadin_demo.plan" version="1.0.0" scoped="true"
	atomic="true" xmlns="http://www.eclipse.org/virgo/schema/plan"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
		        http://www.eclipse.org/virgo/schema/plan
		        http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd">

	<artifact type="bundle" name="com.vaadin" version="6.5.7" />
	<artifact type="bundle" name="org.vaadin.osgi" version="1.0.1" />
	<artifact type="bundle" name="org.vaadin.osgi.staticres" version="1.0.1" />
	<artifact type="bundle" name="com.siemens.ct.pm.model.minimal" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.pm.model" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.pm.model.basic" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.treeview" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.theme" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.tableview" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.saveaction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.runoraction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.reindeeraction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.printaction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.main" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.logback" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.bundleview" version="1.0.0.201109132107" />
</plan>


If you encounter problems - please post back with the logs/stacktraces if any. Can you also try it on the virgo-tomcat distro? With jetty - virgo gives a lot of control back to jetty where with tomcat there is a tighter integration.

Regards,
Dmitry
Re: How to deploy Vaadin app to Virgo Jetty Server? [message #730177 is a reply to message #728249] Tue, 27 September 2011 15:36 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for the hint, Dmitry!
(And sorry for the late response, I am the busy father of two. Smile )

Unfortunately the suggested plan did not work, because the com.siemens.ct.osgi.vaadin.pm.logback fragment was missing its host bundle: ch.qos.logback.classic.

However the following plan could be deployed properly:
<?xml version="1.0" encoding="UTF-8"?>
<plan name="osgi_vaadin_demo.plan" version="1.0.0" scoped="true"
	atomic="true" xmlns="http://www.eclipse.org/virgo/schema/plan"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="
		        http://www.eclipse.org/virgo/schema/plan
		        http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd">
	<artifact type="bundle" name="ch.qos.logback.core" version="0.9.28" />
	<artifact type="bundle" name="ch.qos.logback.classic" version="0.9.28" />
	<artifact type="bundle" name="com.vaadin" version="6.5.7" />
	<artifact type="bundle" name="org.vaadin.osgi" version="1.0.1" />
	<artifact type="bundle" name="org.vaadin.osgi.staticres" version="1.0.1" />
	<artifact type="bundle" name="com.siemens.ct.pm.model.minimal" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.pm.model" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.pm.model.basic" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.treeview" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.theme" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.tableview" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.saveaction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.runoraction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.reindeeraction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.printaction" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.main" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.logback" version="1.0.0.201109132107" />
	<artifact type="bundle" name="com.siemens.ct.osgi.vaadin.pm.bundleview" version="1.0.0.201109132107" />
</plan>


Unfortunately this plan does not work either, neither on Jetty nor Tomcat servers.

Do you guys have any more clue?

Thanks,
Marton
Re: How to deploy Vaadin app to Virgo Jetty Server? [message #730188 is a reply to message #730177] Tue, 27 September 2011 16:09 Go to previous messageGo to next message
Eclipse UserFriend
Oh dang Smile

Virgo already ships with logback (as part of the medic bundles). Is there anything specific in com.siemens.ct.osgi.vaadin.pm.logback bundle? If it is just configuration - you could use $VIRGO/config/serviceability.xml

If you project is using commons-logging/slf4j/log4j/jul - logging should just work.

If you have custom appenders and such - those should be attached to medic.core bundle

i.e. Fragment-Host: org.eclipse.virgo.medic.core

(ChrisF, please correct me here)
Re: How to deploy Vaadin app to Virgo Jetty Server? [message #730289 is a reply to message #730188] Wed, 28 September 2011 01:21 Go to previous messageGo to next message
Eclipse UserFriend
I skipped the com.siemens.ct.osgi.vaadin.pm.logback bundle completely as it is just a logger configuration:
<configuration>
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <!-- encoders are assigned the type
         ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
    <encoder>
      <pattern>%d{HH:mm:ss} %-5level %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>
  <root level="DEBUG">
    <appender-ref ref="STDOUT" />
  </root>
  <logger name="org.mortbay.log" level="INFO" />
</configuration>


But still no luck.

Marton
Re: How to deploy Vaadin app to Virgo Jetty Server? [message #730640 is a reply to message #730289] Wed, 28 September 2011 14:53 Go to previous message
Eclipse UserFriend
Ok. I think I see your confusion. Virgo Tomcat and Jetty implement newer Web App spec from OSGi. This example uses older approach that uses org.eclipse.equinox.http.registry/servlet etc.

Without digging too much into vaadin osgi bridge I would not be able to tell you how to run this example.

In general to deploy web-apps on Virgo (either tomat or jetty) you will need a proper web app that contains a web.xml and Web-ContextPath: contextPath manifest header See here: http://www.eclipse.org/virgo/documentation/virgo-documentation-3.0.1.RELEASE/docs/virgo-programmer-guide/html/ch05.html#migrating-to-osgi-web

You could try to add required bundles to Virgo. You will need to make sure that missing dependencies are installed and working properly. I had this set in repository/usr and plan started up fine, but I did not dig deeper to figure out how to get the page to come up.

com.siemens.ct.osgi.server.hello_1.0.0.201109281404.jar			com.siemens.ct.pm.model.basic_1.0.0.201109281404.jar
com.siemens.ct.osgi.vaadin.pm.bundleview_1.0.0.201109281404.jar		com.siemens.ct.pm.model.minimal_1.0.0.201109281404.jar
com.siemens.ct.osgi.vaadin.pm.logback_1.0.0.201109281404.jar		com.siemens.ct.pm.model_1.0.0.201109281404.jar
com.siemens.ct.osgi.vaadin.pm.main_1.0.0.201109281404.jar		org.vaadin.osgi.staticres_1.0.1.jar
com.siemens.ct.osgi.vaadin.pm.printaction_1.0.0.201109281404.jar	org.vaadin.osgi_1.0.1.jar
com.siemens.ct.osgi.vaadin.pm.reindeeraction_1.0.0.201109281404.jar	vaadin-6.6.7.jar
com.siemens.ct.osgi.vaadin.pm.runoraction_1.0.0.201109281404.jar	org.eclipse.equinox.registry_3.5.0.v20100503.jar
com.siemens.ct.osgi.vaadin.pm.saveaction_1.0.0.201109281404.jar		org.eclipse.equinox.http.servlet_1.1.0.v20100503.jar
com.siemens.ct.osgi.vaadin.pm.tableview_1.0.0.201109281404.jar		org.eclipse.equinox.http.jetty_2.0.0.v20100503.jar
com.siemens.ct.osgi.vaadin.pm.theme_1.0.0.201109281404.jar		org.eclipse.equinox.http.registry_1.1.0.v20100503.jar
com.siemens.ct.osgi.vaadin.pm.treeview_1.0.0.201109281404.jar		org.eclipse.equinox.common_3.6.0.v20100503.jar


You might be better off just deploying a regular web app and consuming OSGi services in there...
Previous Topic:DynamicImport-Package question while patching DataNucleus for OSGi
Next Topic:Managing Bundle Dependencies
Goto Forum:
  


Current Time: Wed Jul 23 19:26:40 EDT 2025

Powered by FUDForum. Page generated in 0.04335 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top