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条)

报告相同问题?

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值