7

I am using Jaxb-impl-2.1.3.jar in the maven library.. every thing looks fine in pom entry.. if anyone come across with this error pleas give me an idea..

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.aop.aspectj.AspectJAfterAdvice.invoke(AspectJAfterAdvice.java:42)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
    at 

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.ws.fault.SOAPFaultBuilder
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:107)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
mac
  • 42,153
  • 26
  • 121
  • 131
user692585
  • 81
  • 1
  • 1
  • 3
  • 1
    What version of java are you using? Do you have any other WS related jars on your classpath? – Steven Jul 05 '11 at 22:58
  • I am using JDK 1.6.. In the class path maven dependencies are jaxb-api-2.1.jar and jaxrpc-api-1.1.jar.. – user692585 Jul 06 '11 at 09:33
  • 2
    Don't use `
    ` or other HTML tags to format code. Use SO's markdown, as suggested by the right column block during editing...
    – mac Jul 06 '11 at 10:15

1 Answers1

13

You need to add following jars into your application's classpath to make it work:

jaxws-api.jar
jaxws-rt.jar
jaxws-tools.jar
Paulius Matulionis
  • 23,085
  • 22
  • 103
  • 143
  • I've just added the `jaxws-rt.jar` to a Java 7 project to get around this issue. Would you (or anyone else!) be able to shed any light on why this is necessary? I thought that `SOAPFaultBuilder` would be in the jre? – Mr. Spice Nov 20 '15 at 14:26
  • "jaxws-rt.jar" suffice for mee too. Seems `SOAPFaultBuilder` exists in jdk1.7, but in my cas, my model was 1.5 level, and adding this dependency fixed the NCDFError. Thanks :) – boly38 Sep 13 '17 at 13:35