You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Singh, Ramanand" <Ra...@geico.com> on 2007/09/15 01:32:21 UTC
CXF exception in running web service
I am running into a problem with the following exception. Any help would
be appreciated. I am pasting the configuration and code for the web
service below.
Thanks in advance for your help.
Regards,
Ramanand Singh
Architecture Team
GEICO IBU Service
301.986.2791
First the exception:
Sep 14, 2007 7:22:59 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
INFO: Creating Service
{http://authentication.common.insite.service.ibu.geico.com/}EAuthService
from class com.geico.ibu.service.insite.common.authentication.EAuth
Exception in thread "main" java.lang.NoSuchMethodError:
javax/xml/soap/SOAPFactory.createFault()Ljavax/xml/soap/SOAPFault;
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:150)
at $Proxy9.validateUser(Unknown Source)
at
com.geico.ibu.service.insite.common.authentication.EAuthClient.main(EAut
hClient.java:40)
Web Service Interface and class:
@WebService
public interface EAuth {
String validateUser(String xfrKey, String clinetName);
}
@WebService(endpointInterface =
"com.geico.ibu.service.insite.common.authentication.EAuth")
public class EAuthImpl implements EAuth {
/** The logger. */
private static final Logger LOG =
Logger.getLogger(EAuthImpl.class);
/**
* {@inheritDoc}
*/
public String validateUser(String xfrKey, String clinetName) {
AuthenticationResponse ar = new AuthenticationResponse();
String response = "Transfer Key: " + xfrKey + "\t client
name: " + clinetName;
LOG.info("===>> " + response);
ar.setEmailAddress("info@geico.com");
ar.setPolicyHolderName("Geico Policy Holder");
ar.setPolicyNumber("pol123456677889");
ar.setSessionId(new GUIDGenerator().generate());
return ar.toString();
//return ar;
}
}
Endpoint configuration:
<?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" />
<jaxws:endpoint
id="eauth"
implementor="com.geico.ibu.service.insite.common.authentication.EAuthImp
l"
address="/eauth" />
</beans>
Test Client:
public class EAuthClient {
private EAuthClient() {
// empty constructor
}
/**
* @param args
*/
public static void main(String args[]) throws Exception {
ClassPathXmlApplicationContext context
= new ClassPathXmlApplicationContext(new String[]
{"conf/spring/eauthClientContext.xml"});
EAuth eauthClient = (EAuth)context.getBean("eauthClient");
String response = eauthClient.validateUser("1234567890",
"CLAIMS");
System.out.println("Response: " + response);
System.exit(0);
// END SNIPPET: client
}
}
Client Configuration:
<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-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
<bean id="eauthClient"
class="com.geico.ibu.service.insite.common.authentication.EAuth"
factory-bean="clientFactory" factory-method="create"/>
<bean id="clientFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass"
value="com.geico.ibu.service.insite.common.authentication.EAuth"/>
<property name="address"
value="http://localhost:8080/insite/eservices/eauth"/>
</bean>
</beans>
====================
This email/fax message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution of this
email/fax is prohibited. If you are not the intended recipient, please
destroy all paper and electronic copies of the original message.
Re: CXF exception in running web service
Posted by Freeman Fang <fr...@iona.com>.
Hi Ramanand,
Both exceptions are caused by classpath issue from client side. But jars
in WEB-INF/lib as you list is used for your server side,
1.Exception in thread "main"
java.lang.NoSuchMethodError:javax/xml/soap/SOAPFactory.createFault()Ljavax/xml/soap/SOAPFault;
this exception is caused by wrong saaj version or saaj version conflict,
usually caused by two different saaj version in your classpath
2.Exception in thread "main" java.lang.NoClassDefFoundError:
com.sun.org.apache.xerces.internal.dom.ElementNSImpl
this xerces exception shows that xerces class shipped with jdk is not
loaded properly, what's the jdk version you are using, and what's the
jdk vendor? Is there some other xerces impl in your client side classpath?
So would you please append your client side classpath?
Best Regards
Freeman
Singh, Ramanand wrote:
> I am using saaj-api version 1.3.
>
> My WEB-INF/lib lists the following CXf-related jar files:
> cxf-api-2.0-incubator.jar
> cxf-common-schemas-2.0-incubator.jar
> cxf-common-utilities-2.0-incubator.jar
> cxf-rt-bindings-soap-2.0-incubator.jar
> cxf-rt-bindings-xml-2.0-incubator.jar
> cxf-rt-core-2.0-incubator.jar
> cxf-rt-databinding-jaxb-2.0-incubator.jar
> cxf-rt-frontend-jaxws-2.0-incubator.jar
> cxf-rt-frontend-simple-2.0-incubator.jar
> cxf-rt-transports-http-2.0-incubator.jar
> cxf-tools-common-2.0-incubator.jar
>
> saaj-api-1.3.jar
> saaj-impl-1.3.jar
>
> Sometime, I also get the following exception:
>
> Sep 17, 2007 11:25:22 AM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromClass
> INFO: Creating Service
> {http://authentication.common.insite.service.ibu.geico.com/}EAuthService
> from class com.geico.ibu.service.insite.common.authentication.EAuth
> Exception in thread "main" java.lang.NoClassDefFoundError:
> com.sun.org.apache.xerces.internal.dom.ElementNSImpl
> at java.lang.ClassLoader.defineClassImpl(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:228)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:556)
> at java.net.URLClassLoader.access$400(URLClassLoader.java:119)
> at
> java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961)
> at
> java.security.AccessController.doPrivileged(AccessController.java:275)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:487)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:607)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
> at java.lang.ClassLoader.defineClassImpl(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:228)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:556)
> at java.net.URLClassLoader.access$400(URLClassLoader.java:119)
> at
> java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961)
> at
> java.security.AccessController.doPrivileged(AccessController.java:275)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:487)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:607)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
> at java.lang.ClassLoader.defineClassImpl(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:228)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:556)
> at java.net.URLClassLoader.access$400(URLClassLoader.java:119)
> at
> java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961)
> at
> java.security.AccessController.doPrivileged(AccessController.java:275)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:487)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:607)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
> at
> com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl.createFault(SO
> APFactory1_1Impl.java:62)
> at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:150)
> at $Proxy9.validateUser(Unknown Source)
> at
> com.geico.ibu.service.insite.common.authentication.EAuthClient.main(EAut
> hClient.java:40)
>
>
> Regards,
> Ramanand Singh
> Architecture Team
> GEICO IBU Service
> 301.986.2791
>
> -----Original Message-----
> From: Freeman Fang [mailto:freeman.fang@iona.com]
> Sent: Monday, September 17, 2007 4:56 AM
> To: cxf-user@incubator.apache.org
> Subject: Re: CXF exception in running web service
>
> Hi Ramanand,
> The error shows you are using incorrect saaj-api version.
> Would you please check the saaj-api version on your classpath, it should
>
> be 1.3.
> Btw, which version of cxf you are using?
>
> Best Regards
>
> Freeman
>
>
> Singh, Ramanand wrote:
>
>> I am running into a problem with the following exception. Any help
>>
> would
>
>> be appreciated. I am pasting the configuration and code for the web
>> service below.
>>
>>
>>
>> Thanks in advance for your help.
>>
>>
>>
>> Regards,
>>
>> Ramanand Singh
>>
>> Architecture Team
>>
>> GEICO IBU Service
>>
>> 301.986.2791
>>
>>
>>
>> First the exception:
>>
>> Sep 14, 2007 7:22:59 PM
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
>> buildServiceFromClass
>>
>> INFO: Creating Service
>>
>>
> {http://authentication.common.insite.service.ibu.geico.com/}EAuthService
>
>> from class com.geico.ibu.service.insite.common.authentication.EAuth
>>
>> Exception in thread "main" java.lang.NoSuchMethodError:
>> javax/xml/soap/SOAPFactory.createFault()Ljavax/xml/soap/SOAPFault;
>>
>> at
>>
>>
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:150)
>
>> at $Proxy9.validateUser(Unknown Source)
>>
>> at
>>
>>
> com.geico.ibu.service.insite.common.authentication.EAuthClient.main(EAut
>
>> hClient.java:40)
>>
>>
>>
>> Web Service Interface and class:
>>
>>
>>
>> @WebService
>>
>> public interface EAuth {
>>
>> String validateUser(String xfrKey, String clinetName);
>>
>> }
>>
>>
>>
>> @WebService(endpointInterface =
>> "com.geico.ibu.service.insite.common.authentication.EAuth")
>>
>> public class EAuthImpl implements EAuth {
>>
>>
>>
>> /** The logger. */
>>
>> private static final Logger LOG =
>> Logger.getLogger(EAuthImpl.class);
>>
>>
>>
>> /**
>>
>> * {@inheritDoc}
>>
>> */
>>
>> public String validateUser(String xfrKey, String clinetName) {
>>
>> AuthenticationResponse ar = new AuthenticationResponse();
>>
>> String response = "Transfer Key: " + xfrKey + "\t client
>> name: " + clinetName;
>>
>> LOG.info("===>> " + response);
>>
>>
>>
>> ar.setEmailAddress("info@geico.com");
>>
>> ar.setPolicyHolderName("Geico Policy Holder");
>>
>> ar.setPolicyNumber("pol123456677889");
>>
>> ar.setSessionId(new GUIDGenerator().generate());
>>
>> return ar.toString();
>>
>> //return ar;
>>
>> }
>>
>> }
>>
>>
>>
>> Endpoint configuration:
>>
>> <?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" />
>>
>>
>>
>> <jaxws:endpoint
>>
>> id="eauth"
>>
>>
>>
>>
> implementor="com.geico.ibu.service.insite.common.authentication.EAuthImp
>
>> l"
>>
>> address="/eauth" />
>>
>> </beans>
>>
>>
>>
>> Test Client:
>>
>> public class EAuthClient {
>>
>> private EAuthClient() {
>>
>> // empty constructor
>>
>> }
>>
>> /**
>>
>> * @param args
>>
>> */
>>
>> public static void main(String args[]) throws Exception {
>>
>>
>>
>>
>>
>> ClassPathXmlApplicationContext context
>>
>> = new ClassPathXmlApplicationContext(new String[]
>>
>> {"conf/spring/eauthClientContext.xml"});
>>
>> EAuth eauthClient =
>>
> (EAuth)context.getBean("eauthClient");
>
>>
>>
>> String response = eauthClient.validateUser("1234567890",
>> "CLAIMS");
>>
>> System.out.println("Response: " + response);
>>
>> System.exit(0);
>>
>> // END SNIPPET: client
>>
>> }
>>
>>
>>
>> }
>>
>>
>>
>> Client Configuration:
>>
>> <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-2.0.xsd
>>
>> http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
>>
>>
>>
>> <bean id="eauthClient"
>> class="com.geico.ibu.service.insite.common.authentication.EAuth"
>>
>> factory-bean="clientFactory" factory-method="create"/>
>>
>>
>>
>> <bean id="clientFactory"
>> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>>
>> <property name="serviceClass"
>> value="com.geico.ibu.service.insite.common.authentication.EAuth"/>
>>
>> <property name="address"
>> value="http://localhost:8080/insite/eservices/eauth"/>
>>
>> </bean>
>>
>>
>>
>> </beans>
>>
>>
>>
>> ====================
>> This email/fax message is for the sole use of the intended
>> recipient(s) and may contain confidential and privileged information.
>> Any unauthorized review, use, disclosure or distribution of this
>> email/fax is prohibited. If you are not the intended recipient, please
>> destroy all paper and electronic copies of the original message.
>>
>>
>>
> ====================
> This email/fax message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged information.
> Any unauthorized review, use, disclosure or distribution of this
> email/fax is prohibited. If you are not the intended recipient, please
> destroy all paper and electronic copies of the original message.
>
>
RE: CXF exception in running web service
Posted by "Singh, Ramanand" <Ra...@geico.com>.
I am using saaj-api version 1.3.
My WEB-INF/lib lists the following CXf-related jar files:
cxf-api-2.0-incubator.jar
cxf-common-schemas-2.0-incubator.jar
cxf-common-utilities-2.0-incubator.jar
cxf-rt-bindings-soap-2.0-incubator.jar
cxf-rt-bindings-xml-2.0-incubator.jar
cxf-rt-core-2.0-incubator.jar
cxf-rt-databinding-jaxb-2.0-incubator.jar
cxf-rt-frontend-jaxws-2.0-incubator.jar
cxf-rt-frontend-simple-2.0-incubator.jar
cxf-rt-transports-http-2.0-incubator.jar
cxf-tools-common-2.0-incubator.jar
saaj-api-1.3.jar
saaj-impl-1.3.jar
Sometime, I also get the following exception:
Sep 17, 2007 11:25:22 AM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromClass
INFO: Creating Service
{http://authentication.common.insite.service.ibu.geico.com/}EAuthService
from class com.geico.ibu.service.insite.common.authentication.EAuth
Exception in thread "main" java.lang.NoClassDefFoundError:
com.sun.org.apache.xerces.internal.dom.ElementNSImpl
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:228)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:556)
at java.net.URLClassLoader.access$400(URLClassLoader.java:119)
at
java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961)
at
java.security.AccessController.doPrivileged(AccessController.java:275)
at java.net.URLClassLoader.findClass(URLClassLoader.java:487)
at java.lang.ClassLoader.loadClass(ClassLoader.java:607)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:228)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:556)
at java.net.URLClassLoader.access$400(URLClassLoader.java:119)
at
java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961)
at
java.security.AccessController.doPrivileged(AccessController.java:275)
at java.net.URLClassLoader.findClass(URLClassLoader.java:487)
at java.lang.ClassLoader.loadClass(ClassLoader.java:607)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:228)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:148)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:556)
at java.net.URLClassLoader.access$400(URLClassLoader.java:119)
at
java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:961)
at
java.security.AccessController.doPrivileged(AccessController.java:275)
at java.net.URLClassLoader.findClass(URLClassLoader.java:487)
at java.lang.ClassLoader.loadClass(ClassLoader.java:607)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:327)
at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
at
com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl.createFault(SO
APFactory1_1Impl.java:62)
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:150)
at $Proxy9.validateUser(Unknown Source)
at
com.geico.ibu.service.insite.common.authentication.EAuthClient.main(EAut
hClient.java:40)
Regards,
Ramanand Singh
Architecture Team
GEICO IBU Service
301.986.2791
-----Original Message-----
From: Freeman Fang [mailto:freeman.fang@iona.com]
Sent: Monday, September 17, 2007 4:56 AM
To: cxf-user@incubator.apache.org
Subject: Re: CXF exception in running web service
Hi Ramanand,
The error shows you are using incorrect saaj-api version.
Would you please check the saaj-api version on your classpath, it should
be 1.3.
Btw, which version of cxf you are using?
Best Regards
Freeman
Singh, Ramanand wrote:
> I am running into a problem with the following exception. Any help
would
> be appreciated. I am pasting the configuration and code for the web
> service below.
>
>
>
> Thanks in advance for your help.
>
>
>
> Regards,
>
> Ramanand Singh
>
> Architecture Team
>
> GEICO IBU Service
>
> 301.986.2791
>
>
>
> First the exception:
>
> Sep 14, 2007 7:22:59 PM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromClass
>
> INFO: Creating Service
>
{http://authentication.common.insite.service.ibu.geico.com/}EAuthService
> from class com.geico.ibu.service.insite.common.authentication.EAuth
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> javax/xml/soap/SOAPFactory.createFault()Ljavax/xml/soap/SOAPFault;
>
> at
>
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:150)
>
> at $Proxy9.validateUser(Unknown Source)
>
> at
>
com.geico.ibu.service.insite.common.authentication.EAuthClient.main(EAut
> hClient.java:40)
>
>
>
> Web Service Interface and class:
>
>
>
> @WebService
>
> public interface EAuth {
>
> String validateUser(String xfrKey, String clinetName);
>
> }
>
>
>
> @WebService(endpointInterface =
> "com.geico.ibu.service.insite.common.authentication.EAuth")
>
> public class EAuthImpl implements EAuth {
>
>
>
> /** The logger. */
>
> private static final Logger LOG =
> Logger.getLogger(EAuthImpl.class);
>
>
>
> /**
>
> * {@inheritDoc}
>
> */
>
> public String validateUser(String xfrKey, String clinetName) {
>
> AuthenticationResponse ar = new AuthenticationResponse();
>
> String response = "Transfer Key: " + xfrKey + "\t client
> name: " + clinetName;
>
> LOG.info("===>> " + response);
>
>
>
> ar.setEmailAddress("info@geico.com");
>
> ar.setPolicyHolderName("Geico Policy Holder");
>
> ar.setPolicyNumber("pol123456677889");
>
> ar.setSessionId(new GUIDGenerator().generate());
>
> return ar.toString();
>
> //return ar;
>
> }
>
> }
>
>
>
> Endpoint configuration:
>
> <?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" />
>
>
>
> <jaxws:endpoint
>
> id="eauth"
>
>
>
implementor="com.geico.ibu.service.insite.common.authentication.EAuthImp
> l"
>
> address="/eauth" />
>
> </beans>
>
>
>
> Test Client:
>
> public class EAuthClient {
>
> private EAuthClient() {
>
> // empty constructor
>
> }
>
> /**
>
> * @param args
>
> */
>
> public static void main(String args[]) throws Exception {
>
>
>
>
>
> ClassPathXmlApplicationContext context
>
> = new ClassPathXmlApplicationContext(new String[]
>
> {"conf/spring/eauthClientContext.xml"});
>
> EAuth eauthClient =
(EAuth)context.getBean("eauthClient");
>
>
>
> String response = eauthClient.validateUser("1234567890",
> "CLAIMS");
>
> System.out.println("Response: " + response);
>
> System.exit(0);
>
> // END SNIPPET: client
>
> }
>
>
>
> }
>
>
>
> Client Configuration:
>
> <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-2.0.xsd
>
> http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
>
>
>
> <bean id="eauthClient"
> class="com.geico.ibu.service.insite.common.authentication.EAuth"
>
> factory-bean="clientFactory" factory-method="create"/>
>
>
>
> <bean id="clientFactory"
> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>
> <property name="serviceClass"
> value="com.geico.ibu.service.insite.common.authentication.EAuth"/>
>
> <property name="address"
> value="http://localhost:8080/insite/eservices/eauth"/>
>
> </bean>
>
>
>
> </beans>
>
>
>
> ====================
> This email/fax message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged information.
> Any unauthorized review, use, disclosure or distribution of this
> email/fax is prohibited. If you are not the intended recipient, please
> destroy all paper and electronic copies of the original message.
>
>
====================
This email/fax message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution of this
email/fax is prohibited. If you are not the intended recipient, please
destroy all paper and electronic copies of the original message.
Re: CXF exception in running web service
Posted by Freeman Fang <fr...@iona.com>.
Hi Ramanand,
The error shows you are using incorrect saaj-api version.
Would you please check the saaj-api version on your classpath, it should
be 1.3.
Btw, which version of cxf you are using?
Best Regards
Freeman
Singh, Ramanand wrote:
> I am running into a problem with the following exception. Any help would
> be appreciated. I am pasting the configuration and code for the web
> service below.
>
>
>
> Thanks in advance for your help.
>
>
>
> Regards,
>
> Ramanand Singh
>
> Architecture Team
>
> GEICO IBU Service
>
> 301.986.2791
>
>
>
> First the exception:
>
> Sep 14, 2007 7:22:59 PM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromClass
>
> INFO: Creating Service
> {http://authentication.common.insite.service.ibu.geico.com/}EAuthService
> from class com.geico.ibu.service.insite.common.authentication.EAuth
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> javax/xml/soap/SOAPFactory.createFault()Ljavax/xml/soap/SOAPFault;
>
> at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:150)
>
> at $Proxy9.validateUser(Unknown Source)
>
> at
> com.geico.ibu.service.insite.common.authentication.EAuthClient.main(EAut
> hClient.java:40)
>
>
>
> Web Service Interface and class:
>
>
>
> @WebService
>
> public interface EAuth {
>
> String validateUser(String xfrKey, String clinetName);
>
> }
>
>
>
> @WebService(endpointInterface =
> "com.geico.ibu.service.insite.common.authentication.EAuth")
>
> public class EAuthImpl implements EAuth {
>
>
>
> /** The logger. */
>
> private static final Logger LOG =
> Logger.getLogger(EAuthImpl.class);
>
>
>
> /**
>
> * {@inheritDoc}
>
> */
>
> public String validateUser(String xfrKey, String clinetName) {
>
> AuthenticationResponse ar = new AuthenticationResponse();
>
> String response = "Transfer Key: " + xfrKey + "\t client
> name: " + clinetName;
>
> LOG.info("===>> " + response);
>
>
>
> ar.setEmailAddress("info@geico.com");
>
> ar.setPolicyHolderName("Geico Policy Holder");
>
> ar.setPolicyNumber("pol123456677889");
>
> ar.setSessionId(new GUIDGenerator().generate());
>
> return ar.toString();
>
> //return ar;
>
> }
>
> }
>
>
>
> Endpoint configuration:
>
> <?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" />
>
>
>
> <jaxws:endpoint
>
> id="eauth"
>
>
> implementor="com.geico.ibu.service.insite.common.authentication.EAuthImp
> l"
>
> address="/eauth" />
>
> </beans>
>
>
>
> Test Client:
>
> public class EAuthClient {
>
> private EAuthClient() {
>
> // empty constructor
>
> }
>
> /**
>
> * @param args
>
> */
>
> public static void main(String args[]) throws Exception {
>
>
>
>
>
> ClassPathXmlApplicationContext context
>
> = new ClassPathXmlApplicationContext(new String[]
>
> {"conf/spring/eauthClientContext.xml"});
>
> EAuth eauthClient = (EAuth)context.getBean("eauthClient");
>
>
>
> String response = eauthClient.validateUser("1234567890",
> "CLAIMS");
>
> System.out.println("Response: " + response);
>
> System.exit(0);
>
> // END SNIPPET: client
>
> }
>
>
>
> }
>
>
>
> Client Configuration:
>
> <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-2.0.xsd
>
> http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd">
>
>
>
> <bean id="eauthClient"
> class="com.geico.ibu.service.insite.common.authentication.EAuth"
>
> factory-bean="clientFactory" factory-method="create"/>
>
>
>
> <bean id="clientFactory"
> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>
> <property name="serviceClass"
> value="com.geico.ibu.service.insite.common.authentication.EAuth"/>
>
> <property name="address"
> value="http://localhost:8080/insite/eservices/eauth"/>
>
> </bean>
>
>
>
> </beans>
>
>
>
> ====================
> This email/fax message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged information.
> Any unauthorized review, use, disclosure or distribution of this
> email/fax is prohibited. If you are not the intended recipient, please
> destroy all paper and electronic copies of the original message.
>
>