camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ishwar <panjariish...@gmail.com>
Subject Re: how to call java method using quartz2
Date Fri, 25 Oct 2013 12:09:37 GMT
after reading i implemented following code.

public class Schedule {
		 
	
	public static String SayService(String msg) {
		System.out.println(msg);
		return (msg);
	}

	public static void main(String args[])throws Exception
	{
		JndiContext context1 = new JndiContext();
		context1.bind("bye", SayService("Good Bye!"));
		
		
		CamelContext context = new DefaultCamelContext(context1);
		context.addRoutes(new RouteBuilder() {
		    public void configure() {
		    	
		    
from("quartz2://myGroup/myTimerName?cron=0+0/3+12-18+?+*+MON-FRI").to("bean:bye");
		    			    	
		    }
		});
		context.start();
		Thread.sleep(100000000);
		System.out.println("last line");
		
	}
	
}

but i am getting this exception

SEVERE: Failed delivery for (MessageId: ID-Snefopc1-52758-1382702844080-0-1
on ExchangeId: ID-Snefopc1-52758-1382702844080-0-2). Exhausted after
delivery attempt: 1 caught:
org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
method invocations possible: [public static java.lang.String
java.lang.String.valueOf(java.lang.Object), public static java.lang.String
java.lang.String.valueOf(boolean), public static java.lang.String
java.lang.String.valueOf(float), public static java.lang.String
java.lang.String.valueOf(double), public static java.lang.String
java.lang.String.valueOf(int), public static java.lang.String
java.lang.String.valueOf(char), public static java.lang.String
java.lang.String.valueOf(long), public static java.lang.String
java.lang.String.valueOf(char[],int,int), public static java.lang.String
java.lang.String.valueOf(char[]), public int
java.lang.String.indexOf(int,int), public int java.lang.String.indexOf(int),
public int java.lang.String.indexOf(java.lang.String,int), public int
java.lang.String.indexOf(java.lang.String), public int
java.lang.String.compareTo(java.lang.String), public boolean
java.lang.String.equalsIgnoreCase(java.lang.String), public boolean
java.lang.String.contentEquals(java.lang.StringBuffer), public boolean
java.lang.String.contentEquals(java.lang.CharSequence), public int
java.lang.String.compareToIgnoreCase(java.lang.String), public int
java.lang.String.codePointCount(int,int), public int
java.lang.String.codePointBefore(int), public int
java.lang.String.offsetByCodePoints(int,int), public boolean
java.lang.String.regionMatches(int,java.lang.String,int,int), public boolean
java.lang.String.regionMatches(boolean,int,java.lang.String,int,int), public
char java.lang.String.charAt(int), public java.lang.String
java.lang.String.concat(java.lang.String), public void
java.lang.String.getChars(int,int,char[],int), public static
java.lang.String
java.lang.String.format(java.lang.String,java.lang.Object[]), public static
java.lang.String
java.lang.String.format(java.util.Locale,java.lang.String,java.lang.Object[]),
public int java.lang.String.lastIndexOf(int,int), public int
java.lang.String.lastIndexOf(int), public int
java.lang.String.lastIndexOf(java.lang.String,int), public int
java.lang.String.lastIndexOf(java.lang.String), public java.lang.String[]
java.lang.String.split(java.lang.String,int), public java.lang.String[]
java.lang.String.split(java.lang.String), public java.lang.CharSequence
java.lang.String.subSequence(int,int), public boolean
java.lang.String.contains(java.lang.CharSequence), public boolean
java.lang.String.startsWith(java.lang.String), public boolean
java.lang.String.startsWith(java.lang.String,int), public java.lang.String
java.lang.String.substring(int,int), public java.lang.String
java.lang.String.substring(int), public java.lang.String
java.lang.String.toLowerCase(java.util.Locale), public boolean
java.lang.String.matches(java.lang.String), public java.lang.String
java.lang.String.toUpperCase(java.util.Locale), public static
java.lang.String java.lang.String.copyValueOf(char[]), public static
java.lang.String java.lang.String.copyValueOf(char[],int,int), public
boolean java.lang.String.endsWith(java.lang.String), public int
java.lang.String.codePointAt(int), public byte[]
java.lang.String.getBytes(java.lang.String) throws
java.io.UnsupportedEncodingException, public void
java.lang.String.getBytes(int,int,byte[],int), public byte[]
java.lang.String.getBytes(java.nio.charset.Charset), public java.lang.String
java.lang.String.replace(java.lang.CharSequence,java.lang.CharSequence),
public java.lang.String java.lang.String.replace(char,char), public
java.lang.String
java.lang.String.replaceAll(java.lang.String,java.lang.String), public
java.lang.String
java.lang.String.replaceFirst(java.lang.String,java.lang.String)].
Exchange[Message: [Body is null]]



--
View this message in context: http://camel.465427.n5.nabble.com/how-to-call-java-method-using-quartz2-tp5742192p5742199.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message