Comparing your web.xml with mine, I see this difference. You  might need
to add this in your web.xml

        <listener>
           <listener-class>
              org.springframework.web.context.ContextLoaderListener
           </listener-class>
    </listener>     


Regards
Karuna Pydipati
StubHub/eBay - Platform & Services
Phone: (415)222-8752
Email: [email protected]

 


-----Original Message-----
From: damica [mailto:[email protected]] 
Sent: Friday, November 13, 2009 7:05 AM
To: [email protected]
Subject: Deploying RESTful Webservice on JBOSS 5.1.0 using Apache CXF
framework


Hi Guys,
im trying to deploy a simple RESTful webservice on jboss 5.1.0 using
apache CXF. But i'm getting this exception 'Could not find 'server'. 

Googling it didn't helped much. Below follows my web.xml and beans.xml
which i done using the documentation on
http://cwiki.apache.org/CXF20DOC/jax-rs.html. I'm pasting also the
simple Web service and the exception itself. 

I'm not sure if i'm doing the right configurations. I would be glad if
you could help.

Thanks,
Damica

--------------- web.xml-------------------

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd";>
<web-app>
        <servlet>
                <servlet-name>CXFServlet1</servlet-name>
                <display-name>CXF Servlet1</display-name>
                <servlet-class>
                        org.apache.cxf.transport.servlet.CXFServlet
                </servlet-class>
                <init-param>
                   <param-name>config-location</param-name>
                   <param-value>/WEB-INF/beans.xml</param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet-mapping>
                <servlet-name>CXFServlet1</servlet-name>
                <url-pattern>/1/*</url-pattern>
        </servlet-mapping>

</web-app>

----------- beans.xml-------------------------------------

<?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:jaxrs="http://cxf.apache.org/jaxrs";
  xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd";>

  <jaxrs:server id="RestHelloService" address="/service1">
    <jaxrs:serviceBeans>
      <ref bean="customerBean" />
    </jaxrs:serviceBeans>
  </jaxrs:server>

  <bean id="customerBean"
class="com.ixaris.webservices.rest.server.RestHelloService" /> </beans>

---- the exception------------------------
15:56:38,274 ERROR [AbstractKernelController] Error installing to Start:
name=vfszip:/C:/dev/applications/JBoss/jboss-5.1.0.GA/server/default/dep
loy/TestRESTWebservice-war-0.0.1.war/_WebBeansBootstrapBean
state=Create
javax.inject.DefinitionException: Could not find 'server'
        at
org.jboss.webbeans.xml.ParseXmlHelper.loadElementClass(ParseXmlHelper.ja
va:62)
        at
org.jboss.webbeans.xml.XmlParser.parseForBeans(XmlParser.java:149)
        at org.jboss.webbeans.xml.XmlParser.parse(XmlParser.java:64)
        at
org.jboss.webbeans.bootstrap.WebBeansBootstrap.boot(WebBeansBootstrap.ja
va:195)
        at
org.jboss.webbeans.bootstrap.api.helpers.BootstrapBean.boot(BootstrapBea
n.java:120)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(Reflectio
nUtils.java:59)
        at
org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(Ref
lectMethodInfoImpl.java:150)
        at
org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoi
nPoint.java:66)
        at
org.jboss.kernel.plugins.dependency.KernelControllerContextAction$Joinpo
intDispatchWrapper.execute(KernelControllerContextAction.java:241)
        at
org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWr
apper.java:47)
        at
org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispat
chExecutionWrapper(KernelControllerContextAction.java:109)
        at
org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispat
chJoinPoint(KernelControllerContextAction.java:70)
        at
org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInterna
l(LifecycleAction.java:221)
        at
org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(In
stallsAwareAction.java:54)
        at
org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(In
stallsAwareAction.java:42)




--
View this message in context:
http://old.nabble.com/Deploying-RESTful-Webservice-on-JBOSS-5.1.0-using-
Apache-CXF-framework-tp26337929p26337929.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to