用xfixe+myeclipse自动生成webservice 服务端 发布到weblogic9.1控制台报错,而发布到tomcat5.5可以的 (已上网查资料三天)

studying_ 2009-04-08 05:44:27
这个问题已搞了我三天了,已在网上相关的资料。
开发环境: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服务端的.


发布到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
内容是:
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"><value>messages</value></property>
</bean>

同时,在web.xml里加上了(在servlet前):
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
  classpath:org/codehaus/xfire/spring/xfire.xml,/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener  
</listener-class>
</listener>

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

附件里的图片是发布到weblogic9上,启动weblogic9控制台的错误信息
...全文
1087 19 打赏 收藏 转发到动态 举报
写回复
用AI写文章
19 条回复
切换为时间正序
请发表友善的回复…
发表回复
ggxboy1986 2010-09-08
  • 打赏
  • 举报
回复
学习·····
FAT0708 2009-04-14
  • 打赏
  • 举报
回复
这还真没见过
FAT0708 2009-04-13
  • 打赏
  • 举报
回复
把这个文件(weblogic.xml)放在WEB-INF下面,重新发布。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app
PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"
"http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd" >
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
studying_ 2009-04-13
  • 打赏
  • 举报
回复
早就加上去啦,不起作用的
午夜听雨 2009-04-10
  • 打赏
  • 举报
回复
是不是jar包冲突了。。。。。。
studying_ 2009-04-09
  • 打赏
  • 举报
回复
applicationContext.xml
加了<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"> <value>messages </value> </property>
</bean>
同时web.xml加了:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
  classpath:org/codehaus/xfire/spring/xfire.xml,/WEB-INF/applicationContext.xml
</param-value>
</context-param>

<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener  
</listener-class>
</listener>
又报错:
<Error> <HTTP> <BEA-101163> <Could not load user defined listener: org.springframework.web.context.ContextLoaderListener  
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
dracularking 2009-04-09
  • 打赏
  • 举报
回复
加了messageSource的bean还报Unable to locate MessageSource with name 'messageSource': using default ?
studying_ 2009-04-09
  • 打赏
  • 举报
回复
我也觉得使用XFire也不用spring吧 ContextLoaderListener等不需要,可是就报错 org.springframework.context.support.AbstractApplicationContext initMessageSource
信息: Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@200309]

我觉得也不需要ApplicationContext.xml,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC
"-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"><value>messages</value></property>
</bean>-->
</beans>
网上说要加上这个文件
studying_ 2009-04-09
  • 打赏
  • 举报
回复
我将web-xml里的
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
  classpath:org/codehaus/xfire/spring/xfire.xml,/WEB-INF/applicationContext.xml
</param-value>
</context-param>

<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]

同样的是这个项目,发布到tomcat5.5,控制台正常。
我是用XFire的Servlet发布WS的,我是参照了myeclipse 里的Help->MyEclipse learning Center->Web SErvices Development->Getting Started->Code-First Web Services Tutorial,也大量地在网上找了很多资料

另外:我用weblogic自带的JDK1.5.04和我自己的JDK1.5.05,效果都是一样的
dracularking 2009-04-09
  • 打赏
  • 举报
回复
用weblogic部署的吧 它的classpath未必就会由MyEclipse自动部署 有些是特殊部署方式 除非你对weblogic很熟悉 这种情况肯定是由于两种方式的差异性造成的 检查一下吧 看看为什么java.lang.ClassNotFoundException
还有就是使用XFire也不用spring吧 ContextLoaderListener等需要吗
studying_ 2009-04-09
  • 打赏
  • 举报
回复
weblogic不会有冲突的jar包吧,
因为工程lib下已加了webservices.jar和weblogic.jar ,而XFire1.2 Core Libraries库里没有weblogic相关的jar包
studying_ 2009-04-09
  • 打赏
  • 举报
回复
new web service project 时,myeclipse就自动将XFire1.2 Core Libraries加上去了,包括spring-1.2.6.jar包
ma_liang 2009-04-09
  • 打赏
  • 举报
回复
我认为最肯可能的原因是jar包冲突的问题,tomcat服务器和weblogic服务器的类加载机制是不同的,看一下你的应用里有没有和weblogic有冲突的jar包,通常把有冲突的jar包放到webloic启动脚本里的classpath的最前面。
studying_ 2009-04-09
  • 打赏
  • 举报
回复
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
自动生成的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"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
  classpath:org/codehaus/xfire/spring/xfire.xml,/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<!-- -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener  
</listener-class>
</listener>
<servlet>
<servlet-name>XFireServlet</servlet-name>
<servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>XFireServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>


在WebServices文件夹下 services.xml为
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>myJms</name>
<serviceClass>cn.com.hgeagle.rescue.ws.ImyJms</serviceClass>
<implementationClass>
cn.com.hgeagle.rescue.ws.myJmsImpl
</implementationClass>
<style>wrapped</style>
<use>literal</use>
<scope>application</scope>
</service></beans>


我发了一些这个问题的部分截图,可是看不到效果,所以我发布到javaeye论坛上了。
http://www.javaeye.com/problems/14477
studying_ 2009-04-09
  • 打赏
  • 举报
回复
我在E:\bea\user_projects\domains\jms\autodeploy\myJms\WEB-INF\lib下解压缩了spring-1.2.6.jar包,E:\bea\user_projects\domains\jms\autodeploy\myJms\WEB-INF\lib\spring-1.2.6\org\springframework\web\context有ContextLoaderListener.class类
dracularking 2009-04-09
  • 打赏
  • 举报
回复
我觉得还是ClassPath的问题 貌似核心的都是定位问题
看看这些类比如org.springframework.web.context.ContextLoaderListener 到底被部署在了哪里(拆包)
此处确定是weblogic的ClassPath中吗?
studying_ 2009-04-08
  • 打赏
  • 举报
回复
我怎么不能修改自己发的这个帖呀?因为我要描述清楚啊。

您没有权限执行这个操作
--------------------------------------------------------------------------------

studying_ 您好,请参考以下提示来解决您的问题。
您的权限无法使用此功能,请联系相关人员,获得使用此功能的权限,才可以使用。
如果您想换一个账号来使用本功能,请点击后面链接登录
studying_ 2009-04-08
  • 打赏
  • 举报
回复

该帖包含附件:http://d.download.csdn.net/down/1189034/studying_

我上传的附件怎么不见了?

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧