bat0906 2009-12-24 12:02
浏览 852
已采纳

有没有整过webService的, 客户端java.lang.IllegalStateException: Could not initialize Servi

有没有整过webService的,
客户端java.lang.IllegalStateException: Could not initialize Service.

这到底是个什么错?????

[b]问题补充:[/b]
这个的具体错误:

Exception in thread "main" java.lang.IllegalStateException: Could not initialize Service.
at org.codehaus.xfire.jaxws.ServiceDelegate.(ServiceDelegate.java:77)
at org.codehaus.xfire.jaxws.Provider.createServiceDelegate(Provider.java:32)
at javax.xml.ws.Service.(Service.java:56)
at com.demo.hw.server.Ibemain1.(Ibemain1.java:47)
at com.demo.hw.server.Ibemain_IbemainImplPort_Client.main(Ibemain_IbemainImplPort_Client.java:59)
Caused by: java.lang.NoSuchMethodException: com.demo.hw.server.Ibemain1.getPortClassMap()
at java.lang.Class.getMethod(Class.java:1605)
at org.codehaus.xfire.jaxws.ServiceDelegate.(ServiceDelegate.java:60)
... 4 more

[b]问题补充:[/b]
[b]Exception in thread "main" java.lang.IllegalStateException: Could not initialize Service.[/b]
at org.codehaus.xfire.jaxws.ServiceDelegate.(ServiceDelegate.java:77)
at org.codehaus.xfire.jaxws.Provider.createServiceDelegate(Provider.java:32)
at javax.xml.ws.Service.(Service.java:56)
at com.demo.hw.server.Ibemain1.(Ibemain1.java:47)
at com.demo.hw.server.Ibemain_IbemainImplPort_Client.main(Ibemain_IbemainImplPort_Client.java:59)
[b]Caused by: java.lang.NoSuchMethodException: com.demo.hw.server.Ibemain1.getPortClassMap()[/b]
at java.lang.Class.getMethod(Class.java:1605)
at org.codehaus.xfire.jaxws.ServiceDelegate.(ServiceDelegate.java:60)
... 4 more

[b]问题补充:[/b]

[color=red]1. wsdl有的,我用cxf当下客户端来,编译了一下,可以运行,没有报错。

2.测试成功后,我把这些包移到了myeclipse下(我的是7.1),我只修改了一下包名。之后运行了一下,就出现了上面我贴的错误,在百度,谷歌里也没找到答案。

3.我们项目里之前有人加了一个webservice的。[/color][size=large][/size]

[b]问题补充:[/b]

[color=red][size=large]这个 Ibemain1.getPortClassMap() 方法所在的类继承了Service类,
在这个类中,有几个方法调用了父类的构造方法, 我个人觉得可能是Service.在没有初始化成功的情况下,导致了没找到.getPortClassMap() 方法。为什么会出现
“[b]Exception in thread "main" java.lang.IllegalStateException: Could not initialize Service[/b]”我很迷惑~[/size][/color]

[b]问题补充:[/b]
wsdl地址 : http://123.234.20.38:8081/ibeserver/ws/first?wsdl
[b]问题补充:[/b]

[color=red]补充了一个方法,还是包这个错:
Exception in thread "main" java.lang.IllegalStateException: Could not initialize Service. [/color][size=large][/size]

[b]问题补充:[/b]
我觉得我已经找到问题愿原因了,我们项目中原有一个webServices的客户端,以前的那哥们是用xfrie来处理的,重新在myeclipse下建了一个项目后,能运行上面的两个错误都消失了。这里说明xfire有问题!以后使用这个要注意,最好不要用~!

最后,谢谢 andilyliao 兄,消耗了你这莫多的时间~!谢谢诶·

  • 写回答

5条回答 默认 最新

  • andilyliao 2009-12-24 15:28
    关注

    你先用断点跟踪一下 看看是不是到了调用这个getPortClassMap() 方法时报错了吧

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?