ClassCastException Thrown When Getting X509Certificate in Jetty-7.1.6.v20100715 - classloader

The filter I wrote threw ClassCastException
[Ljava.security.cert.X509Certificate; cannot be cast to java.security.cert.X509Certificate
when I tried to cast an Object extracted from the ServletRequest attribute, i.e.
public void doFilter(ServletRequest req, ServletResponse res, FilterChain filterChain) throws
IOException, ServletException
{
X509Certificate cert = (X509Certificate) req.getAttribute("javax.servlet.request.X509Certificate");
System.out.println("cert dn " + cert.getSubjectDN().toString());
filterChain.doFilter(req, res);
}
As I dug deeper I understood that exception like this was most probably caused by different classloaders though they are of same class type. How do I resolve this?
Thanks
I used the following Spring 3 configurarion to load Jetty 7 piecemeal
<bean class="org.eclipse.jetty.server.Server"
init-method="start" destroy-method="stop">
<property name="connectors">
<list>
<bean id="SSLConnector" class="org.eclipse.jetty.server.ssl.SslSocketConnector">
<property name="port" value="8553"/>
<property name="maxIdleTime" value="3600000"/>
<property name="soLingerTime" value="-1"/>
<property name="needClientAuth" value="true"/>
<property name="sslContext">
<ref bean="sslContext"/>
</property>
</bean>
</list>
</property>
<property name="handler">
<bean name="contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
<property name="handlers">
<list>
<bean class="org.eclipse.jetty.servlet.ServletContextHandler">
<property name="contextPath">
<value>/caas</value>
</property>
<property name="resourceBase" value="src/main/secure_webapp"/>
<property name="sessionHandler">
<bean class="org.eclipse.jetty.server.session.SessionHandler"/>
</property>
<property name="servletHandler">
<bean class="org.eclipse.jetty.servlet.ServletHandler">
<property name="filters">
<list>
<bean class="org.eclipse.jetty.servlet.FilterHolder">
<property name="name" value="myfilter"/>
<property name="filter">
<bean class="com.acme.MyFilter"/>
</property>
</bean>
</list>
</property>
<property name="filterMappings">
<list>
<bean class="org.eclipse.jetty.servlet.FilterMapping">
<property name="pathSpec">
<value>/*</value>
</property>
<property name="filterName"
value="myfilter"/>
</bean>
</list>
</property>
<property name="servlets">
<list>
<bean class="org.eclipse.jetty.servlet.ServletHolder">
<property name="name" value="default"/>
<property name="servlet">
<bean class="org.eclipse.jetty.servlet.DefaultServlet"/>
</property>
</bean>
</list>
</property>
<property name="servletMappings">
<list>
<bean class="org.eclipse.jetty.servlet.ServletMapping">
<property name="pathSpecs">
<list>
<value>/</value>
</list>
</property>
<property name="servletName" value="default"/>
</bean>
</list>
</property>
</bean>
</property>
</bean>
</list>
</property>
</bean>
</property>
</bean>

I don't think it's a duplicate class problem in this case, because X509Certificate is contained in the core JRE libraries. There is, afaik, no other library which provides this abstract class.
I think the problem is the getAttribute() returns an array of X509Certificate objects, whereas you cast it down to a single object. The beginning [L of the ClassCastException message indicates that the object returned is an array.
Try casting to an array of certificates:
X509Certificate[] cert = (X509Certificate[])
req.getAttribute("javax.servlet.request.X509Certificate");
Also, i think that you should retrieve the object from getAttribute() and use instanceof checks to see whether it contains the desired types and maybe handle them differently.

Related

Servlet filter invoke not on default port [duplicate]

I'm running embedded jetty inside of a spring ioc container. The spring ioc contains also an embedded hsqldb which makes the whole configuration a nice and complete web application development environment (on a single JVM). Now I'm trying to add apache CXF to this environment to make the jetty host not only servlets but also web services.
Unfortunately I'm getting NullPointerException when attempting to access http://127.0.0.1:8080/cxf/* (servlets and static content are served ok). Any idea what's wrong?
2010-09-17 15:37:20,099 [btpool0-1 - /cxf/] DEBUG org.mortbay.log - REQUEST /cxf/ on org.mortbay.jetty.HttpConnection#2d14d18f
2010-09-17 15:37:20,100 [btpool0-1 - /cxf/] DEBUG org.mortbay.log - servlet=cxf-servlet-holder
2010-09-17 15:37:20,100 [btpool0-1 - /cxf/] DEBUG org.mortbay.log - chain=null
2010-09-17 15:37:20,100 [btpool0-1 - /cxf/] DEBUG org.mortbay.log - servelet holder=cxf-servlet-holder
2010-09-17 15:37:20,101 [btpool0-1 - /cxf/] ERROR org.mortbay.log - /cxf/
java.lang.NullPointerException
at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:142)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:281)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:368)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
I'm initializing spring with:
public static void main(String[] args) throws Exception {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(new String[] { "jetty-beans.xml" , "cxf-beans.xml" });
applicationContext.getBean("web-server", Server.class).join();
}
jetty-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"
xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean name="web-server" class="org.mortbay.jetty.Server"
init-method="start">
<property name="connectors">
<list>
<bean class="org.mortbay.jetty.nio.SelectChannelConnector">
<property name="host" value="localhost" />
<property name="port" value="8080" />
</bean>
</list>
</property>
<property name="handlers">
<list>
<ref bean="web-server-context-static" />
<ref bean="web-server-context-servlet" />
<ref bean="web-server-context-cxf" />
</list>
</property>
</bean>
<bean name="web-server-context-static" class="org.mortbay.jetty.servlet.Context">
<property name="contextPath" value="/static" />
<property name="handler">
<bean class="org.mortbay.jetty.handler.ResourceHandler">
<property name="resourceBase" value="static" />
</bean>
</property>
</bean>
<bean name="web-server-context-servlet" class="org.mortbay.jetty.servlet.Context">
<property name="contextPath" value="/servlet" />
<property name="handler">
<bean class="org.mortbay.jetty.servlet.ServletHandler">
<property name="servlets">
<list>
<bean class="org.mortbay.jetty.servlet.ServletHolder">
<property name="name" value="servlet-holder" />
<property name="servlet">
<bean class="test.TestServlet" />
</property>
</bean>
</list>
</property>
<property name="servletMappings">
<list>
<bean class="org.mortbay.jetty.servlet.ServletMapping">
<property name="servletName" value="servlet-holder" />
<property name="pathSpec" value="/*" />
</bean>
</list>
</property>
</bean>
</property>
</bean>
<bean name="web-server-context-cxf" class="org.mortbay.jetty.servlet.Context">
<property name="contextPath" value="/cxf" />
<property name="handler">
<bean class="org.mortbay.jetty.servlet.ServletHandler">
<property name="servlets">
<list>
<bean class="org.mortbay.jetty.servlet.ServletHolder">
<property name="name" value="cxf-servlet-holder" />
<property name="servlet">
<bean class="org.apache.cxf.transport.servlet.CXFServlet">
</bean>
</property>
</bean>
</list>
</property>
<property name="servletMappings">
<list>
<bean class="org.mortbay.jetty.servlet.ServletMapping">
<property name="servletName" value="cxf-servlet-holder" />
<property name="pathSpec" value="/*" />
</bean>
</list>
</property>
</bean>
</property>
</bean>
</beans>
cxf-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: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">
<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" />
<bean id="test-ws-impl" class="test.TestWSImpl" />
<jaxws:endpoint id="test-ws-endpoint" implementor="#test-ws-impl"
address="/testWS" />
</beans>
classpath:
activation-1.1.jar
commons-logging-1.1.1.jar
cxf-2.2.10.jar
jaxb-api-2.1.jar
jaxb-impl-2.1.13.jar
jcl-over-slf4j-1.6.1.jar
jetty-6.1.3.jar
jetty-annotations-6.1.3.jar
jetty-util-6.1.3.jar
log4j-1.2.16.jar
neethi-2.0.4.jar
org.springframework.aop-3.0.3.RELEASE.jar
org.springframework.asm-3.0.3.RELEASE.jar
org.springframework.beans-3.0.3.RELEASE.jar
org.springframework.context-3.0.3.RELEASE.jar
org.springframework.context.support-3.0.3.RELEASE.jar
org.springframework.core-3.0.3.RELEASE.jar
org.springframework.expression-3.0.3.RELEASE.jar
servlet-api-2.5-6.1.3.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
wsdl4j-1.6.2.jar
XmlSchema-1.4.5.jar
TestWSImpl.java:
package test;
import javax.jws.WebService;
#WebService(endpointInterface = "test.TestWSInterface")
public class TestWSImpl implements TestWSInterface {
#Override
public String doTest(String testSubject) {
return "successfully tested:" + testSubject;
}
}
TestWSInterface.java
package test;
import javax.jws.WebParam;
import javax.jws.WebService;
#WebService
public interface TestWSInterface {
String doTest(#WebParam String testSubject);
}
I've found out that the above configuration was wrong:
I did not use any WebApplicationContext with has to be initialized prior to the CXFServlet. The simple solution is to use the non-spring version of CXFServlet - it does not require any ApplicationContext (I don't want to create a separate ApplicationContext for the Web Services since I need to have shared DataSource between them) but it has too be initialized (Web Services must be published in the code).
After solving the Context issue I've found out that jetty 6.1 does not initialize the servlet context in proper way, everything works fine after updating to 7.x.
After writing custom WebApplicationContext I was able to use the main/root ApplicationContext as the WebApplicationContext allowing me to use the spring version of CXFServlet with about 6 lines of glue code.

How Event stream Works in wso2cep3.0.0

I am working with wso2cep3.0.0,
My input source and out put source is JMs.I written my Input event adapter and output event adapter like this
Input adapter
is
<?xml version="1.0" encoding="UTF-8"?>
<inputEventAdaptor name="jmsProxy" statistics="disable" trace="enable"
type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
<property name="java.naming.provider.url">tcp://localhost:61616</property>
<property name="transport.jms.SubscriptionDurable">false</property>
<property name="transport.jms.UserName">admin</property>
<property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
<property name="transport.jms.Password">admin</property>
<property name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</property>
<property name="transport.jms.DestinationType">queue</property>
</inputEventAdaptor>
and my
Output event adapter
is
<?xml version="1.0" encoding="UTF-8"?>
<outputEventAdaptor name="OUTJmsProxy" statistics="disable" trace="disable"
type="jms" xmlns="http://wso2.org/carbon/eventadaptormanager">
<property name="java.naming.security.principal">admin</property>
<property name="java.naming.provider.url">tcp://localhost:61616</property>
<property name="java.naming.security.credentials">admin</property>
<property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
<property name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</property>
<property name="transport.jms.DestinationType">queue</property>
</outputEventAdaptor>
and my input message in jmsproxy jms queue is like this
<soapenv:Body xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<uuid>cc253480-95b3-418e-b282-7e87f885c99e</uuid>
<Remarks>t4</Remarks>
<ReadingsLiteTaildtos>
<ReadingsLiteTaildto>
<FinalValue>70</FinalValue>
<InputText>Chiller Feeder Current R - Ph</InputText>
<InputValue>0.0</InputValue>
<ParameterId>-2499999974</ParameterId>
<SlNo>1</SlNo>
</ReadingsLiteTaildto>
<ReadingsLiteTaildto>
<FinalValue>70</FinalValue>
<InputText>Chiller Feeder Current Y - Ph</InputText>
<InputValue>0.0</InputValue>
<ParameterId>-2499999973</ParameterId>
<SlNo>2</SlNo>
</ReadingsLiteTaildto>
<ReadingsLiteTaildto>
<FinalValue>70</FinalValue>
<InputText>Chiller Feeder Current B - Ph</InputText>
<InputValue>0.0</InputValue>
<ParameterId>-2499999972</ParameterId>
<SlNo>3</SlNo>
</ReadingsLiteTaildto>
<ReadingsLiteTaildto>
<FinalValue>70</FinalValue>
<InputText>Chiller Energy Meter Reading</InputText>
<InputValue>0.0</InputValue>
<ParameterId>-2499999971</ParameterId>
<SlNo>4</SlNo>
</ReadingsLiteTaildto>
</ReadingsLiteTaildtos>
<ReadingDateTime>1381757157596</ReadingDateTime>
<PartyBranchId>-2500000000</PartyBranchId>
<ParametersetId>-2499999974</ParametersetId>
<AssetId>-2499999995</AssetId>
<TaskId>811291126760647</TaskId>
<WorkOUId>-1</WorkOUId>
<activityid>-2500000000</activityid>
<userid>-2499999993</userid>
<entrymode>0</entrymode>
<DeviceId>-1</DeviceId>
</soapenv:Body>
i wish to raise an event when final value cross the max value like more than 100
so how would i write Stream and
ExecutionPlan
In stream-manger-config.xml file consist
3 section
1.metaData 2.Correlation Data 3.Payload Data
so above message how would i define which data is under which section
one more we should define input payload and out payload as well in same stream config file else we need to define separate
Is cep help for this usecase or not
Thanx in Advance.
Yes, this is a typical usecase for CEP.
You can use an 'event builder' similar to following.
<?xml version="1.0" encoding="UTF-8"?>
<eventBuilder name="ReadingsDtoBuilder" statistics="disable"
trace="disable" xmlns="http://wso2.org/carbon/eventbuilder">
<from eventAdaptorName="jmsEventReceiver" eventAdaptorType="jms">
<property name="transport.jms.Destination">ReadingsQueue</property>
</from>
<mapping customMapping="disable"
parentXpath="//ReadingsLiteTaildtos" type="xml">
<property>
<from xpath="//ReadingsLiteTaildto/ParameterId"/>
<to name="meta_parameterId" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/Slno"/>
<to name="meta_slno" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/FinalValue"/>
<to name="finalValue" type="int"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/InputText"/>
<to name="inputText" type="string"/>
</property>
<property>
<from xpath="//ReadingsLiteTaildto/InputValue"/>
<to name="inputValue" type="double"/>
</property>
</mapping>
<to streamName="org.sample.readings.dto.stream" version="1.0.0"/>
</eventBuilder>
The execution plan can be as follows.
<?xml version="1.0" encoding="UTF-8"?>
<executionPlan name="ReadingsAnalyzer" statistics="disable"
trace="disable" xmlns="http://wso2.org/carbon/eventprocessor">
<description>This execution plan analyzes readings and triggers notifications based on threshold.</description>
<siddhiConfiguration>
<property name="siddhi.enable.distributed.processing">false</property>
<property name="siddhi.persistence.snapshot.time.interval.minutes">0</property>
</siddhiConfiguration>
<importedStreams>
<stream as="readings" name="org.sample.readings.dto.stream" version="1.0.0"/>
</importedStreams>
<queryExpressions><![CDATA[from readings[finalValue > 100]
select *
insert into notificationStream;]]></queryExpressions>
<exportedStreams>
<stream name="notificationStream" valueOf="notificationStream" version="1.0.0"/>
</exportedStreams>
</executionPlan>
You can define streams inside stream-manager-config.xml similar to the following.
<streamDefinition name="org.sample.readings.dto.stream" version="1.0.0">
<metaData>
<property name="parameterId" type="STRING"/>
<property name="slno" type="STRING"/>
</metaData>
<payloadData>
<property name="finalValue" type="INT"/>
<property name="inputText" type="STRING"/>
<property name="inputValue" type="DOUBLE"/>
</payloadData>
</streamDefinition>
<streamDefinition name="notificationStream" version="1.0.0">
<metaData>
<property name="parameterId" type="STRING"/>
<property name="slno" type="STRING"/>
</metaData>
<payloadData>
<property name="finalValue" type="INT"/>
<property name="inputText" type="STRING"/>
<property name="inputValue" type="DOUBLE"/>
</payloadData>
</streamDefinition>

Problems writing a for-each select with filters on multiple fields

I have an xml document with nodes that look like this:
<SQLIndexUsage>
<Property Name="database_name">ClearTrace</Property>
<Property Name="Object_Name">CTTraceSummary</Property>
<Property Name="Schema_name">dbo</Property>
<Property Name="Index_name">IX_CTTraceSummary_Date</Property>
<Property Name="Type_Desc">NONCLUSTERED</Property>
<Property Name="user_seeks" />
<Property Name="user_scans" />
<Property Name="user_lookups" />
<Property Name="user_updates" />
<Property Name="usage_ratio">0.00</Property>
<Property Name="RowError" />
<Property Name="RowState">Detached</Property>
<Property Name="Table" />
<Property Name="ItemArray">
<Property>ClearTrace</Property>
<Property>CTTraceSummary</Property>
<Property>dbo</Property>
<Property>IX_CTTraceSummary_Date</Property>
<Property>NONCLUSTERED</Property>
<Property />
<Property />
<Property />
<Property />
<Property>0.00</Property>
</Property>
<Property Name="HasErrors">False</Property>
</SQLIndexUsage>
How do I write a for-each select that will filter on multiple fields, I was working on something like this:
<xsl:for-each select="/objects/SQLIndexUsage/Property[#Name ='user_seeks'][1]!='' or /objects/SQLIndexUsage/Property[#Name ='user_scans']!='' or /objects/SQLIndexUsage/Property[#Name ='user_updates']!=''">
Or am I looking at this wrong?
In general, you should keep the conditions in a single predicate:
/objects/SQLIndexUsage/Property[
(#Name ='user_seeks' or #Name='user_scans' or #Name='user_updates') and .!='']
This is even shorter:
/objects/SQLIndexUsage/Property[
#Name[.='user_seeks' or .='user_scans' or .='user_updates'] and .!='']
This is complicated a bit by your position condition, but you can still do this (with union):
/objects/SQLIndexUsage/Property[#Name='user_seeks' and .!=''][1] |
/objects/SQLIndexUsage/Property[
(#Name='user_scans' or #Name='user_updates') and .!='']
Note: I've left /objects on the expression, even though your sample XML doesn't show it. I'm guessing you're actually working with a larger document.

Apache CXF + resource handler with embedded jetty in osgi with spring dm

I'm trying to run an apache cxf endpoint in an equinox osgi environment with jetty 7. I need the endpoint to be on address http://x.x.x.x:8080/ws/endpoint1 and have static resources on the root path http://x.x.x.x:8080/*.
I have a dedicated bundle for this purpose containing the cxf libraries. Spring dynamic modules are part of my target platform.
After some research I tried to start the jetty webserver in my spring application context.
<bean id="Server" class="org.eclipse.jetty.server.Server"
init-method="start" destroy-method="stop">
<property name="connectors">
<list>
<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<property name="port" value="8080" />
</bean>
</list>
</property>
<property name="handler">
<bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerList">
<property name="handlers">
<list>
<bean class="org.eclipse.jetty.server.handler.ResourceHandler">
<property name="directoriesListed" value="true" />
<property name="welcomeFiles">
<list>
<value>index.html</value>
</list>
</property>
<property name="resourceBase" value="./someDir" />
</bean>
<ref bean="web-service-cxf" />
<bean class="org.eclipse.jetty.server.handler.DefaultHandler" />
</list>
</property>
</bean>
</property>
</bean>
<bean name="web-service-cxf" class="org.eclipse.jetty.servlet.ServletContextHandler">
<property name="contextPath" value="/ws" />
<property name="handler">
<bean class="org.eclipse.jetty.servlet.ServletHandler">
<property name="servlets">
<list>
<bean class="org.eclipse.jetty.servlet.ServletHolder">
<property name="name" value="cxf-servlet-holder" />
<property name="servlet">
<bean class="org.apache.cxf.transport.servlet.CXFServlet">
</bean>
</property>
</bean>
</list>
</property>
<property name="servletMappings">
<list>
<bean class="org.eclipse.jetty.servlet.ServletMapping">
<property name="servletName" value="cxf-servlet-holder" />
<property name="pathSpec" value="/*" />
</bean>
</list>
</property>
</bean>
</property>
</bean>
My WebService Endpoint is declared with:
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean id="someService" class="abc.xyz.SomeClass" />
<jaxws:endpoint id="endpointId" implementor="#someBean"
address="/endpoint1">
</jaxws:endpoint>
Unfortunatly this is not working. I can reach the static resources, but not the webservice.
The log says, the WebService is published under address /endpoint1. No warnings, no exceptions.
When I change the address of the webservice to its full url
<bean id="someService" class="abc.xyz.SomeClass" />
<jaxws:endpoint id="endpointId" implementor="#someBean"
address="http://x.x.x.x:8080/ws/endpoint1">
</jaxws:endpoint>
the webservice works fine, but the static ressources are not available any more.
Is it possible with a configuration like this to publish an endpoint to a running jetty with relative address? Or am I totally wrong? Most examples I found on the web use a web.xml, but I'm not working with an application server like tomcat and need the application to be a standalone eclipse app.
Spend the whole last two nights on this, any help is highly appreciated.
Kind regards,
Onno
There are sooo many samples here. U shud be able to find what u r looking for
http://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes/distribution/src/main/release/samples

Spring, Apache CXF and Embedded Jetty

I'm trying create a web service capable server using Apache CXF, Spring and an embedded Jetty server. When I run my project the server seems to initialize correctly, however when I navigate to http://localhost:8080/SomeService expecting to see the service WSDL, instead I get the following exception:
SEVERE: /SomeService
java.lang.NullPointerException
at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:163)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFServlet.java:145)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
Any ideas?
Here's the Java main()
public static void main(String[] args) throws Exception {
new ClassPathXmlApplicationContext(new String[] {"beans-jetty.xml"});
}
beans-jetty.xml
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="file:conf/server.properties" />
</bean>
<bean id="server"
class="org.mortbay.jetty.Server"
init-method="start"
destroy-method="stop">
<property name="connectors">
<list>
<bean id="connector" class="org.mortbay.jetty.nio.SelectChannelConnector">
<property name="host" value="${server.address}"/>
<property name="port" value="${server.port}"/>
</bean>
</list>
</property>
<property name="handlers">
<list>
<ref bean="context-cxf"/>
</list>
</property>
</bean>
<bean name="context-cxf" class="org.mortbay.jetty.servlet.Context">
<property name="contextPath" value="/" />
<property name="handler">
<bean class="org.mortbay.jetty.servlet.ServletHandler">
<property name="servlets">
<list>
<bean class="org.mortbay.jetty.servlet.ServletHolder">
<property name="name" value="cxf-servlet-holder" />
<property name="servlet">
<bean class="org.apache.cxf.transport.servlet.CXFServlet" />
</property>
</bean>
</list>
</property>
<property name="servletMappings">
<list>
<bean class="org.mortbay.jetty.servlet.ServletMapping">
<property name="servletName" value="cxf-servlet-holder" />
<property name="pathSpec" value="/*" />
</bean>
</list>
</property>
</bean>
</property>
</bean>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:/beans-cxf.xml" />
beans-cxf.xml
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<jaxws:endpoint
id="someService"
implementor="com.awebster.gitta.services.SomeServiceImpl"
address="${server.address}" />
I should mention that I'm using the Maven one-jar plugin, although I doubt that makes any difference to this problem.
Many Thanks in advance!
Anthony