Get java.lang.reflect.InvocationTargetException by accessing the Web s…

综合编程 2017-12-31

I'm new to Axis. Axis(1.4) has been added to my webapp that runs on JBoss.

While invoking any service I'm getting the error:

[STDERR] AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.reflect.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
    {http://xml.apache.org/axis/}

I hit this issue as well using Axis, Eclipse and Amazon Web Services with Beanstalk. Any web service method that referenced my data model class which contained a static initialize method would generate this exception. (WebServiceMethod -> WebServiceClass-> ClassWithStaticInitializer -> StaticInitialzerThatFails)

Even catching and trying to deal with this gracefully would not work. The fix was copying the mysql-connector-java-5.1.18-bin.jar driver into WebContentWEB-INFlib

static {
        try {
            Class.forName("com.mysql.jdbc.Driver").newInstance();
        }
        catch (Exception err)
 ...

您可能感兴趣的

Java 8-Stream 转自:IBM-developerworks Stream是什么 看到这个Stream的第一眼,我相信你可能会想到Java io包中的各种InputSream和OutPutStream。你也有可能会想到大数据上实时计算的Stream。那Java8中提出的这个Stream是什么概念呢? ...
注解(2)– 定义自己的Annotation Processor... 大家还记得 (https://github.com/JakeWharton) 写的翻遍ui注解的库 butterknife 么? 之前我们都是使用findviewById来查找view,有了 butterknife 我们摆脱了这种重复代码,通过注解我们解放了生产力,我们可以把更多的经理放到...
Java并发系列—-AbstractQueuedSynchronizer源码分析之概要分... 学习Java并发编程不得不去了解一下java.util.concurrent这个包,这个包下面有许多我们经常用到的并发工具类,例如:ReentrantLock, CountDownLatch, CyclicBarrier, Semaphore等。而这些类的底层实现都依赖于AbstractQueued...
Java Annotated Monthly – February 2018 Since Trisha, your regular host, is still away, I’m in charge of updating you on what noteworthy things are going on in the community. My apologies up...
Web Application Frameworks What is the state-of-the-art web application framework? I am wanting to develop a web application, what is the current state of ...