i am working on a new flow in mule 3 where i am using java component to connect to a unix server and fire some queries from server.
The Java code is working as expected But if i place the same code inside java component in mule i am getting the below mentioned error:
org.mule.model.resolvers.EntryPointNotFoundException: Failed to find entry point for component, the following resolvers tried but failed: [
MethodHeaderPropertyEntryPointResolver: The required property "method" is not set on the event
CallableEntryPointResolver: Object "connectionpkg.Connection@1deb78e1" does not implement required interface "interface org.mule.api.lifecycle.Callable"
AnnotatedEntryPointResolver: Component: connectionpkg.Connection@1deb78e1 doesn't have any annotated methods, skipping.
ReflectionEntryPointResolver: Could not find entry point on: "connectionpkg.Connection" with arguments: "{}"
]. Component that caused exception is: DefaultJavaComponent{newconFlow.component.1397643446}.
Attaching the mule code for reference.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="7007" doc:name="HTTP Listener Configuration"/>
<flow name="newconFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/conn" allowedMethods="get" doc:name="HTTP"/>
<component doc:name="Java" class="connectionpkg.Connection"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>
</mule>
The Java source code is:
package connectionpkg;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
public class Connection {
public static void main(String[] arg) {
try {
JSch jsch = new JSch();
String user = "xxxx";
String host = "xxxxx";
int port = 22;
String privateKey = "xxxxxxxx";
jsch.addIdentity(privateKey);
System.out.println("identity added ");
Session session = jsch.getSession(user, host, port);
System.out.println("session created.");
// disabling StrictHostKeyChecking may help to make connection but makes it insecure
// see http://stackoverflow.com/questions/30178936/jsch-sftp-security-with-session-setconfigstricthostkeychecking-no
//
// java.util.Properties config = new java.util.Properties();
// config.put("StrictHostKeyChecking", "no");
// session.setConfig(config);
session.connect();
System.out.println("session connected.....");
Channel channel = session.openChannel("sftp");
channel.setInputStream(System.in);
channel.setOutputStream(System.out);
channel.connect();
System.out.println("shell channel connected....");
ChannelSftp c = (ChannelSftp) channel;
String fileName = "test.txt";
c.put(fileName, "./in/");
c.exit();
System.out.println("done");
} catch (Exception e) {
System.err.println(e);
}
}
}
Appreciate someone will Look into it and help to resolve the issue.
Thanks, Nikhil