Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Jetty with Spring-DM 1.2.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jetty with Spring-DM 1.2.1

    Hi,

    I am trying to bring in OSGi architecture into our project and since we are already using Spring, thought we could use Spring DM.
    I converted all my existing jars(which were being used as libraries) and the new projects into eclipse plugins. When deployed in Spring-DM, the application ran fine.
    The problem arose when we tried to convert our web project (application monitoring tool) which was running in Jetty server. I plugged in Jetty server 6.1.9 and the jetty server is up(the jetty logs were created). But when I tried to run the org.springframework.osgi.web.extender_1.2.1, it threw me an exception. Here is the stack trace:
    Nov 30, 2010 5:27:49 PM org.springframework.scheduling.timer.TimerTaskExec utor afterPropertiesSet
    INFO: Initializing Timer
    Nov 30, 2010 5:27:49 PM org.springframework.osgi.web.extender.internal.act ivator.WarLoaderListener start
    INFO: Starting [org.springframework.osgi.web.extender] bundle v.[1.2.1]

    osgi> Nov 30, 2010 5:27:49 PM org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration <init>
    INFO: Detected extender custom configurations at {bundleentry://46.fwk25669322/META-INF/spring/extender/jetty-deployer.xml}
    Nov 30, 2010 5:27:49 PM org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing org.springframework.osgi.context.support.OsgiBundl eXmlApplicationContext@1719f30: display name [OsgiBundleXmlApplicationContext(bundle=org.springf ramework.osgi.web.extender, config=bu
    ndleentry://46.fwk25669322/META-INF/spring/extender/jetty-deployer.xml)]; startup date [Tue Nov 30 17:27:49 IST 2010]; root of context hierarchy
    Nov 30, 2010 5:27:49 PM org.springframework.osgi.context.support.AbstractO sgiBundleApplicationContext unpublishContextAsOsgiService
    INFO: Application Context service already unpublished
    Nov 30, 2010 5:27:49 PM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from OSGi resource[bundleentry://46.fwk25669322/META-INF/spring/extender/jetty-deployer.xml|bnd.id=32|bnd.sym=org.springframework .osgi.web.extender]
    Nov 30, 2010 5:27:49 PM org.springframework.context.support.AbstractApplic ationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.osgi.context.support.OsgiBundl eXmlApplicationContext@1719f30]: org.springframework.beans.factory.support.DefaultL istableBeanFactory@ee6a
    d6
    Nov 30, 2010 5:27:49 PM org.springframework.beans.factory.support.DefaultL istableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@ee6ad6: defining beans [warDeployer]; root of factory hierarchy
    Nov 30, 2010 5:27:49 PM org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@ee6ad6: defining beans [warDeployer]; root of factory hierarchy
    Nov 30, 2010 5:27:49 PM org.springframework.osgi.web.extender.internal.act ivator.WarLoaderListener$1 run
    SEVERE: Cannot property start Spring DM WebExtender; stopping bundle...
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'warDeployer' defined in OSGi resource[bundleentry://46.fwk25669322/META-INF/spring/extender/jetty-deployer.xml|b
    nd.id=32|bnd.sym=org.springframework.osgi.web.exte nder]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/mortbay/jetty/Handler
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:883)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:839)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:380)
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.access$301(Abs tractDelegatedExecutionApplicationContext.java:69)
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext$1.run(Abstract DelegatedExecutionApplicationContext.java:186)
    at org.springframework.osgi.util.internal.PrivilegedU tils.executeWithCustomTCCL(PrivilegedUtils.java:85 )
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.normalRefresh( AbstractDelegatedExecutionApplicationContext.java: 182)
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext$NoDependencies WaitRefreshExecutor.refresh(AbstractDelegatedExecu tionApplicationContext.java:89)
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.refresh(Abstra ctDelegatedExecutionApplicationContext.java:175)
    at org.springframework.osgi.web.extender.internal.act ivator.WarListenerConfiguration.<init>(WarListener Configuration.java:115)
    at org.springframework.osgi.web.extender.internal.act ivator.WarLoaderListener$1.run(WarLoaderListener.j ava:361)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoClassDefFoundError: org/mortbay/jetty/Handler
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unk nown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.getDeclaredConstructor(Unknown Source)
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:54)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:877)
    ... 22 more
    Caused by: java.lang.ClassNotFoundException: org.mortbay.jetty.Handler
    at org.eclipse.osgi.internal.loader.BundleLoader.find ClassInternal(BundleLoader.java:494)
    at org.eclipse.osgi.internal.loader.BundleLoader.find Class(BundleLoader.java:410)
    at org.eclipse.osgi.internal.loader.BundleLoader.find Class(BundleLoader.java:398)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(DefaultClassLoader.java:105)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 28 more
    Nov 30, 2010 5:27:49 PM org.springframework.scheduling.timer.TimerTaskExec utor destroy
    INFO: Cancelling Timer

    The war file never got detected by the Spring DM. I tried to test the wars inside the sample application provided by Spring distribution, with the same results.

    The bundles installed in the OSGi layer are:
    id State Bundle
    0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126
    1 ACTIVE org.eclipse.equinox.common_3.5.1.R35x_v20090807-1100
    2 ACTIVE org.eclipse.update.configurator_3.3.0.v20090312
    3 ACTIVE com.springsource.javax.resource_1.5.0
    4 ACTIVE com.springsource.oracle.jdbc_10.2.0.2
    5 ACTIVE com.springsource.org.aopalliance_1.0.0
    12 ACTIVE javax.xml_1.3.4.v200806030440
    16 ACTIVE org.springframework.osgi.log4j.osgi_1.2.15.SNAPSHO T
    17 ACTIVE org.apache.commons.logging_1.0.4.v200904062259
    18 ACTIVE org.apache.log4j_1.2.13.v200903072027
    19 ACTIVE org.jboss.netty_3.2.1.Final
    20 ACTIVE org.springframework.aop_2.5.6.SEC01
    21 ACTIVE org.springframework.beans_2.5.6.SEC01
    22 ACTIVE org.springframework.context_2.5.6.SEC01
    23 ACTIVE org.springframework.core_2.5.6.SEC01
    25 ACTIVE org.springframework.osgi.core_1.2.1
    26 ACTIVE org.springframework.osgi.extender_1.2.1
    27 ACTIVE org.springframework.osgi.io_1.2.1
    31 ACTIVE org.springframework.osgi.web_1.2.1
    32 RESOLVED org.springframework.osgi.web.extender_1.2.1
    Fragments=46
    33 ACTIVE org.springframework.osgi.jetty.start.osgi_1.0.0
    36 ACTIVE com.springsource.javax.servlet_2.4.0
    38 ACTIVE com.springsource.org.mortbay.jetty.server_6.1.9
    40 ACTIVE org.mortbay.jetty.server_6.1.9
    42 ACTIVE com.springsource.javax.servlet_2.5.0
    45 ACTIVE org.mortbay.jetty.util_6.1.9
    46 RESOLVED org.springframework.osgi.jetty.web.extender.fragme nt.osgi_1.0.1
    Master=32
    47 ACTIVE com.springsource.net.sf.cglib_2.1.3

    Thanks for the help.
Working...
X