Results 1 to 3 of 3

Thread: org.springframework.beans.factory.BeanCreationExce ption : ClassNotFoundException

  1. #1

    Default org.springframework.beans.factory.BeanCreationExce ption : ClassNotFoundException

    Hi,

    I have an error when I deploy a war in Spring DM.
    This WAR is a web application where one of it spring bean service is a reference to an OSGI bundle deployed.

    Using the telnet console on the server, I see that my service is active

    77 ACTIVE org.apache.camel.example.reportincident.domain_1.0 .0.SNAPSHOT
    78 ACTIVE org.apache.camel.example.reportincident.service_1. 0.0.SNAPSHOT

    unfortunately, during the launch of my web application, Spring returns an error that it can't find a class

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.osgi.service.exporter.support .OsgiServiceFactoryBean#0': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [java.lang.Class[]] for property 'interfaces'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.apache.camel.example.reportincident.ReportInci dentService]
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:480)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)


    Here is my spring(osgi) config file of the web application ?

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:osgi="http://www.springframework.org/schema/osgi"
    xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.5.xsd
    http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/sch...mel-spring.xsd
    http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
    http://www.springframework.org/schema/osgi http://www.springframework.org/schem...g-osgi-1.1.xsd
    http://activemq.apache.org/camel/schema/cxfEndpoint http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

    <!-- Reference to the OSGI service -->
    <osgi:reference id="reportIncidentEndpoint" interface="org.apache.camel.example.reportincident .ReportIncidentService"/>

    <!-- implementation of the webservice -->
    <cxf:cxfEndpoint id="reportIncident" address="/incident" wsdlURL="/WEB-INF/wsdl/report_incident.xml"
    serviceClass="#reportIncidentEndpoint"
    endpointName="s:ReportIncidentPort"
    serviceName="s:ReportIncidentService"
    xmlns:s="http://reportincident.example.camel.apache.org"
    />

    <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
    <package>org.apache.camel.example.reportincident </package>
    <jmxAgent id="agent" createConnector="true"/>
    </camelContext>

    </beans>

    Can someone help me please ?

    KR,

    Charles Moulliard
    SOA Architect
    SOA Architect

  2. #2

    Default

    Question : In order to allow my Web Application to find the OSGI service, should I have to create a MANIFEST file containing the following info ?

    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: Camel RerportIncident WAR
    Bundle-SymbolicName: org.camel.example.reportincident.web
    Bundle-Version: 1.0.0
    Import-Package: org.apache.camel.example.reportincident.domain;ver sion="1.0.0.SNAPSHOT",
    org.apache.camel.example.reportincident;version="1 .0.0.SNAPSHOT"

    By the way, I create it but I have the following error :

    [2008-12-08 15:28:15.885] fs-watcher source.server.deployer.core.internal.StandardAppli cationDeployer < DeploymentIdentity com.springsource.server.deployer.core.internal.Sta ndardApplicationDeployer.deploy(URI, ApplicationDeployer.DeploymentOptions)
    com.springsource.server.deployer.core.DeploymentEx ception: Dependency satisfaction failed
    at com.springsource.server.deployer.core.internal.Sta ndardApplicationDeployer.deploy(StandardApplicatio nDeployer.java:333)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.osgi.service.importer.support. internal.aop.ServiceInvoker.doInvoke(ServiceInvoke r.java:64)
    at org.springframework.osgi.service.importer.support. internal.aop.ServiceInvoker.invoke(ServiceInvoker. java:78)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.doProceed(DelegatingIntroductionIn terceptor.java:131)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.invoke(DelegatingIntroductionInter ceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.osgi.service.importer.support. LocalBundleContextAdvice.invoke(LocalBundleContext Advice.java:59)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.doProceed(DelegatingIntroductionIn terceptor.java:131)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.invoke(DelegatingIntroductionInter ceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy8.deploy(Unknown Source)
    at com.springsource.server.deployer.hot.HotDeployment FileSystemListener.deploy(HotDeploymentFileSystemL istener.java:190)
    at com.springsource.server.deployer.hot.HotDeployment FileSystemListener.onChange(HotDeploymentFileSyste mListener.java:91)
    at com.springsource.server.io.core.fs.WatchTask.notif yListeners(WatchTask.java:194)
    at com.springsource.server.io.core.fs.WatchTask.notif yListeners(WatchTask.java:188)
    at com.springsource.server.io.core.fs.WatchTask.proce ssMonitoredRecord(WatchTask.java:182)
    at com.springsource.server.io.core.fs.WatchTask.run(W atchTask.java:107)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: com.springsource.server.osgi.framework.UnableToSat isfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'org.camel.example.reportincident.web' at version '1.0.0': Cannot resolve: org.camel.example.reportincident.web
    Unsatisfied leaf constraints:
    Bundle: org.camel.example.reportincident.web_1.0.0 - Import-Package: org.apache.camel.example.reportincident.domain; version="1.0.0.SNAPSHOT"
    Did you mean: 'org.apache.camel.example.reportincident.domain'?
    Bundle: org.camel.example.reportincident.web_1.0.0 - Import-Package: org.apache.camel.example.reportincident; version="1.0.0.SNAPSHOT"
    Did you mean: 'org.apache.camel.example.reportincident'?
    SOA Architect

  3. #3

    Default

    I have updated my MANIFEST File like this :

    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: Camel RerportIncident WAR
    Bundle-SymbolicName: org.camel.example.reportincident.web
    Bundle-Version: 1.0.0
    Import-Package: org.apache.camel.example.reportincident.domain,
    org.apache.camel.example.reportincident
    Import-Bundle: org.apache.camel.example.reportincident.domain,
    org.apache.camel.example.reportincident.service

    I progress bu now I have the following error :

    [2008-12-08 15:47:40.088] async-delivery-thread-1 catalina].[localhost].[/reportincident.web-1.0-SNAPSHOT].unknown E Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'reportIncidentEndpoint': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Required 'bundleContext' property was not set.
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1337)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:473)
    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:221)
    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:423)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:729)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:381)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:246)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:189)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 49)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3843)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4342)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:525)
    at com.springsource.server.servlet.tomcat.TomcatServl etContainer.addContext(TomcatServletContainer.java :948)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.osgi.service.importer.support. internal.aop.ServiceInvoker.doInvoke(ServiceInvoke r.java:64)
    at org.springframework.osgi.service.importer.support. internal.aop.ServiceInvoker.invoke(ServiceInvoker. java:78)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.doProceed(DelegatingIntroductionIn terceptor.java:131)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.invoke(DelegatingIntroductionInter ceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.osgi.service.importer.support. LocalBundleContextAdvice.invoke(LocalBundleContext Advice.java:59)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.doProceed(DelegatingIntroductionIn terceptor.java:131)
    at org.springframework.aop.support.DelegatingIntroduc tionInterceptor.invoke(DelegatingIntroductionInter ceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy43.addContext(Unknown Source)
    at com.springsource.server.web.core.WebModulePersonal ity.deploy(WebModulePersonality.java:391)
    at com.springsource.server.deployer.core.module.Abstr actModule.deploy(AbstractModule.java:235)
    at com.springsource.server.deployer.core.module.Stand ardModule.onStarted(StandardModule.java:572)
    at com.springsource.server.deployer.core.module.Deplo yerBundleListener$2$1.run(DeployerBundleListener.j ava:148)
    at com.springsource.server.concurrent.core.ExecutorSe rviceDelegate$StatisticsGatheringRunnable.run(Exec utorServiceDelegate.java:137)
    at com.springsource.server.concurrent.core.ServerThre adPoolExecutor$1.run(ServerThreadPoolExecutor.java :145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:885)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)

    Should I have to add the following parameter in my web.xml file ?

    <context-param>
    <param-name>contextClass</param-name>
    <param-value>com.springsource.server.web.dm.ServerOsgiBun dleXmlWebApplicationContext</param-value>
    </context-param>


    KR,

    Charles Moulliard
    SOA Architect

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •