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

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)
 ...
Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 综合编程 » Get java.lang.reflect.InvocationTargetException by accessing the Web s…

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录