我刚刚在Maven中将我的项目Mule依赖项从3.3.0更新到3.5.0。这段代码在3.3.0中有效,但现在我收到了错误。
我正在尝试从测试类中运行MuleServer Java包装器。
import org.junit.Test;
import org.mule.MuleServer;
import org.mule.util.ClassUtils;
import java.io.IOException;
import org.mule.tck.junit4.AbstractMuleTestCase;
public class RunMuleTest extends AbstractMuleTestCase
{
@Test
public void testMuleServer() throws Exception
{
MuleServer muleServer = new MuleServer(); // defaults to use "mule-config.xml"
muleServer.run(false, false);
}
}
我使用以下Maven依赖项:
<dependency>
<groupId>com.mulesoft.muleesb</groupId>
<artifactId>mule-core-ee</artifactId>
<version>3.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mulesoft.muleesb.modules</groupId>
<artifactId>mule-module-client-ee</artifactId>
<version>3.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mule.tests</groupId>
<artifactId>mule-tests-functional</artifactId>
<version>3.5.0-bighorn</version>
<scope>test</scope>
</dependency>
<!-- plus a few others like spring, json, etc-->
我也有我的&#34; mule-config.xml&#34;在&#34; src / main / app&#34;。
当我运行代码时,我收到以下错误:
java.lang.NoClassDefFoundError: org/mule/api/config/DomainMuleContextAwareConfigurationBuilder
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.mule.util.ClassUtils$7.run(ClassUtils.java:250)
at org.mule.util.ClassUtils$7.run(ClassUtils.java:244)
at java.security.AccessController.doPrivileged(Native Method)
at org.mule.util.ClassUtils.loadClass(ClassUtils.java:243)
at org.mule.util.ClassUtils.loadClass(ClassUtils.java:212)
at org.mule.util.ClassUtils.isClassOnPath(ClassUtils.java:690)
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:84)
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:52)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:47)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:73)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:84)
at org.mule.MuleServer.initialize(MuleServer.java:383)
at com.teracyte.mule.test.RunMuleTest.testMuleServer(RunMuleTest.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: java.lang.ClassNotFoundException: org.mule.api.config.DomainMuleContextAwareConfigurationBuilder
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 28 more
目前还不清楚再次运行会失去什么。
需要修改哪些想法才能再次使用?