- 浏览: 59581 次
- 性别:
- 来自: 重庆
最新评论
-
network-eagle:
liukai 写道3.04后的版本用
<!-- Hand ...
spring3 mvc -
sadlonewolf:
LZ:我的xml文档怎么跑不通啊,一直报错unknown so ...
mule2.1.2 初步认识 发布cxf 和axis服务 -
liukai:
3.04后的版本用
<!-- Handles HTTP ...
spring3 mvc -
imi00:
overflowToDisk:
Sets whether el ...
hibernate 二级缓存 个人总结 -
SINCE1978:
慢慢来吧、相信付出终会得到回报、何况很多事情需要积累。博主还做 ...
有点迷茫,有点不如意!
最近公司需要写这样一个功能。也就是需要一个esb消息总线。初步的功能是提供webservice的消息管理以后还会增加很多的功能。。以前本来在soa esb上面的东西就是个空白。在Google上找了一天最后由我自己觉得用mule2.1.2。让后就疯狂的找些好的帖子。希望能够很快的入门。但发现不是那么一回事。找到的很多都是1.X的版本。2.1.2 的少得很。经过近半周的研究。。终于自己写了一个小的test。贴上来给新入门的朋友希望有帮助。深入的研究以后还会继续。
配置文件:mule_config.xml
一个简单的 接口 为了先跑同就这样把。
MuleService.java
MuleServiceImp.java
启动服务:
测试
这是怎么回事啊
我上面的结构就是原代码。没保留什么,还有 我是能跑通的。
@WebService
(@WebParam(name="str")
@WebParam和name都报错 怎么回事?要加什么包吗?
lz,你是要研究jms这块吗?我已经搞出来了 你可以问我,你可以把你的msn,qq号码发到javaeye的信箱里,我加你一下,告诉你怎么弄
配置文件:mule_config.xml
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesource.org/schema/mule/core/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.1" xmlns:cxf="http://www.mulesource.org/schema/mule/cxf/2.1" xmlns:axis="http://www.mulesource.org/schema/mule/axis/2.1" xmlns:smtps="http://www.mulesource.org/schema/mule/smtps/2.1" xmlns:http="http://www.mulesource.org/schema/mule/http/2.1" xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.1" xmlns:soap="http://www.mulesource.org/schema/mule/soap/2.1" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.mulesource.org/schema/mule/core/2.1 http://www.mulesource.org/schema/mule/core/2.1/mule.xsd http://www.mulesource.org/schema/mule/stdio/2.1 http://www.mulesource.org/schema/mule/stdio/2.1/mule-stdio.xsd http://www.mulesource.org/schema/mule/vm/2.1 http://www.mulesource.org/schema/mule/vm/2.1/mule-vm.xsd http://www.mulesource.org/schema/mule/cxf/2.1 http://www.mulesource.org/schema/mule/cxf/2.1/mule-cxf.xsd http://www.mulesource.org/schema/mule/axis/2.1 http://www.mulesource.org/schema/mule/axis/2.1/mule-axis.xsd http://www.mulesource.org/schema/mule/smtps/2.1 http://www.mulesource.org/schema/mule/smtps/2.1/mule-smtps.xsd http://www.mulesource.org/schema/mule/soap/2.1 http://www.mulesource.org/schema/mule/soap/2.1/mule-soap.xsd http://www.mulesource.org/schema/mule/http/2.1 http://www.mulesource.org/schema/mule/http/2.1/mule-http.xsd "> <description> eagleMule demo which shows how to publish web services over CXF. </description> <model name="eagleMule"> <service name="testMuleService"> <inbound> <axis:inbound-endpoint address="http://localhost:8899/services/testMuleService"> <soap:http-to-soap-request-transformer /> </axis:inbound-endpoint> <cxf:inbound-endpoint address="http://localhost:8898/services/testMuleService"> <soap:http-to-soap-request-transformer /> </cxf:inbound-endpoint> </inbound> <component class="com.eagle.mule.test.imp.MuleServiceImp"> </component> </service> </model> </mule>
一个简单的 接口 为了先跑同就这样把。
MuleService.java
@WebService public interface MuleService { public String testMule(@WebParam(name="str")String str); }
MuleServiceImp.java
@WebService(serviceName="eagleMuleService", endpointInterface="com.eagle.mule.test.MuleService") public class MuleServiceImp implements MuleService { public String testMule(String str) { System.out.println("----service---"); return "hello--"+str; } }
启动服务:
public class EagleMuleMain { public static void main(String[] args) throws ConfigurationException, InitialisationException { try { String configFile = "com/eagle/mule/test/mule_config.xml"; String[] configFileArr = new String[] { configFile }; MuleContextFactory muleContextFactory = new DefaultMuleContextFactory(); MuleContext context = muleContextFactory .createMuleContext(new SpringXmlConfigurationBuilder( configFileArr)); context.start(); } catch (MuleException t) { t.printStackTrace(); } } }
测试
package com.eagle.mule.test.clint; import java.io.IOException; import java.io.InputStream; import org.apache.commons.io.IOUtils; import org.mule.api.MuleException; import org.mule.api.MuleMessage; import org.mule.module.client.MuleClient; public class Client { public static void main(String[] args){ MuleClient client = null; try { client = new MuleClient(); String url = "axis:http://localhost:8899/services/testMuleService?wsdl&method=testMule"; MuleMessage message = client.send(url, "eagle", null); Object obj = message.getPayload(); System.out.println("--------------obj---------"+obj.getClass().getName()); if(obj instanceof String){ System.out.println("---------str--------------"+obj); } } catch (MuleException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally{ client.dispose(); } } } 注意 这里需要把mule 下lib中 endorsed mule opt 文件夹中的jar都加进去。如果不发布cxf的服务 可以不用添加endorsed文件夹中的jar。
评论
43 楼
sadlonewolf
2011-11-15
LZ:我的xml文档怎么跑不通啊,一直报错unknown source和Cannot find the declaration of element 'mule',帮我看一下吧。
42 楼
deadcow
2009-07-01
另外,写mule的test case。可以用上mule 的test package,里面有一个类似funtionalTest的class
41 楼
deadcow
2009-07-01
好像没有体现ESB,你的src code 不应该加上任何类似WS的tag,怎样把WS expose出来,是通过MULE的inbound
40 楼
caiway
2009-07-01
大家有把mule2集成到应用程序里去吗?照着官网把下面这段加入web.xml报错,应用在tomcat里面不能启动。
<context-param>
<param-name>org.mule.config</param-name>
<param-value>mule-config-main.xml,mule-components.xml</param-value>
</context-param>
<listener>
<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>
<context-param>
<param-name>org.mule.config</param-name>
<param-value>mule-config-main.xml,mule-components.xml</param-value>
</context-param>
<listener>
<listener-class>org.mule.config.builders.MuleXmlBuilderContextListener</listener-class>
</listener>
39 楼
rrsy23
2009-06-18
mule的例子可以看哈
你这个和mule的最简单的echo例子基本一样
你这个和mule的最简单的echo例子基本一样
38 楼
portrait
2009-05-30
burke 写道
String url = "cxf:http://localhost:8898/services/testMuleService?method=testMule";
这个报错
Could not create client! No Server was found directly on the endpoint: http://localhost:8898/services/testMuleService
这个报错
Could not create client! No Server was found directly on the endpoint: http://localhost:8898/services/testMuleService
这是怎么回事啊
37 楼
qhhhn
2009-05-14
刚好在学习ING...国内这一块的资料太少了...
36 楼
burke
2009-05-08
String url = "cxf:http://localhost:8898/services/testMuleService?method=testMule";
这个报错
Could not create client! No Server was found directly on the endpoint: http://localhost:8898/services/testMuleService
这个报错
Could not create client! No Server was found directly on the endpoint: http://localhost:8898/services/testMuleService
35 楼
hf3862
2009-04-30
我在运行您的例子时碰到这个错误:
Exception in thread "main" java.lang.IllegalStateException: Level number 10 is not recognized.
at org.slf4j.impl.JDK14LoggerAdapter.log(JDK14LoggerAdapter.java:529)
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:106)
at org.mule.util.IOUtils.getResourceAsUrl(IOUtils.java:154)
at org.mule.config.ConfigResource.<init>(ConfigResource.java:32)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.loadConfigResources(AbstractResourceConfigurationBuilder.java:90)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.<init>(AbstractResourceConfigurationBuilder.java:56)
at org.mule.config.spring.SpringXmlConfigurationBuilder.<init>(SpringXmlConfigurationBuilder.java:43)
at test.EagleMuleMain.main(EagleMuleMain.java:20)
也没有google到解决办法,请问是哪儿的问题?
xp/jdk1.5.0_18/eclipse3.4.2/mule2.1.2
Exception in thread "main" java.lang.IllegalStateException: Level number 10 is not recognized.
at org.slf4j.impl.JDK14LoggerAdapter.log(JDK14LoggerAdapter.java:529)
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:106)
at org.mule.util.IOUtils.getResourceAsUrl(IOUtils.java:154)
at org.mule.config.ConfigResource.<init>(ConfigResource.java:32)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.loadConfigResources(AbstractResourceConfigurationBuilder.java:90)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.<init>(AbstractResourceConfigurationBuilder.java:56)
at org.mule.config.spring.SpringXmlConfigurationBuilder.<init>(SpringXmlConfigurationBuilder.java:43)
at test.EagleMuleMain.main(EagleMuleMain.java:20)
也没有google到解决办法,请问是哪儿的问题?
xp/jdk1.5.0_18/eclipse3.4.2/mule2.1.2
34 楼
network-eagle
2009-04-22
zhunzhunzhun-sky 写道
能把源码分享下吗?
我上面的结构就是原代码。没保留什么,还有 我是能跑通的。
33 楼
zhunzhunzhun-sky
2009-03-31
能把源码分享下吗?
32 楼
network-eagle
2009-03-30
不好意思 各位朋友。由于很久没上,让大家久等了。不过我的程序是调试通过的。如果大家有问题。请检查自己的配置。也请提供出错的信息!谢谢!
31 楼
zhunzhunzhun-sky
2009-03-30
http://localhost:8899/services/testMuleService
这个服务没有
http://localhost:8898/services/testMuleService
这个服务无法创建客户端
这是怎么回事楼主?
这个服务没有
http://localhost:8898/services/testMuleService
这个服务无法创建客户端
这是怎么回事楼主?
30 楼
portrait
2009-03-18
<soap:http-to-soap-request-transformer />
这个标签撒意思?传soap消息 就要用这个标签吗?
这个标签撒意思?传soap消息 就要用这个标签吗?
29 楼
portrait
2009-03-04
楼上的用mule调web service调通了吗?
28 楼
gp_len
2009-03-02
我的问题已经解决,呵呵……
楼上的:
检查一下你的mule版本
mule-conifg.xml文件
还有那些所需的jar
楼上的:
检查一下你的mule版本
mule-conifg.xml文件
还有那些所需的jar
27 楼
zsb77585210
2009-03-02
[03-02 10:41:20] ERROR SpringXmlConfigurationBuilder [main]: Configuration with "org.mule.config.spring.SpringXmlConfigurationBuilder" failed.
org.mule.api.lifecycle.InitialisationException: Initialisation Failure: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at EagleMuleMain.main(EagleMuleMain.java:16)
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:72)
at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:78)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141)
at org.mule.config.spring.MuleBeanDefinitionDocumentReader.parseBeanDefinitions(MuleBeanDefinitionDocumentReader.java:45)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.mule.config.spring.MuleApplicationContext.loadBeanDefinitions(MuleApplicationContext.java:104)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
... 7 more
org.mule.api.config.ConfigurationException: Initialisation Failure: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml] (org.mule.api.lifecycle.InitialisationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at EagleMuleMain.main(EagleMuleMain.java:16)
Caused by: org.mule.api.lifecycle.InitialisationException: Initialisation Failure: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
... 4 more
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:72)
at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:78)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141)
at org.mule.config.spring.MuleBeanDefinitionDocumentReader.parseBeanDefinitions(MuleBeanDefinitionDocumentReader.java:45)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.mule.config.spring.MuleApplicationContext.loadBeanDefinitions(MuleApplicationContext.java:104)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
... 7 more
运行失败 请各位看看问题所在
org.mule.api.lifecycle.InitialisationException: Initialisation Failure: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at EagleMuleMain.main(EagleMuleMain.java:16)
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:72)
at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:78)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141)
at org.mule.config.spring.MuleBeanDefinitionDocumentReader.parseBeanDefinitions(MuleBeanDefinitionDocumentReader.java:45)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.mule.config.spring.MuleApplicationContext.loadBeanDefinitions(MuleApplicationContext.java:104)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
... 7 more
org.mule.api.config.ConfigurationException: Initialisation Failure: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml] (org.mule.api.lifecycle.InitialisationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:96)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:54)
at EagleMuleMain.main(EagleMuleMain.java:16)
Caused by: org.mule.api.lifecycle.InitialisationException: Initialisation Failure: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml]
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:76)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:98)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:69)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:39)
... 4 more
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate NamespaceHandler for namespace [http://www.mulesource.org/schema/mule/core/2.1]
Offending resource: URL [file:/D:/EclipseItem/MuleAppTest/bin/mule-config.xml]
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:72)
at org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate.parseCustomElement(MuleHierarchicalBeanDefinitionParserDelegate.java:78)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:141)
at org.mule.config.spring.MuleBeanDefinitionDocumentReader.parseBeanDefinitions(MuleBeanDefinitionDocumentReader.java:45)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.mule.config.spring.MuleApplicationContext.loadBeanDefinitions(MuleApplicationContext.java:104)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:87)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:68)
... 7 more
运行失败 请各位看看问题所在
26 楼
portrait
2009-02-24
问题已经解决
25 楼
portrait
2009-02-24
network-eagle 写道
最近公司需要写这样一个功能。也就是需要一个esb消息总线。初步的功能是提供webservice的消息管理以后还会增加很多的功能。。以前本来在soa esb上面的东西就是个空白。在Google上找了一天最后由我自己觉得用mule2.1.2。让后就疯狂的找些好的帖子。希望能够很快的入门。但发现不是那么一回事。找到的很多都是1.X的版本。2.1.2 的少得很。经过近半周的研究。。终于自己写了一个小的test。贴上来给新入门的朋友希望有帮助。深入的研究以后还会继续。
配置文件:mule_config.xml
一个简单的 接口 为了先跑同就这样把。
MuleService.java
MuleServiceImp.java
启动服务:
测试
配置文件:mule_config.xml
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesource.org/schema/mule/core/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesource.org/schema/mule/vm/2.1" xmlns:cxf="http://www.mulesource.org/schema/mule/cxf/2.1" xmlns:axis="http://www.mulesource.org/schema/mule/axis/2.1" xmlns:smtps="http://www.mulesource.org/schema/mule/smtps/2.1" xmlns:http="http://www.mulesource.org/schema/mule/http/2.1" xmlns:stdio="http://www.mulesource.org/schema/mule/stdio/2.1" xmlns:soap="http://www.mulesource.org/schema/mule/soap/2.1" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.mulesource.org/schema/mule/core/2.1 http://www.mulesource.org/schema/mule/core/2.1/mule.xsd http://www.mulesource.org/schema/mule/stdio/2.1 http://www.mulesource.org/schema/mule/stdio/2.1/mule-stdio.xsd http://www.mulesource.org/schema/mule/vm/2.1 http://www.mulesource.org/schema/mule/vm/2.1/mule-vm.xsd http://www.mulesource.org/schema/mule/cxf/2.1 http://www.mulesource.org/schema/mule/cxf/2.1/mule-cxf.xsd http://www.mulesource.org/schema/mule/axis/2.1 http://www.mulesource.org/schema/mule/axis/2.1/mule-axis.xsd http://www.mulesource.org/schema/mule/smtps/2.1 http://www.mulesource.org/schema/mule/smtps/2.1/mule-smtps.xsd http://www.mulesource.org/schema/mule/soap/2.1 http://www.mulesource.org/schema/mule/soap/2.1/mule-soap.xsd http://www.mulesource.org/schema/mule/http/2.1 http://www.mulesource.org/schema/mule/http/2.1/mule-http.xsd "> <description> eagleMule demo which shows how to publish web services over CXF. </description> <model name="eagleMule"> <service name="testMuleService"> <inbound> <axis:inbound-endpoint address="http://localhost:8899/services/testMuleService"> <soap:http-to-soap-request-transformer /> </axis:inbound-endpoint> <cxf:inbound-endpoint address="http://localhost:8898/services/testMuleService"> <soap:http-to-soap-request-transformer /> </cxf:inbound-endpoint> </inbound> <component class="com.eagle.mule.test.imp.MuleServiceImp"> </component> </service> </model> </mule>
一个简单的 接口 为了先跑同就这样把。
MuleService.java
@WebService public interface MuleService { public String testMule(@WebParam(name="str")String str); }
MuleServiceImp.java
@WebService(serviceName="eagleMuleService", endpointInterface="com.eagle.mule.test.MuleService") public class MuleServiceImp implements MuleService { public String testMule(String str) { System.out.println("----service---"); return "hello--"+str; } }
启动服务:
public class EagleMuleMain { public static void main(String[] args) throws ConfigurationException, InitialisationException { try { String configFile = "com/eagle/mule/test/mule_config.xml"; String[] configFileArr = new String[] { configFile }; MuleContextFactory muleContextFactory = new DefaultMuleContextFactory(); MuleContext context = muleContextFactory .createMuleContext(new SpringXmlConfigurationBuilder( configFileArr)); context.start(); } catch (MuleException t) { t.printStackTrace(); } } }
测试
package com.eagle.mule.test.clint; import java.io.IOException; import java.io.InputStream; import org.apache.commons.io.IOUtils; import org.mule.api.MuleException; import org.mule.api.MuleMessage; import org.mule.module.client.MuleClient; public class Client { public static void main(String[] args){ MuleClient client = null; try { client = new MuleClient(); String url = "axis:http://localhost:8899/services/testMuleService?wsdl&method=testMule"; MuleMessage message = client.send(url, "eagle", null); Object obj = message.getPayload(); System.out.println("--------------obj---------"+obj.getClass().getName()); if(obj instanceof String){ System.out.println("---------str--------------"+obj); } } catch (MuleException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally{ client.dispose(); } } } 注意 这里需要把mule 下lib中 endorsed mule opt 文件夹中的jar都加进去。如果不发布cxf的服务 可以不用添加endorsed文件夹中的jar。
@WebService
(@WebParam(name="str")
@WebParam和name都报错 怎么回事?要加什么包吗?
24 楼
portrait
2009-02-24
network-eagle 写道
希望对你有帮助就行。现在就是在基于消息这块还在继续研究中。也希望大家一起交流
lz,你是要研究jms这块吗?我已经搞出来了 你可以问我,你可以把你的msn,qq号码发到javaeye的信箱里,我加你一下,告诉你怎么弄
发表评论
-
hibernate 二级缓存 个人总结
2010-03-30 14:36 1222今天特地的回顾了一下hibernate 的二级缓存, 我平常用 ... -
用jacob实现定制模板的word 包括动态的table image 等
2009-07-08 10:58 2067首先说下我的环境 :jacob 1.14 , jdk ... -
cxf jaxws 用spring的bean
2009-06-02 11:36 2525cxf 发布一个server很简单 <jaxw ... -
Cxf 2.1 Spring 2.X 开发webservice
2008-06-05 15:06 1702相信大家用xfire开发webservice 很爽吧。最近看到 ...
相关推荐
在当今复杂的IT环境中,服务总线技术扮演着重要的角色,它能够有效地集成不同的应用程序和服务。本文将详细介绍如何利用Mule ESB(Enterprise Service Bus)作为代理来访问CXF发布的Web服务。 #### 建立CXF服务端 ...
在IT行业中,构建高效、可扩展的企业级应用是至关重要的,而Mule ESB(企业服务总线)和Apache CXF则是实现这一目标的两大关键工具。本文将深入探讨如何利用Mule服务总线代理Apache CXF服务源码,帮助开发者更好地...
总结来说,"实战Mule:利用Mule调用XFire发布的Web服务"涉及到的是企业级服务集成的核心技术,通过这种方式,可以有效地将不同系统和服务连接起来,形成一个无缝的数据交换网络,这对于现代企业的数字化转型和业务...
《实战Mule:利用Mule调用XFire发布的文件上传服务》 在现代企业级应用集成(EAI)中,Mule ESB(Enterprise Service Bus)作为一种强大的中间件,广泛用于构建灵活、可扩展的系统架构。而XFire是早期的Java Web...
Mule是一款非常流行的集成平台,用于构建连接应用程序、数据源和服务的集成解决方案。下面的内容将涵盖该版本中提及的重要概念、配置方法以及特定传输方式的使用。 ### Mule 2.2.1 用户指南概览 Mule 2.2.1用户...
在IT行业中,Mule ESB(企业服务总线)是一个流行的开源集成平台,它用于构建应用程序和服务之间的连接。本文将详细讲解如何使用Mule来发布和消费SOAP(Simple Object Access Protocol)Web服务,通过一个名为"hello...
"Mule开发环境搭建和部署" Mule是当前流行的企业服务总线(Enterprise Service Bus, ESB),它提供了一个灵活、可扩展、高性能的集成平台。构建Mule开发环境是Mule应用程序的基础,以下将对Mule开发环境的搭建和...
Mule ESB支持多种传输协议,如文件、FTP、UDP、TCP、SOAP、电子邮件、JMS等,并能够与Spring、ActiveMQ、CXF、Axis、Drools等流行开源项目无缝集成。此外,尽管Mule ESB并非基于JBI(Java Business Integration)...
mule in action 和doc文档详细介绍 Mule的核心组件是UMO(Universal Message Objects,从Mule2.0开始UMO这一概念已经被组件Componse所代替),UMO实现整合逻辑。UMO可以是POJO,JavaBean等等。它支持30多种传输协议...
- **定位**:Mule ESB 3.0是一款轻量级的消息框架和整合平台,旨在帮助企业轻松地集成不同的系统和服务。 - **核心特性**:基于EIP(Enterprise Integration Patterns)原则构建,支持多种传输协议(如file, FTP, ...
本文将对Mule3.4进行入门学习,涵盖Mule环境搭建、Webservice的发布、JMS消息通信、ftp、File应用、协议转换等知识点。 一、Mule环境搭建 Mule环境的搭建需要JDK的支持,包括下载、安装、配置JDK。首先,需要下载...
在这个示例中,我们将深入探讨如何使用Mule来发布Web服务,这是一种允许不同系统间交换数据的有效方式。 1. **Mule基础知识** Mule 是一个开源的企业级服务总线,它支持多种协议和数据格式,如HTTP、JMS、FTP等。...
Mule ESB 是一个轻量级的基于java的企业服务总线和集成平台, 使得开发人员可以快速,简单的连接多个应用, 使得它们可以交换数据。 Mule ESB 容易集成现有异构系统,包括:JMS, Web Services, JDBC, HTTP, 等. ESB...
它是一种中间件,旨在促进不同应用程序之间的数据交换,通过提供一个集成平台来连接各种系统、应用和服务。Mule ESB的核心优势在于其轻量级设计和高度可扩展性,使得它能够在不牺牲性能的情况下处理大量复杂集成任务...
浪曦航母战斗编队式企业级项目培训系列明细 JAVA,JSP/Servlet基础 Struts2 ...Mule Esb发布基于CXF,Axis的WebService, Extjs3.2与Html/css/js整合打造不规则九宫格效果 JBPM4.4开发销售工作流