[ 
https://issues.apache.org/activemq/browse/CAMEL-1254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48954#action_48954
 ] 

Charles Moulliard commented on CAMEL-1254:
------------------------------------------

@Willem,

I have made a test but unfortunately, the following syntax does not work if I 
try to deploy my WAR in a OSGI server like Spring DM

      <bean id="reportIncidentEndpoint" 
class="org.apache.camel.example.reportincident.service.ReportIncidentEndpoint"/>
                    
        <!-- webservice endpoint -->             
        <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";
        />

remark : ReportIncidentEndpoint is the interface generated by wsdl2java. 

Error :

[2009-01-26 16:47:29.199] async-delivery-thread-1  
e.server.web.dm.ServerOsgiBundleXmlWebApplicationContext.unknown E Refresh error
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'reportIncidentEndpoint' defined in OSGi 
resource[classpath:camel-context.xml|bnd.id=84|bnd.sym=org.apache.camel.example.reportincident.web]:
 Instantiation of bean failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Could not instantiate 
bean class 
[org.apache.camel.example.reportincident.service.ReportIncidentEndpoint]: 
Specified class is an interface
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
        at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalRefresh(AbstractDelegatedExecutionApplicationContext.java:148)
        at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$NoDependenciesWaitRefreshExecutor.refresh(AbstractDelegatedExecutionApplicationContext.java:73)
        at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:136)
        at 
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at 
com.springsource.server.servlet.tomcat.TomcatServletContainer.addContext(TomcatServletContainer.java:948)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:64)
        at 
org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:78)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at 
org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at 
org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at 
org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at 
org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at 
org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy43.addContext(Unknown Source)
        at 
com.springsource.server.web.core.WebModulePersonality.deploy(WebModulePersonality.java:391)
        at 
com.springsource.server.deployer.core.module.AbstractModule.deploy(AbstractModule.java:235)
        at 
com.springsource.server.deployer.core.module.StandardModule.onStarted(StandardModule.java:572)
        at 
com.springsource.server.deployer.core.module.DeployerBundleListener$2$1.run(DeployerBundleListener.java:148)
        at 
com.springsource.server.concurrent.core.ExecutorServiceDelegate$StatisticsGatheringRunnable.run(ExecutorServiceDelegate.java:137)
        at 
com.springsource.server.concurrent.core.ServerThreadPoolExecutor$1.run(ServerThreadPoolExecutor.java:145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)

As you can see, Spring does not support to instantiate an interface in this 
case ?



> camel-cxf: URI option for serviceClass does not support lookup in registry
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-1254
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1254
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>    Affects Versions: 1.5.0
>            Reporter: Claus Ibsen
>            Assignee: William Tam
>            Priority: Minor
>
> Having an endpoint such as:
> {code}
>         String cxfEndpoint = 
> "cxf://http://localhost:8080/part-five/webservices/incident";
>                 + 
> "?serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint"
>                 + "&wsdlURL=report_incident.wsdl";
> {code}
> The serviceClass option currently only supports defining a FQN for the class. 
> I think we need to support Registry lookup as well using the # notation. So 
> you can do:
> {code}
>         String cxfEndpoint = 
> "cxf://http://localhost:8080/part-five/webservices/incident";
>                 + "?serviceClass=#reportService"
>                 + "&wsdlURL=report_incident.wsdl";
> {code}
> And then have it defined in Spring XML:
> {code}
> <bean id="reportService" class="...">
> {code}
> The # notation is already supported if you use the cxf Spring XML 
> configuration. We need this in the Java DSL as well.
> Sorry if it already exists. But I got a hint from a Camel end user that it 
> didn't

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to