[mule-user] Unable to run Echo example from RAD

4 views
Skip to first unread message

sg...@aol.com

unread,
Jan 16, 2008, 5:50:19 PM1/16/08
to us...@mule.codehaus.org
New to Mule. Want to run Echo example of Mule in RAD.
Created a Java project (not J2EE) in RAD. Copied EchoComponent.java, EchoService.java in a package. Inside the same package in the same level, I have mule-config.xml and echo-config.xml - which are the same. In fact, echo-config.xml is copied into mule-config.xml (as I do not know if mule-config.xml is also necessary).

Have all jar files from lib and opt directory of Mule in classpath.
Using JDK 1.4 in RAD.

I wrote a Java client (main class) and inside the same package as other two Echo.. java classes.

Client code is:

import org.mule.MuleServer;
import org.mule.config.ConfigurationException;
import org.mule.config.builders.MuleXmlConfigurationBuilder;
import org.mule.extras.client.MuleClient;
import org.mule.umo.UMOMessage;
import org.mule.umo.manager.UMOManager;

public class TestClient {
 public static void main(String[] args) {  
  try {
   
   MuleServer server = new MuleServer("mule-config.xml, echo-config.xml");
   server.start(true);
   MuleClient client = new MuleClient();
   UMOMessage message2 = client.send("vm://echo", "Some more data", null);
  } catch (ConfigurationException e) {
   e.printStackTrace();
  }catch(Exception e){
   e.printStackTrace();
  }
  
 }
}

Get error in RAD console as:
log4j:ERROR Could not find value for key log4j.appender.stdout
log4j:ERROR Could not instantiate appender named "stdout".
log4j:WARN No appenders could be found for logger (org.mule.MuleServer).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.log4j.Logger: method isTraceEnabled()Z not found
at org.slf4j.impl.Log4jLoggerAdapter.isTraceEnabled(Log4jLoggerAdapter.java:81)
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.isTraceEnabled(SLF4JLocationAwareLog.java:61)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:849)
at org.mule.util.BeanUtils.populateWithoutFail(BeanUtils.java:65)
at org.mule.impl.model.ModelFactory.createModel(ModelFactory.java:55)
at org.mule.MuleManager.registerSystemModel(MuleManager.java:398)
at org.mule.MuleManager.getInstance(MuleManager.java:296)
at org.mule.extras.client.MuleClient.init(MuleClient.java:237)
at org.mule.extras.client.MuleClient.<init>(MuleClient.java:122)
at com.mypackage.TestClient.main(TestClient.java:32)


log4J.properties is as:
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=debug, stdout




 

More new features than ever. Check out the new AOL Mail!

Andrew Perepelytsya

unread,
Jan 16, 2008, 5:54:04 PM1/16/08
to us...@mule.codehaus.org
You have a jar conflict with libraries in your project. Ensure Mule's are coming first, including any bundled with Mule:


Exception in thread "main" java.lang.NoSuchMethodError : org.apache.log4j.Logger: method isTraceEnabled()Z not found

Andrew
Reply all
Reply to author
Forward
0 new messages