web stats
Mirth Community - View Single Post - How to make channel to run jar files
View Single Post
  #20  
Old 08-20-2010, 11:25 AM
bradd bradd is offline
Mirth Employee
 
Join Date: May 2009
Location: Irvine, CA
Posts: 133
bradd is on a distinguished road
Default

the null constructor isn't an issue.

ANYWAYS, this process works for me. Your situation is much more complicated, but try this simple hello world jar to get started.

1. create new java project in eclipse
2. use this code:
Code:
public class qr {

	public qr(){
		
	}
	
	public String execute(){
		return "works";
	}
}
3. export to jar in eclipse
4. take jar and put it in the custom-lib folder in mirth
5. restart Mirth Service
6. Create a simple Channel
7. XML input, XML output, javascript reader, channel writer(I would attach my channel but it's in Mirth 2.0)
8. use this code in the javascript reader:

Code:
var object = new Packages.qr();
logger.error(object.execute());

return "<xml><a>a</a></xml>";
9. Deploy channel

Result: A log out of "works";

This works. Take this example as a starting point and modify it for your own needs. If you are still stuck consider purchasing Mirth support with channel support, they will walk you through every step.
-Brad
Reply With Quote