iteye_8326 2009-04-08 18:30
浏览 241
已采纳

用xfixe开发webservice服务端,发布到weblogic9.1 控制台报错

而发布到tomcat5.5可以的 (已上网查资料三天)
这个问题已困扰我三天了。
开发环境:myeclipse6.0.1(用向导XFire1.2 Core Libraries+spring-1.2.6jar)+jdk1.5+weblogic9.1(自带jdk1.5) 工程lib下已加了webservices.jar和weblogic.jar
其中:http://localhost:7001/myJms/services/myJms?wsdl可以看到WSDL格式

weblogic(已破解)我建的domains是jms

附件里是我做的myJms项目,暂时只做了webserice服务端的. myEclipse里->file->new-> web service project 项目名称为myJms,再在这个项目上的src右键->new others->web services->单选 web service(服务端)->next->Create web service from Java bean...同时勾选上Create new Java bean->next->Web service name 我写的myJms 在Java Package 我New的包是cn.com.hgeagle.rescue.ws->finish

[img]/upload/attachment/92394/18c013a6-3f11-3618-b855-bf1c4842463f.jpg[/img]

自动生成的java代码是
package cn.com.hgeagle.rescue.ws;
public class myJmsImpl implements ImyJms {
public String example(String message) {
return message;
}

}

package cn.com.hgeagle.rescue.ws;
public interface ImyJms {
public String example(String message);
}
在WebRoot/WEB-INF文件夹下的web.xml代码是:
<?xml version="1.0" encoding="UTF-8"?>

<!-- -->

contextConfigLocation

  classpath:org/codehaus/xfire/spring/xfire.xml,/WEB-INF/applicationContext.xml


<!-- -->


org.springframework.web.context.ContextLoaderListener  



XFireServlet
org.codehaus.xfire.transport.http.XFireConfigurableServlet
0


XFireServlet
/services/*


index.jsp

在WebServices文件夹下 services.xml为
<?xml version="1.0" encoding="UTF-8"?>


myJms
cn.com.hgeagle.rescue.ws.ImyJms

cn.com.hgeagle.rescue.ws.myJmsImpl

wrapped
literal
application

[img]/upload/attachment/92236/b0faf548-b7fd-3aa6-8556-876e9220b042.jpg[/img]

发布到weblogic9.1控制台报错:
信息: JDK 1.4+ collections available
2009-4-8 16:41:22 org.springframework.context.support.AbstractApplicationContext initMessageSource
Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@200309]

参考了网上的资料,在web-inf下又建了ApplicationContext.xml
内容是:

messages

同时,在web.xml里加上了(在servlet前):

contextConfigLocation

  classpath:org/codehaus/xfire/spring/xfire.xml,/WEB-INF/applicationContext.xml




org.springframework.web.context.ContextLoaderListener  

再启动weblogic 又报错:
<Could not load user defined listener: org.springframework.web.context.ContextLoaderListener  
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
那我是否要再写监听程序呀?请给个思路!

附件里的图片是发布到weblogic9上,启动weblogic9控制台的错误信息
[b]问题补充:[/b]
to bohemia (架构师) Spring jar包不在lib下吧?:
new web service project 时,myeclipse就自动将XFire1.2 Core Libraries加上去了,包括spring-1.2.6.jar包
[b]问题补充:[/b]
我将web-xml里的

contextConfigLocation

  classpath:org/codehaus/xfire/spring/xfire.xml,/WEB-INF/applicationContext.xml

<listener>
    <listener-class>
        org.springframework.web.context.ContextLoaderListener  
    </listener-class> 
</listener>

注释掉,就报下面的错:(当时,就因为这个原因,我才加上了这些代码)
2009-4-9 9:44:15 org.springframework.context.support.AbstractApplicationContext initMessageSource
信息: Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@200309]
[b]问题补充:[/b]
同样的是这个项目,发布到tomcat5.5,控制台正常。
我是用XFire的Servlet发布WS的,我是参照了myeclipse 里的Help->MyEclipse learning Center->Web SErvices Development->Getting Started->Code-First Web Services Tutorial,也大量地在网上找了很多资料
[b]问题补充:[/b]
我控制台没有报这个错:java.lang.ClassNotFoundException 另外:我用weblogic自带的JDK1.5.04和我自己的JDK1.5.05,效果都是一样的
[b]问题补充:[/b]
我是用myEclipse部署的weblogic9.
我在WEB-INF下的webligic.xml的内容:
<?xml version="1.0" encoding="UTF-8"?>




org.apache.xerces.jaxp.SAXParserFactoryImpl


org.apache.xerces.jaxp.DocumentBuilderFactoryImpl


org.apache.xalan.processor.TransformerFactoryImpl




webapp.encoding.default
UTF-8


javax.jws.*
org.apache.xerces.*
org.apache.xalan.*

[b]问题补充:[/b]
已修改weblogic.xml:
<?xml version="1.0" encoding="UTF-8"?>

wls:context-rootGBBDXServer/wls:context-root
wls:container-descriptor
wls:prefer-web-inf-classestrue/wls:prefer-web-inf-classes/wls:container-descriptor
/wls:weblogic-web-app
控制台仍报错:
2009-4-9 10:18:59 org.springframework.context.support.AbstractApplicationContext refresh
信息: No beans defined in application context [org.codehaus.xfire.transport.http.XFireConfigurableServlet$GenericWebApplicationContextX;hashCode=10111907]
2009-4-9 10:18:59 org.springframework.core.CollectionFactory
信息: JDK 1.4+ collections available
2009-4-9 10:18:59 org.springframework.context.support.AbstractApplicationContext initMessageSource
信息: Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@1b8378f]
2009-4-9 10:18:59 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster

其中:不同的是我用的是weblogic9.1的,而XFire的FAQ上用是weblogic9.0的,另外:wls:context-rootGBBDXServer/wls:context-root里的GBBDXServer是否要改为我自己的myJms呀??
[b]问题补充:[/b]
仍然报错:
Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@38e9e9]

估计还是和Spring文件有关,可是我没有用Spring 只是用XFire 它有自带的spring1.2.6.jar
[b]问题补充:[/b]
服务是发布成功了,可控制台报错,因为我还有其它的业务要做,如对数据库表的操作,现在就报错了,下面的工作,我就不好做了
[b]问题补充:[/b]
因为项目工期紧,暂时放到tomcat5下去运行,有时间我还是要发布到weblogic9.1上的,还是要解决这个问题的
[b]问题补充:[/b]
to: andilyliao
weblogic下的servlet改到2.4以上
请教如何修改?
我的path: E:\bea\weblogic91\server
还是E:\bea\user_projects\domains\jms\config?
还是我项目下的weblogic.xml里?
[b]问题补充:[/b]
虽然没有解决问题,但还是非常感激 bohemia

  • 写回答

7条回答

  • bohemia 2009-04-09 10:01
    关注

    另外XFire的FAQ看看.
    weblogic.xml的配置是否已经启用等等; 别用MyEclipse部署,直接在WLS上部署;

    true

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

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?