You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by dhogan <di...@forgerock.com> on 2013/03/07 19:50:37 UTC

JaxWsServerFactoryBean without Spring

I am trying to use CXF without Spring. I am trying to publish a very simple
POJO web-service using the JaxWsServerFactoryBean. I have a
ServletContextListener whose contextInitialized(..) has the following:

        JaxWsServerFactoryBean serverFactoryBean = new
JaxWsServerFactoryBean();
        serverFactoryBean.setAddress("sts_publish");
        serverFactoryBean.setServiceBean(new STSPublishImpl());
        serverFactoryBean.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
        serverFactoryBean.create();

As soon as I hit the wsdl URL for the published web-service, I get the
NoClassDefFoundError below. My published endpoint (STSPublishImpl) has no
references to Spring.

I am running on Tomcat 6.0.36 on a MacBook with OS X 10.8.2.

What am I missing?

Thanks

Dirk


exception

javax.servlet.ServletException: Error allocating a servlet instance

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	java.lang.Thread.run(Thread.java:680)
root cause

java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationListener
	java.lang.ClassLoader.defineClass1(Native Method)
	java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)

org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	java.lang.Thread.run(Thread.java:680)
root cause

java.lang.ClassNotFoundException:
org.springframework.context.ApplicationListener

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
	java.lang.ClassLoader.defineClass1(Native Method)
	java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)

org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	java.lang.Thread.run(Thread.java:680)
note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.36 logs.



--
View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JaxWsServerFactoryBean without Spring

Posted by Daniel Kulp <dk...@apache.org>.
Normally, you would subclass the CXFNonSpringServlet, override the init(..) method, call super.init(..), then publish your services using the JaxWsServerFactoryBean or similar, but make sure you use the right "bus" object (from getBus() call on the CXFNonSpringServlet).

Dan



On Mar 8, 2013, at 4:09 PM, dhogan <di...@forgerock.com> wrote:

> Hi-
> *I am having difficulty transitioning from the CXFServlet based deployment,
> to a CXFNonSpringServlet deployment, and am hoping for some insight.
> 
> *
> *The scenario: I am exposing a web-service that programmatically publishes
> additional web-services - in this case, SecurityTokenService instances.
> That all works fine in a Spring-based deployment. Here’s the relevant state
> that works great in a Spring-based deployment:
> 
> web.xml
> 
>   <servlet>
>       <servlet-name>new_sts</servlet-name>
>       <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
>   </servlet>
>   <servlet-mapping>
>       <servlet-name>new_sts</servlet-name>
>       <url-pattern>/new_sts/*</url-pattern>
>   </servlet-mapping>
> 
> cxf-servlet.xml
> 
> <beans xmlns="http://www.springframework.org/schema/beans"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:jaxws="http://cxf.apache.org/jaxws"
>     xsi:schemaLocation="
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd"
>> 
> 
>   <jaxws:endpoint id="STSPublish"
> implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
>                   address="/sts_publish">
>   </jaxws:endpoint>
> </beans>
> 
> The STSPublishImpl is a pojo with a SEI with a bare @WebService annotation,
> and the STSPublishImpl with an annotation that looks like:
> @WebService(
>       endpointInterface="org.forgerock.openam.sts.publish.web.STSPublish",
>       serviceName="STSPublishService",
>       portName = "STSPublishPort",
>       targetNamespace = "http://org.forgerock.openam.sts.publish")
> 
> The STSPublishImpl has the following code: (the spec object is passed as a
> parameter, and is the same regardless of invocation context. Likewise, the
> getProperties() sets the Crypto state for various SecurityPolicy bindings).
> 
>       JaxWsServerFactoryBean serverFactoryBean = new
> JaxWsServerFactoryBean();
>       serverFactoryBean.setWsdlLocation(spec.getWsdlLocation());
>       serverFactoryBean.setAddress(uriElement);
>       serverFactoryBean.setServiceBean(new
> AMSecurityTokenServiceProvider());
>       serverFactoryBean.setServiceName(spec.getServiceQName());
>       serverFactoryBean.setEndpointName(spec.getPortQName());
>       serverFactoryBean.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
>       serverFactoryBean.setProperties(getProperties());
>       serverFactoryBean.create();
> 
> If I invoke this code with a uriElement of e.g. Instance444, I can happily
> invoke my sts on http://host:8080/openam/new_sts/Instance444 (openam is the
> name of the .war file that all of this is bundled in)
> 
> Now here is the non-functioning CXFNonSpringServlet context:*
> *
> web.xml
> 
>   <servlet>
>       <servlet-name>new_sts</servlet-name>
>       <servlet-class>org.apache.cxf.transport.servlet.CXFNonSpringServlet</servlet-class>
>   </servlet>
>   <servlet-mapping>
>       <servlet-name>new_sts</servlet-name>
>       <url-pattern>/new_sts/*</url-pattern>
>   </servlet-mapping>
> 
> Because the cxf-servlet.xml seems to have to start with the beans element,
> which seems to require the CXFServlet (it is ignored by the
> CXFNonSpringServlet), I have tried to deploy my STS-instance creation
> functionality two ways: 1. as a programatically created web-service,
> published from a ServletContextListener, and 2. as a simple servlet.
> 
> Here is the simple code publish my STSPublishImpl web-service, run in my
> ServletContextListener
> 
>       JaxWsServerFactoryBean serverFactoryBean = new
> JaxWsServerFactoryBean();
>       serverFactoryBean.setAddress("/sts_publish");
>       serverFactoryBean.setServiceBean(new STSPublishImpl());
>       serverFactoryBean.create();
> or
> 
>      Endpoint.publish("/sts_publish", new STSPublishImpl());
> 
> In either case, the logs report:
> 
> Mar 8, 2013 9:23:37 AM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBe
> an buildServiceFromClass
> INFO: Creating Service {http://org.forgerock.openam.sts.publish
> }STSPublishServic
> e from class org.forgerock.openam.sts.publish.web.STSPublish
> Mar 8, 2013 9:23:37 AM org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be /sts_publish
> 
> but when I want to hit the wsdl, I get the dreaded
> 
> Mar 8, 2013 9:24:34 AM org.apache.cxf.transport.servlet.ServletController
> invoke
> WARNING: Can't find the the request for
> http://macbook.dirk.internal.forgerock.com:8080/openam/new_sts/sts_publish'sObserver
> 
> So I deployed my STS-instance publish code as a simple Servlet, to avoid
> having to create a web-service that allows me to create STS instances. I
> also had hoped that the publishing of my web-service failed because I was
> performing the publish in a ServletContextListener. But if I write a
> servlet, which executes the exact same JaxWsServerFactory bean code
> (specified above) which successfully publishes STS instances when run in a
> Spring-based web-service, I get the following log messages:
> 
> Mar 8, 2013 11:18:30 AM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromWSDL
> INFO: Creating Service {
> http://docs.oasis-open.org/ws-sx/ws-trust/200512/}sts_service from WSDL:
> sts_ut.wsdl
> Mar 8, 2013 11:18:31 AM org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be /newSTS
> Mar 8, 2013 11:18:57 AM org.apache.cxf.transport.servlet.ServletController
> invoke
> WARNING: Can't find the the request for
> http://macbook.dirk.internal.forgerock.com:8080/openam/new_sts/newSTS'sObserver
> 
> Note the first 4 lines of the log snippet immediately above is exactly the
> same as those logged when I run the code from within the Spring-based
> web-service (which is successful - I don't get the final two lines in the
> log).
> 
> I’d really appreciate any help, as I am out of ideas.*
> *
> *
> *Thanks*
> *
> *
> *Dirk*
> 
> 
> On Thu, Mar 7, 2013 at 2:08 PM, Daniel Kulp [via CXF] <
> ml-node+s547215n5724283h61@n5.nabble.com> wrote:
> 
>> 
>> On Mar 7, 2013, at 4:59 PM, dhogan <[hidden email]<http://user/SendEmail.jtp?type=node&node=5724283&i=0>>
>> wrote:
>> 
>>> Dan-
>>> Is it possible to deploy and enforce wsdl-first web-services with
>>> SecurityPolicy references without Spring?
>> 
>> Yes.
>> 
>>> Is it largely a function of
>>> adding the WSS4J interceptors to one's endpoint?
>> 
>> Ideally, no.  The basic WSS4J interceptors don't handle the security
>> policy things.
>> 
>>> Searching this forum
>>> yields contradictory indications regarding the feature-set of CXF
>> without
>>> Spring, though it does seem that the later posts indicate that most
>>> everything you can do with Spring, you can do without (with the possible
>>> exception of JMS). Is this correct? I can't seem to find any samples or
>>> system tests that use the CXFNonSpringServlet - are there any?
>> 
>> If you use the JaxWsServerFactoryBean from within whatever method you use
>> to setup the services, then you would just need to set the wsdlLocation
>> appropriately as well as the various properties. There are methods for that
>> right on the factory bean.
>> 
>> If you want to use the JAX-WS Endpoint.pushlish(…) API's, it's certainly a
>> bit more complicated.    It's not too bad if you fill in the wsdlLocation
>> attribute of the @WebService annotation on the impl.  In that case, you can
>> do:
>> 
>> Map<String, Object> props = new HashMap<..>();
>> props.put("ws.security…..", "….");
>> Endpoint ep = Endpoint.create(impl);
>> ep.setProperties(props);
>> ep.publish("/myService");
>> 
>> If you cannot stick the wsdlLocation on the attribute, I strongly suggest
>> just going with either the JaxWsServerFactoryBean or casting the Endpoint
>> returned from the create method there to a CXF specific EndpointImpl and
>> calling setWsdlLocation(…) on it.   Dealing with the JAX-WS
>> Endpoint.setMetadata(..) calls sucks for this.
>> 
>> Hope that helps.
>> 
>> Dan
>> 
>> 
>> 
>>> 
>>> Thanks
>>> 
>>> Dirk
>>> 
>>> 
>>> On Thu, Mar 7, 2013 at 11:37 AM, Daniel Kulp [via CXF] <
>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724283&i=1>>
>> wrote:
>>> 
>>>> 
>>>> What does your web.xml look like?   Does it still reference the
>>>> CXFServlet?   Did you update it to change it to CXFNonSpringServlet?
>>>> 
>>>> Dan
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Mar 7, 2013, at 2:28 PM, dhogan <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=5724272&i=0>>
>>>> wrote:
>>>> 
>>>>> Thanks for the prompt response.
>>>>> 
>>>>> I have explicitly removed the spring maven dependencies. I had a set
>> of
>>>>> pretty sophisticated services running (based on CXF's
>>>>> SecurityTokenService), with spring-web as a mvn dependency. I had a
>>>> basic
>>>>> web-service that allowed me to publish STS instances. This endpoint
>> was
>>>>> published via a cxf-servlet.xml:
>>>>> jaxws:endpoint id="STSPublish"
>>>>> implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
>>>>>                  address="/sts_publish">
>>>>>  </jaxws:endpoint>
>>>>> 
>>>>> We are already using Guice in our project, and I would prefer not to
>>>>> include Spring - fewer moving parts = less complexity. When the wsdl
>>>>> corresponding to this service was hit, in a .war without Spring jars,
>> I
>>>>> would get the NoClassDefFoundError mentioned in the previous post. It
>>>>> appears that the cxf-servlet.xml file has to have a <beans> root
>>>> element,
>>>>> which may be responsible for pulling in Spring, so I tried to publish
>>>> the
>>>>> same service programmatically, but I appear to get the same error.
>>>>> 
>>>>> Thanks for your help.
>>>>> 
>>>>> Dirk
>>>>> 
>>>>> 
>>>>> On Thu, Mar 7, 2013 at 11:16 AM, Jose María Zaragoza [via CXF] <
>>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=1>>
>> 
>>>> wrote:
>>>>> 
>>>>>>> 
>>>>>>> java.lang.ClassNotFoundException:
>>>>>>> org.springframework.context.ApplicationListener
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Which  Spring JAR do you have added to your project ? Or mvn
>>>> dependencies
>>>>>> ...
>>>>>> 
>>>>>> 
>>>>>> ------------------------------
>>>>>> If you reply to this email, your message will be added to the
>>>> discussion
>>>>>> below:
>>>>>> 
>>>>>> 
>>>> 
>>>>>> .
>>>>>> NAML<
>>>> 
>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>> 
>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> View this message in context:
>>>> 
>> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724271.html
>>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>> 
>>>> --
>>>> Daniel Kulp
>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=2>
>> -
>>>> http://dankulp.com/blog
>>>> 
>>>> Talend Community Coder - http://coders.talend.com
>>>> 
>>>> 
>>>> 
>>>> ------------------------------
>>>> If you reply to this email, your message will be added to the
>> discussion
>>>> below:
>>>> 
>>>> 
>> 
>>>> .
>>>> NAML<
>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>> 
>>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724281.html
>> 
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>> 
>> --
>> Daniel Kulp
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724283&i=2> -
>> http://dankulp.com/blog
>> Talend Community Coder - http://coders.talend.com
>> 
>> 
>> 
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> 
>> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724283.html
>> To unsubscribe from JaxWsServerFactoryBean without Spring, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724258&code=ZGlyay5ob2dhbkBmb3JnZXJvY2suY29tfDU3MjQyNTh8NDEzODQ2MjQw>
>> .
>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>> 
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724321.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: JaxWsServerFactoryBean without Spring

Posted by dhogan <di...@forgerock.com>.
Oops - Dan I did not see your post - thanks for your response - I could have
been done a few hours ago.

Dirk



--
View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724326.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JaxWsServerFactoryBean without Spring

Posted by dhogan <di...@forgerock.com>.
Not to reply to my own post, but I finally figured things out. This is the
way I am understanding things: The CXFServlet and the CXFNonSpringServlet
maintain a collection of services published in their context, or on their
bus. So if I published an endpoint in the context of a
ServletContextListener, or some other servlet, it makes sense that the
CXFServlet or CXFNonSpringServlet would know nothing about it, and thus
could not route requests to it. The key was here:
http://cxf.apache.org/docs/servlet-transport.html. The bottom line is that I
subclassed the CXFNonSpringServlet, and published my STS-instance-publishing
web-service in the over-ridden loadBus method:
    @Override
    public void loadBus(ServletConfig servletConfig) {
        super.loadBus(servletConfig);
        Bus bus = getBus();
        BusFactory.setDefaultBus(bus);
        Endpoint.publish("/sts_publish", new STSPublishImpl());

    }

My web.xml specifies my CXFNonSpringServlet subclass. My
STS-instance-publishing service then publishes no problem, and any STS
instance published by calling this web-service is also happily exposed and
consumable relative to the servlet-mapping corresponding to my
CXFNonSpringServlet subclass.

Eureka.



--
View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724325.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JaxWsServerFactoryBean without Spring

Posted by dhogan <di...@forgerock.com>.
Hi-
*I am having difficulty transitioning from the CXFServlet based deployment,
to a CXFNonSpringServlet deployment, and am hoping for some insight.

*
*The scenario: I am exposing a web-service that programmatically publishes
additional web-services - in this case, SecurityTokenService instances.
That all works fine in a Spring-based deployment. Here’s the relevant state
that works great in a Spring-based deployment:

web.xml

   <servlet>
       <servlet-name>new_sts</servlet-name>
       <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
   </servlet>
   <servlet-mapping>
       <servlet-name>new_sts</servlet-name>
       <url-pattern>/new_sts/*</url-pattern>
   </servlet-mapping>

cxf-servlet.xml

<beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:jaxws="http://cxf.apache.org/jaxws"
     xsi:schemaLocation="
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
>

   <jaxws:endpoint id="STSPublish"
implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
                   address="/sts_publish">
   </jaxws:endpoint>
</beans>

The STSPublishImpl is a pojo with a SEI with a bare @WebService annotation,
and the STSPublishImpl with an annotation that looks like:
@WebService(
       endpointInterface="org.forgerock.openam.sts.publish.web.STSPublish",
       serviceName="STSPublishService",
       portName = "STSPublishPort",
       targetNamespace = "http://org.forgerock.openam.sts.publish")

The STSPublishImpl has the following code: (the spec object is passed as a
parameter, and is the same regardless of invocation context. Likewise, the
getProperties() sets the Crypto state for various SecurityPolicy bindings).

       JaxWsServerFactoryBean serverFactoryBean = new
JaxWsServerFactoryBean();
       serverFactoryBean.setWsdlLocation(spec.getWsdlLocation());
       serverFactoryBean.setAddress(uriElement);
       serverFactoryBean.setServiceBean(new
AMSecurityTokenServiceProvider());
       serverFactoryBean.setServiceName(spec.getServiceQName());
       serverFactoryBean.setEndpointName(spec.getPortQName());
       serverFactoryBean.setBindingId(SOAPBinding.SOAP12HTTP_BINDING);
       serverFactoryBean.setProperties(getProperties());
       serverFactoryBean.create();

If I invoke this code with a uriElement of e.g. Instance444, I can happily
invoke my sts on http://host:8080/openam/new_sts/Instance444 (openam is the
name of the .war file that all of this is bundled in)

Now here is the non-functioning CXFNonSpringServlet context:*
*
web.xml

   <servlet>
       <servlet-name>new_sts</servlet-name>
       <servlet-class>org.apache.cxf.transport.servlet.CXFNonSpringServlet</servlet-class>
   </servlet>
   <servlet-mapping>
       <servlet-name>new_sts</servlet-name>
       <url-pattern>/new_sts/*</url-pattern>
   </servlet-mapping>

Because the cxf-servlet.xml seems to have to start with the beans element,
which seems to require the CXFServlet (it is ignored by the
CXFNonSpringServlet), I have tried to deploy my STS-instance creation
functionality two ways: 1. as a programatically created web-service,
published from a ServletContextListener, and 2. as a simple servlet.

Here is the simple code publish my STSPublishImpl web-service, run in my
ServletContextListener

       JaxWsServerFactoryBean serverFactoryBean = new
JaxWsServerFactoryBean();
       serverFactoryBean.setAddress("/sts_publish");
       serverFactoryBean.setServiceBean(new STSPublishImpl());
       serverFactoryBean.create();
or

      Endpoint.publish("/sts_publish", new STSPublishImpl());

In either case, the logs report:

Mar 8, 2013 9:23:37 AM
org.apache.cxf.service.factory.ReflectionServiceFactoryBe
an buildServiceFromClass
INFO: Creating Service {http://org.forgerock.openam.sts.publish
}STSPublishServic
e from class org.forgerock.openam.sts.publish.web.STSPublish
Mar 8, 2013 9:23:37 AM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be /sts_publish

but when I want to hit the wsdl, I get the dreaded

Mar 8, 2013 9:24:34 AM org.apache.cxf.transport.servlet.ServletController
invoke
WARNING: Can't find the the request for
http://macbook.dirk.internal.forgerock.com:8080/openam/new_sts/sts_publish'sObserver

So I deployed my STS-instance publish code as a simple Servlet, to avoid
having to create a web-service that allows me to create STS instances. I
also had hoped that the publishing of my web-service failed because I was
performing the publish in a ServletContextListener. But if I write a
servlet, which executes the exact same JaxWsServerFactory bean code
(specified above) which successfully publishes STS instances when run in a
Spring-based web-service, I get the following log messages:

Mar 8, 2013 11:18:30 AM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service {
http://docs.oasis-open.org/ws-sx/ws-trust/200512/}sts_service from WSDL:
sts_ut.wsdl
Mar 8, 2013 11:18:31 AM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be /newSTS
Mar 8, 2013 11:18:57 AM org.apache.cxf.transport.servlet.ServletController
invoke
WARNING: Can't find the the request for
http://macbook.dirk.internal.forgerock.com:8080/openam/new_sts/newSTS'sObserver

Note the first 4 lines of the log snippet immediately above is exactly the
same as those logged when I run the code from within the Spring-based
web-service (which is successful - I don't get the final two lines in the
log).

I’d really appreciate any help, as I am out of ideas.*
*
*
*Thanks*
*
*
*Dirk*


On Thu, Mar 7, 2013 at 2:08 PM, Daniel Kulp [via CXF] <
ml-node+s547215n5724283h61@n5.nabble.com> wrote:

>
> On Mar 7, 2013, at 4:59 PM, dhogan <[hidden email]<http://user/SendEmail.jtp?type=node&node=5724283&i=0>>
> wrote:
>
> > Dan-
> > Is it possible to deploy and enforce wsdl-first web-services with
> > SecurityPolicy references without Spring?
>
> Yes.
>
> > Is it largely a function of
> > adding the WSS4J interceptors to one's endpoint?
>
> Ideally, no.  The basic WSS4J interceptors don't handle the security
> policy things.
>
> > Searching this forum
> > yields contradictory indications regarding the feature-set of CXF
> without
> > Spring, though it does seem that the later posts indicate that most
> > everything you can do with Spring, you can do without (with the possible
> > exception of JMS). Is this correct? I can't seem to find any samples or
> > system tests that use the CXFNonSpringServlet - are there any?
>
> If you use the JaxWsServerFactoryBean from within whatever method you use
> to setup the services, then you would just need to set the wsdlLocation
> appropriately as well as the various properties. There are methods for that
> right on the factory bean.
>
> If you want to use the JAX-WS Endpoint.pushlish(…) API's, it's certainly a
> bit more complicated.    It's not too bad if you fill in the wsdlLocation
> attribute of the @WebService annotation on the impl.  In that case, you can
> do:
>
> Map<String, Object> props = new HashMap<..>();
> props.put("ws.security…..", "….");
> Endpoint ep = Endpoint.create(impl);
> ep.setProperties(props);
> ep.publish("/myService");
>
> If you cannot stick the wsdlLocation on the attribute, I strongly suggest
> just going with either the JaxWsServerFactoryBean or casting the Endpoint
> returned from the create method there to a CXF specific EndpointImpl and
> calling setWsdlLocation(…) on it.   Dealing with the JAX-WS
> Endpoint.setMetadata(..) calls sucks for this.
>
> Hope that helps.
>
> Dan
>
>
>
> >
> > Thanks
> >
> > Dirk
> >
> >
> > On Thu, Mar 7, 2013 at 11:37 AM, Daniel Kulp [via CXF] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=5724283&i=1>>
> wrote:
> >
> >>
> >> What does your web.xml look like?   Does it still reference the
> >> CXFServlet?   Did you update it to change it to CXFNonSpringServlet?
> >>
> >> Dan
> >>
> >>
> >>
> >>
> >> On Mar 7, 2013, at 2:28 PM, dhogan <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=5724272&i=0>>
> >> wrote:
> >>
> >>> Thanks for the prompt response.
> >>>
> >>> I have explicitly removed the spring maven dependencies. I had a set
> of
> >>> pretty sophisticated services running (based on CXF's
> >>> SecurityTokenService), with spring-web as a mvn dependency. I had a
> >> basic
> >>> web-service that allowed me to publish STS instances. This endpoint
> was
> >>> published via a cxf-servlet.xml:
> >>> jaxws:endpoint id="STSPublish"
> >>> implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
> >>>                   address="/sts_publish">
> >>>   </jaxws:endpoint>
> >>>
> >>> We are already using Guice in our project, and I would prefer not to
> >>> include Spring - fewer moving parts = less complexity. When the wsdl
> >>> corresponding to this service was hit, in a .war without Spring jars,
> I
> >>> would get the NoClassDefFoundError mentioned in the previous post. It
> >>> appears that the cxf-servlet.xml file has to have a <beans> root
> >> element,
> >>> which may be responsible for pulling in Spring, so I tried to publish
> >> the
> >>> same service programmatically, but I appear to get the same error.
> >>>
> >>> Thanks for your help.
> >>>
> >>> Dirk
> >>>
> >>>
> >>> On Thu, Mar 7, 2013 at 11:16 AM, Jose María Zaragoza [via CXF] <
> >>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=1>>
>
> >> wrote:
> >>>
> >>>>>
> >>>>> java.lang.ClassNotFoundException:
> >>>>> org.springframework.context.ApplicationListener
> >>>>>
> >>>>
> >>>>
> >>>> Which  Spring JAR do you have added to your project ? Or mvn
> >> dependencies
> >>>> ...
> >>>>
> >>>>
> >>>> ------------------------------
> >>>> If you reply to this email, your message will be added to the
> >> discussion
> >>>> below:
> >>>>
> >>>>
> >>
> >>>> .
> >>>> NAML<
> >>
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>
> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724271.html
> >>> Sent from the cxf-user mailing list archive at Nabble.com.
> >>
> >> --
> >> Daniel Kulp
> >> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=2>
> -
> >> http://dankulp.com/blog
> >>
> >> Talend Community Coder - http://coders.talend.com
> >>
> >>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
>
> >> .
> >> NAML<
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724281.html
>
> > Sent from the cxf-user mailing list archive at Nabble.com.
>
> --
> Daniel Kulp
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724283&i=2> -
> http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724283.html
>  To unsubscribe from JaxWsServerFactoryBean without Spring, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724258&code=ZGlyay5ob2dhbkBmb3JnZXJvY2suY29tfDU3MjQyNTh8NDEzODQ2MjQw>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724321.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JaxWsServerFactoryBean without Spring

Posted by Daniel Kulp <dk...@apache.org>.
On Mar 7, 2013, at 4:59 PM, dhogan <di...@forgerock.com> wrote:

> Dan-
> Is it possible to deploy and enforce wsdl-first web-services with
> SecurityPolicy references without Spring?

Yes.

> Is it largely a function of
> adding the WSS4J interceptors to one's endpoint?

Ideally, no.  The basic WSS4J interceptors don't handle the security policy things.

> Searching this forum
> yields contradictory indications regarding the feature-set of CXF without
> Spring, though it does seem that the later posts indicate that most
> everything you can do with Spring, you can do without (with the possible
> exception of JMS). Is this correct? I can't seem to find any samples or
> system tests that use the CXFNonSpringServlet - are there any?

If you use the JaxWsServerFactoryBean from within whatever method you use to setup the services, then you would just need to set the wsdlLocation appropriately as well as the various properties. There are methods for that right on the factory bean.

If you want to use the JAX-WS Endpoint.pushlish(…) API's, it's certainly a bit more complicated.    It's not too bad if you fill in the wsdlLocation attribute of the @WebService annotation on the impl.  In that case, you can do:

Map<String, Object> props = new HashMap<..>();
props.put("ws.security…..", "….");
Endpoint ep = Endpoint.create(impl);
ep.setProperties(props);
ep.publish("/myService");

If you cannot stick the wsdlLocation on the attribute, I strongly suggest just going with either the JaxWsServerFactoryBean or casting the Endpoint returned from the create method there to a CXF specific EndpointImpl and calling setWsdlLocation(…) on it.   Dealing with the JAX-WS Endpoint.setMetadata(..) calls sucks for this.

Hope that helps.

Dan



> 
> Thanks
> 
> Dirk
> 
> 
> On Thu, Mar 7, 2013 at 11:37 AM, Daniel Kulp [via CXF] <
> ml-node+s547215n5724272h20@n5.nabble.com> wrote:
> 
>> 
>> What does your web.xml look like?   Does it still reference the
>> CXFServlet?   Did you update it to change it to CXFNonSpringServlet?
>> 
>> Dan
>> 
>> 
>> 
>> 
>> On Mar 7, 2013, at 2:28 PM, dhogan <[hidden email]<http://user/SendEmail.jtp?type=node&node=5724272&i=0>>
>> wrote:
>> 
>>> Thanks for the prompt response.
>>> 
>>> I have explicitly removed the spring maven dependencies. I had a set of
>>> pretty sophisticated services running (based on CXF's
>>> SecurityTokenService), with spring-web as a mvn dependency. I had a
>> basic
>>> web-service that allowed me to publish STS instances. This endpoint was
>>> published via a cxf-servlet.xml:
>>> jaxws:endpoint id="STSPublish"
>>> implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
>>>                   address="/sts_publish">
>>>   </jaxws:endpoint>
>>> 
>>> We are already using Guice in our project, and I would prefer not to
>>> include Spring - fewer moving parts = less complexity. When the wsdl
>>> corresponding to this service was hit, in a .war without Spring jars, I
>>> would get the NoClassDefFoundError mentioned in the previous post. It
>>> appears that the cxf-servlet.xml file has to have a <beans> root
>> element,
>>> which may be responsible for pulling in Spring, so I tried to publish
>> the
>>> same service programmatically, but I appear to get the same error.
>>> 
>>> Thanks for your help.
>>> 
>>> Dirk
>>> 
>>> 
>>> On Thu, Mar 7, 2013 at 11:16 AM, Jose María Zaragoza [via CXF] <
>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=1>>
>> wrote:
>>> 
>>>>> 
>>>>> java.lang.ClassNotFoundException:
>>>>> org.springframework.context.ApplicationListener
>>>>> 
>>>> 
>>>> 
>>>> Which  Spring JAR do you have added to your project ? Or mvn
>> dependencies
>>>> ...
>>>> 
>>>> 
>>>> ------------------------------
>>>> If you reply to this email, your message will be added to the
>> discussion
>>>> below:
>>>> 
>>>> 
>> 
>>>> .
>>>> NAML<
>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>> 
>>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724271.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>> 
>> --
>> Daniel Kulp
>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=2> -
>> http://dankulp.com/blog
>> 
>> Talend Community Coder - http://coders.talend.com
>> 
>> 
>> 
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> 
>> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724272.html
>> To unsubscribe from JaxWsServerFactoryBean without Spring, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724258&code=ZGlyay5ob2dhbkBmb3JnZXJvY2suY29tfDU3MjQyNTh8NDEzODQ2MjQw>
>> .
>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>> 
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724281.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: JaxWsServerFactoryBean without Spring

Posted by dhogan <di...@forgerock.com>.
Dan-
Is it possible to deploy and enforce wsdl-first web-services with
SecurityPolicy references without Spring? Is it largely a function of
adding the WSS4J interceptors to one's endpoint? Searching this forum
yields contradictory indications regarding the feature-set of CXF without
Spring, though it does seem that the later posts indicate that most
everything you can do with Spring, you can do without (with the possible
exception of JMS). Is this correct? I can't seem to find any samples or
system tests that use the CXFNonSpringServlet - are there any?

Thanks

Dirk


On Thu, Mar 7, 2013 at 11:37 AM, Daniel Kulp [via CXF] <
ml-node+s547215n5724272h20@n5.nabble.com> wrote:

>
> What does your web.xml look like?   Does it still reference the
> CXFServlet?   Did you update it to change it to CXFNonSpringServlet?
>
> Dan
>
>
>
>
> On Mar 7, 2013, at 2:28 PM, dhogan <[hidden email]<http://user/SendEmail.jtp?type=node&node=5724272&i=0>>
> wrote:
>
> > Thanks for the prompt response.
> >
> > I have explicitly removed the spring maven dependencies. I had a set of
> > pretty sophisticated services running (based on CXF's
> > SecurityTokenService), with spring-web as a mvn dependency. I had a
> basic
> > web-service that allowed me to publish STS instances. This endpoint was
> > published via a cxf-servlet.xml:
> > jaxws:endpoint id="STSPublish"
> > implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
> >                    address="/sts_publish">
> >    </jaxws:endpoint>
> >
> > We are already using Guice in our project, and I would prefer not to
> > include Spring - fewer moving parts = less complexity. When the wsdl
> > corresponding to this service was hit, in a .war without Spring jars, I
> > would get the NoClassDefFoundError mentioned in the previous post. It
> > appears that the cxf-servlet.xml file has to have a <beans> root
> element,
> > which may be responsible for pulling in Spring, so I tried to publish
> the
> > same service programmatically, but I appear to get the same error.
> >
> > Thanks for your help.
> >
> > Dirk
> >
> >
> > On Thu, Mar 7, 2013 at 11:16 AM, Jose María Zaragoza [via CXF] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=1>>
> wrote:
> >
> >>>
> >>> java.lang.ClassNotFoundException:
> >>> org.springframework.context.ApplicationListener
> >>>
> >>
> >>
> >> Which  Spring JAR do you have added to your project ? Or mvn
> dependencies
> >> ...
> >>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
>
> >> .
> >> NAML<
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724271.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
>
> --
> Daniel Kulp
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=2> -
> http://dankulp.com/blog
>
> Talend Community Coder - http://coders.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724272.html
>  To unsubscribe from JaxWsServerFactoryBean without Spring, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724258&code=ZGlyay5ob2dhbkBmb3JnZXJvY2suY29tfDU3MjQyNTh8NDEzODQ2MjQw>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724281.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JaxWsServerFactoryBean without Spring

Posted by dhogan <di...@forgerock.com>.
Ahh - bonanza. Thanks for your help!!!

Dirk


On Thu, Mar 7, 2013 at 11:37 AM, Daniel Kulp [via CXF] <
ml-node+s547215n5724272h20@n5.nabble.com> wrote:

>
> What does your web.xml look like?   Does it still reference the
> CXFServlet?   Did you update it to change it to CXFNonSpringServlet?
>
> Dan
>
>
>
>
> On Mar 7, 2013, at 2:28 PM, dhogan <[hidden email]<http://user/SendEmail.jtp?type=node&node=5724272&i=0>>
> wrote:
>
> > Thanks for the prompt response.
> >
> > I have explicitly removed the spring maven dependencies. I had a set of
> > pretty sophisticated services running (based on CXF's
> > SecurityTokenService), with spring-web as a mvn dependency. I had a
> basic
> > web-service that allowed me to publish STS instances. This endpoint was
> > published via a cxf-servlet.xml:
> > jaxws:endpoint id="STSPublish"
> > implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
> >                    address="/sts_publish">
> >    </jaxws:endpoint>
> >
> > We are already using Guice in our project, and I would prefer not to
> > include Spring - fewer moving parts = less complexity. When the wsdl
> > corresponding to this service was hit, in a .war without Spring jars, I
> > would get the NoClassDefFoundError mentioned in the previous post. It
> > appears that the cxf-servlet.xml file has to have a <beans> root
> element,
> > which may be responsible for pulling in Spring, so I tried to publish
> the
> > same service programmatically, but I appear to get the same error.
> >
> > Thanks for your help.
> >
> > Dirk
> >
> >
> > On Thu, Mar 7, 2013 at 11:16 AM, Jose María Zaragoza [via CXF] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=1>>
> wrote:
> >
> >>>
> >>> java.lang.ClassNotFoundException:
> >>> org.springframework.context.ApplicationListener
> >>>
> >>
> >>
> >> Which  Spring JAR do you have added to your project ? Or mvn
> dependencies
> >> ...
> >>
> >>
> >> ------------------------------
> >> If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
>
> >> .
> >> NAML<
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724271.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
>
> --
> Daniel Kulp
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5724272&i=2> -
> http://dankulp.com/blog
>
> Talend Community Coder - http://coders.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724272.html
>  To unsubscribe from JaxWsServerFactoryBean without Spring, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724258&code=ZGlyay5ob2dhbkBmb3JnZXJvY2suY29tfDU3MjQyNTh8NDEzODQ2MjQw>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724279.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JaxWsServerFactoryBean without Spring

Posted by Daniel Kulp <dk...@apache.org>.
What does your web.xml look like?   Does it still reference the CXFServlet?   Did you update it to change it to CXFNonSpringServlet?

Dan




On Mar 7, 2013, at 2:28 PM, dhogan <di...@forgerock.com> wrote:

> Thanks for the prompt response.
> 
> I have explicitly removed the spring maven dependencies. I had a set of
> pretty sophisticated services running (based on CXF's
> SecurityTokenService), with spring-web as a mvn dependency. I had a basic
> web-service that allowed me to publish STS instances. This endpoint was
> published via a cxf-servlet.xml:
> jaxws:endpoint id="STSPublish"
> implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
>                    address="/sts_publish">
>    </jaxws:endpoint>
> 
> We are already using Guice in our project, and I would prefer not to
> include Spring - fewer moving parts = less complexity. When the wsdl
> corresponding to this service was hit, in a .war without Spring jars, I
> would get the NoClassDefFoundError mentioned in the previous post. It
> appears that the cxf-servlet.xml file has to have a <beans> root element,
> which may be responsible for pulling in Spring, so I tried to publish the
> same service programmatically, but I appear to get the same error.
> 
> Thanks for your help.
> 
> Dirk
> 
> 
> On Thu, Mar 7, 2013 at 11:16 AM, Jose María Zaragoza [via CXF] <
> ml-node+s547215n5724260h48@n5.nabble.com> wrote:
> 
>>> 
>>> java.lang.ClassNotFoundException:
>>> org.springframework.context.ApplicationListener
>>> 
>> 
>> 
>> Which  Spring JAR do you have added to your project ? Or mvn dependencies
>> ...
>> 
>> 
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>> 
>> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724260.html
>> To unsubscribe from JaxWsServerFactoryBean without Spring, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724258&code=ZGlyay5ob2dhbkBmb3JnZXJvY2suY29tfDU3MjQyNTh8NDEzODQ2MjQw>
>> .
>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>> 
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724271.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: JaxWsServerFactoryBean without Spring

Posted by dhogan <di...@forgerock.com>.
Thanks for the prompt response.

I have explicitly removed the spring maven dependencies. I had a set of
pretty sophisticated services running (based on CXF's
SecurityTokenService), with spring-web as a mvn dependency. I had a basic
web-service that allowed me to publish STS instances. This endpoint was
published via a cxf-servlet.xml:
jaxws:endpoint id="STSPublish"
implementor="org.forgerock.openam.sts.publish.web.STSPublishImpl"
                    address="/sts_publish">
    </jaxws:endpoint>

We are already using Guice in our project, and I would prefer not to
include Spring - fewer moving parts = less complexity. When the wsdl
corresponding to this service was hit, in a .war without Spring jars, I
would get the NoClassDefFoundError mentioned in the previous post. It
appears that the cxf-servlet.xml file has to have a <beans> root element,
which may be responsible for pulling in Spring, so I tried to publish the
same service programmatically, but I appear to get the same error.

Thanks for your help.

Dirk


On Thu, Mar 7, 2013 at 11:16 AM, Jose María Zaragoza [via CXF] <
ml-node+s547215n5724260h48@n5.nabble.com> wrote:

> >
> > java.lang.ClassNotFoundException:
> > org.springframework.context.ApplicationListener
> >
>
>
> Which  Spring JAR do you have added to your project ? Or mvn dependencies
> ...
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724260.html
>  To unsubscribe from JaxWsServerFactoryBean without Spring, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5724258&code=ZGlyay5ob2dhbkBmb3JnZXJvY2suY29tfDU3MjQyNTh8NDEzODQ2MjQw>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/JaxWsServerFactoryBean-without-Spring-tp5724258p5724271.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: JaxWsServerFactoryBean without Spring

Posted by Jose María Zaragoza <de...@gmail.com>.
>
> java.lang.ClassNotFoundException:
> org.springframework.context.ApplicationListener
>


Which  Spring JAR do you have added to your project ? Or mvn dependencies ...