Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 6748 invoked from network); 14 Jul 2007 16:50:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jul 2007 16:50:00 -0000 Received: (qmail 93935 invoked by uid 500); 14 Jul 2007 16:50:03 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 93750 invoked by uid 500); 14 Jul 2007 16:50:02 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 93741 invoked by uid 99); 14 Jul 2007 16:50:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jul 2007 09:50:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [66.111.4.26] (HELO out2.smtp.messagingengine.com) (66.111.4.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jul 2007 09:49:59 -0700 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 0D3728F6B for ; Sat, 14 Jul 2007 12:49:38 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Sat, 14 Jul 2007 12:49:38 -0400 X-Sasl-enc: sDxwHGEkDJg9Eury5MvSeFYAVxEEjHnSaVQBBw8kEsVg 1184431777 Received: from [192.168.1.100] (VDSL-130-13-10-90.PHNX.QWEST.NET [130.13.10.90]) by mail.messagingengine.com (Postfix) with ESMTP id 2DC7F1FDE9 for ; Sat, 14 Jul 2007 12:49:37 -0400 (EDT) Message-ID: <4698FE9B.9080105@neurofire.com> Date: Sat, 14 Jul 2007 09:49:31 -0700 From: Brad O'Hearne User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: cxf-dev@incubator.apache.org Subject: Re: [Fwd: Re: Exception loading CXF service in Spring with HTTP Binding] References: <46981AC9.20808@neurofire.com> <7b774c950707132115j2df91a68q98762c39ca3eb2a4@mail.gmail.com> <469873D1.8030707@neurofire.com> <7b774c950707140925v36e555bmf3f211f4603c3573@mail.gmail.com> <4698FD41.2090803@neurofire.com> In-Reply-To: <4698FD41.2090803@neurofire.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Dan, I just tried the endpointInterface attribute on my interface class, as follows: @WebService (endpointInterface = "com.brad.user.IUserService") public interface IUserService { and here is the error I receive: ERROR [main] (ContextLoader.java:203) - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation of an SEI. Caused by: javax.xml.ws.WebServiceException: Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation of an SEI. at org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsImplementorInfo.java:279) at org.apache.cxf.jaxws.support.JaxWsImplementorInfo.(JaxWsImplementorInfo.java:57) I think this probably goes back to the design pattern mentioned in my previous post (annotations on the interface, none of the implementation class). I'm guessing we are on the cusp of having this solved. Thanks, Brad Brad O'Hearne wrote: > Dan, > > I think you may have hit on the mystery here. I do not have an > endpoint interface defined on my @WebService. But the rest of your > answer below suggests that I may have done something else wrong in > general. My annotations occur entirely in my interface, i.e. > > @WebService > public interface IUserService ... > > and my implementing class has no annotations whatsoever, i.e.: > > public class UserService extends IUserService ... > > and from the past posts I have, you'll see that my beans.xml file > references the implementation class, i.e. > > serviceClass="com.brad.user.IUserService" > implementor="com.brad.user.UserService" > address="/UserService" > bindingUri="http://apache.org/cxf/binding/http" > > > > > > > > This was the pattern used in XFire which worked, and the pattern set > forth in the CXF user's guide, as in: > http://cwiki.apache.org/CXF20DOC/http-binding.html > > But perhaps I've read it wrong. So I'll ask... > > 1. Should my annotations be on my implementation class or my interface > class? > 2. Depending on the answer to 1), if annotations are put in the > interface, the endpointInterface attribute would logically always be > the same name as that interface. Is this accurate? > 3. Should the implementor attribute in the beans.xml jaxws:endpoint > element reference the interface, or the imlementation? > > Thanks a ton for helping out Dan, it is sincerely appreciated. I'll > throw that endpointInterface attribute on my @WebService annotation > right now (which presently sits in my interface) and see what happens. > > Brad > > Dan Diephouse wrote: >> Do you have an endpointInterface attribute defined on your @WebService? >> >> i.e. you should have: >> >> @WebService(endpointInterface="foo.bar.IUserService", >> serviceName="UserService") >> public class UserService .... >> >> (Note: the serviceName can only go on the impl class) >> >> @WebService >> public class IUserService >> >> Regards, >> - Dan >> >> On 7/14/07, Brad O'Hearne wrote: >>> >>> Additionally, I don't know if this helps, but I found this line higher >>> up in my log before the error occurs: >>> >>> INFO: Creating Service {http://user.brad.com/}UserServiceService from >>> class com.brad.user.UserService >>> >>> The service "UserServiceService" looks a little weird, as I don't have >>> it specified as that anywhere. >>> >>> B >>> >>> Dan Diephouse wrote: >>> > Hi Brad, >>> > Don't you think you're being a little impatient here? Your message is >>> > from 6 >>> > PM on a FRIDAY (now 12 AM Saturday) and pretty much everyone has gone >>> > home. >>> > While I sympathize with your problem & timeline, I think you're being >>> > quite >>> > unrealistic in your expectations. I'm the one who wrote the code and >>> > probably no one else around really feels qualified to answer this >>> > question, >>> > so everyone else is probably going to wait a reasonable amount of >>> time >>> > for >>> > me to come back online. And I've been busy travelling. >>> > >>> > As to your error, it seems for some reason CXF isn't finding your >>> > @httpresource annotation. What does the @WebService attribute look >>> > like on >>> > your CustomerService class? You could possibly try adding a >>> serviceClass >>> > attribute to your and see if that will help: >>> > >>> > >>> > >>> > - Dan >>> > >>> > >>> > On 7/13/07, Brad O'Hearne wrote: >>> >> >>> >> Hello, >>> >> >>> >> I don't want to cross the line on asking questions to the dev >>> list, but >>> >> I'm in a bit of a bind here, and I need to get this worked out, >>> and I >>> >> think that posting this to the dev list may be appropriate for the >>> >> following reasons: >>> >> >>> >> 1) It is in the realm where the documentation says the functionality >>> >> exists, but doesn't say how to configure (i.e. a hole in the >>> >> documentation). >>> >> 2) The stack trace / error I am receiving I am guessing only a >>> developer >>> >> is going to likely understand -- it makes absolutely no sense at >>> a user >>> >> level. >>> >> 3) The only reference I found to this error on Google was from last >>> >> month on the developer list. >>> >> >>> >> The forwarded email explains my problem and stack trace, but in a >>> >> nutshell, I just need to configure annotation based, SOAP-Free, >>> Restful >>> >> Http/xml services in Spring. Nothing tricky -- simple, standard, >>> >> boilerplate need. I am having no luck, as my service loading >>> fails. The >>> >> stack trace is attached. Here is my web.xml file: >>> >> >>> >> >> >> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" >>> >> "http://java.sun.com/dtd/web-app_2_3.dtd"> >>> >> >>> >> >>> >> >>> >> >>> >> contextConfigLocation >>> >> WEB-INF/beans.xml >>> >> >>> >> >>> >> >>> >> >>> >> org.springframework.web.context.ContextLoaderListener >>> >> >>> >> >>> >> >>> >> >>> >> CXFServlet >>> >> CXF Servlet >>> >> >>> >> org.apache.cxf.transport.servlet.CXFServlet >>> >> >>> >> 1 >>> >> >>> >> >>> >> >>> >> CXFServlet >>> >> /* >>> >> >>> >> >>> >> >>> >> >>> >> Here is my beans.xml file: >>> >> >>> >> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> >> xmlns:jaxws="http://cxf.apache.org/jaxws" >>> >> xsi:schemaLocation=" >>> >> http://www.springframework.org/schema/beans >>> >> http://www.springframework.org/schema/beans/spring-beans.xsd >>> >> http://cxf.apache.org/jaxws >>> >> http://cxf.apache.org/schemas/jaxws.xsd >>> >> "> >>> >> >>> >> >>> >> >> resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> >>> >> >> >> resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" /> >>> >> >>> >> >>> >> >> >> class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> >>> >> >>> >> >>> >> >>> >> >> >> implementor="com.brad.user.UserService" >>> >> address="/UserService" >>> >> bindingUri="http://apache.org/cxf/binding/http" >>> >> > >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> Here is my UserService interface: >>> >> >>> >> package com.brad.user; >>> >> >>> >> import javax.jws.WebService; >>> >> >>> >> import org.codehaus.jra.Get; >>> >> import org.codehaus.jra.HttpResource; >>> >> >>> >> import com.brad.service.ServiceRequest; >>> >> import com.brad.service.ServiceResponse; >>> >> >>> >> @WebService >>> >> public interface IUserService { >>> >> >>> >> @Get >>> >> @HttpResource(location = "/users") >>> >> ServiceResponse getUsers(ServiceRequest request); >>> >> } >>> >> >>> >> Thanks in advance for the help. I'm to the end of my rope, with >>> regards >>> >> to my timeline, and I need to get this working, and qualify CXF as a >>> >> service stack that can be used for this project, or else I'm >>> going to >>> >> have to punt this weekend and incur a ton of work basically >>> duplicating >>> >> what CXF already purports to do. >>> >> >>> >> Cheers, >>> >> >>> >> Brad >>> >> >>> >> >>> >> ---------- Forwarded message ---------- >>> >> From: Brad O'Hearne >>> >> To: cxf-user@incubator.apache.org >>> >> Date: Fri, 13 Jul 2007 17:09:28 -0700 >>> >> Subject: Re: Exception loading CXF service in Spring with HTTP >>> Binding >>> >> I'm appealing to anyone out there who can please help me with this >>> >> problem. All I'm trying to do is standard configuration of a single >>> >> service, with a single method, using Http binding, using Spring. >>> If I >>> >> cannot get this problem resolved soon, as much as I do not want >>> to, I'm >>> >> going to have to punt usage of both CXF and XFire, which I am >>> migrating >>> >> from. Simple, SOAP-free, RESTful HTTP service invocations >>> configured in >>> >> Spring -- that's it. The documentation says that this can be >>> done, but >>> >> doesn't give a complete description of how this can be done; Google >>> >> gives a reference from last month about this, but no answers, and >>> the >>> >> API samples don't shed any light on it. It seems my configuration is >>> >> close, but I'm starting to wonder if Http Binding in CXF actually >>> works, >>> >> as the there is little to no information available on it. >>> >> >>> >> If anyone is in the know about how to get this to work, I'd greatly >>> >> appreciate it. I'm up against a deadline and I'll have to roll my >>> own >>> >> service stack if I have to wait several days to get this resolved. >>> >> >>> >> Thanks in advance for your help. >>> >> >>> >> Brad >>> >> >>> >> Brad O'Hearne wrote: >>> >> > I am loading a simple CXF service using Spring, and an HTTP >>> Binding. >>> >> > It is throwing an Exception, which unfortunately is very cryptic, >>> >> > gives me no idea of what the problem is, or how to fix it, and >>> there's >>> >> > not any solution I can find in the documentation or by >>> searching in >>> >> > Google. Does anyone have any idea what this Exception means and/or >>> how >>> >> > to fix it? Thanks...output is below: >>> >> > >>> >> > ERROR [main] (ContextLoader.java:203) - Context initialization >>> failed >>> >> > org.springframework.beans.factory.BeanCreationException: Error >>> >> > creating bean with name 'userService': Invocation of init method >>> >> > failed; nested exception is >>> java.lang.IndexOutOfBoundsException: No >>> >> > group 1 >>> >> > Caused by: >>> >> > java.lang.IndexOutOfBoundsException: No group 1 >>> >> > at java.util.regex.Matcher.group(Matcher.java:463) >>> >> > at java.util.regex.Matcher.appendReplacement(Matcher.java:730) >>> >> > at java.util.regex.Matcher.replaceAll(Matcher.java:806) >>> >> > at >>> >> > >>> >> >>> org.apache.cxf.binding.http.strategy.Inflector.pluralize(Inflector.java >>> >> :72) >>> >> > >>> >> > at >>> >> > >>> org.apache.cxf.binding.http.strategy.ConventionStrategy.extractNoun( >>> >> ConventionStrategy.java:148) >>> >> > >>> >> > at >>> >> > org.apache.cxf.binding.http.strategy.ConventionStrategy.map( >>> >> ConventionStrategy.java:88) >>> >> > >>> >> > at >>> >> > org.apache.cxf.binding.http.HttpBindingFactory.createBindingInfo( >>> >> HttpBindingFactory.java:100) >>> >> > >>> >> > at >>> >> > org.apache.cxf.frontend.AbstractEndpointFactory.createBindingInfo( >>> >> AbstractEndpointFactory.java:274) >>> >> > >>> >> > at >>> >> > org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo( >>> >> JaxWsServerFactoryBean.java:124) >>> >> > >>> >> > at >>> >> > >>> org.apache.cxf.frontend.AbstractEndpointFactory.createEndpointInfo( >>> >> AbstractEndpointFactory.java:191) >>> >> > >>> >> > at >>> >> > org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint( >>> >> AbstractEndpointFactory.java:105) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java >>> >> :89) >>> >> > >>> >> > at >>> >> > org.apache.cxf.jaxws.JaxWsServerFactoryBean.create( >>> >> JaxWsServerFactoryBean.java:142) >>> >> > >>> >> > at >>> >> org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:277) >>> >> > at >>> >> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:223) >>> >> > at >>> org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:175) >>> >> > at >>> org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:329) >>> >> > 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:585) >>> >> > at >>> >> > >>> >> >>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod >>> >>> >> >>> >> (AbstractAutowireCapableBeanFactory.java:1240) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods >>> >>> >> >>> >> (AbstractAutowireCapableBeanFactory.java:1205) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean >>> >>> >> >>> >> (AbstractAutowireCapableBeanFactory.java:1171) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean >>> >>> >> >>> >> (AbstractAutowireCapableBeanFactory.java:425) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject( >>> >>> >> >>> >> AbstractBeanFactory.java:251) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton >>> >>> >> >>> >> (DefaultSingletonBeanRegistry.java:156) >>> >> > >>> >> > at >>> >> > >>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean >>> ( >>> >> AbstractBeanFactory.java:248) >>> >> > >>> >> > at >>> >> > >>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean >>> ( >>> >> AbstractBeanFactory.java:160) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons >>> >>> >> >>> >> (DefaultListableBeanFactory.java:287) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.context.support.AbstractApplicationContext.refresh( >>> >> AbstractApplicationContext.java:352) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.web.context.ContextLoader.createWebApplicationContext( >>> >>> >> >>> >> ContextLoader.java:244) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.web.context.ContextLoader.initWebApplicationContext >>> ( >>> >> ContextLoader.java:187) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.springframework.web.context.ContextLoaderListener.contextInitialized >>> >>> >> (ContextLoaderListener.java:49) >>> >> > >>> >> > at >>> >> > org.apache.catalina.core.StandardContext.listenerStart( >>> >> StandardContext.java:3826) >>> >> > >>> >> > at >>> >> > >>> org.apache.catalina.core.StandardContext.start(StandardContext.java >>> >> :4335) >>> >> > at >>> >> > org.apache.catalina.core.ContainerBase.addChildInternal( >>> >> ContainerBase.java:759) >>> >> > >>> >> > at >>> >> > >>> >> >>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) >>> >> > at >>> >> > >>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) >>> >> > at >>> >> > >>> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:824) >>> >> > at >>> >> > org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java >>> :713) >>> >> > at >>> >> > org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java >>> :489) >>> >> > at >>> >> org.apache.catalina.startup.HostConfig.start(HostConfig.java:1137) >>> >> > at >>> >> > >>> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java >>> >> :310) >>> >> > >>> >> > at >>> >> > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent( >>> >> LifecycleSupport.java:119) >>> >> > >>> >> > at >>> >> > >>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021) >>> >> > at >>> >> org.apache.catalina.core.StandardHost.start(StandardHost.java:718) >>> >> > at >>> >> > >>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) >>> >> > at >>> >> > org.apache.catalina.core.StandardEngine.start(StandardEngine.java >>> :442) >>> >> > at >>> >> > >>> >> org.apache.catalina.core.StandardService.start(StandardService.java >>> :450) >>> >> > at >>> >> > org.apache.catalina.core.StandardServer.start(StandardServer.java >>> :709) >>> >> > at org.apache.catalina.startup.Catalina.start(Catalina.java:551) >>> >> > 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:585) >>> >> > at >>> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) >>> >> > at >>> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412) >>> >> >>> >> >>> >> >>> >> >>> > >>> > >>> >>> >> >> >