web stats
How to make channel to run jar files - Page 2 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #11  
Old 08-19-2010, 08:27 AM
bradd bradd is offline
Mirth Employee
 
Join Date: May 2009
Location: Irvine, CA
Posts: 133
bradd is on a distinguished road
Default

What I do is:

1. right click on the project folder
2. hit export
3. use all of the defaults but choose a destination(of course).
4. hit finish

Try the above steps. I have attached a screenshot of my export settings. In this case my project was "called hello world".

-Brad
Attached Images
File Type: jpg test_jar.jpg (39.1 KB, 38 views)
Reply With Quote
  #12  
Old 08-19-2010, 08:58 AM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Default Hi man thanks

Hi Once again thanks,


Is the mirth channel ok or do you have any comment with that ?

I've tried to put it to run but gets me the error once again.

I feel that i'm near what I intented to do.

So in last effort could you please help me (once more)

Thanks
Reply With Quote
  #13  
Old 08-19-2010, 09:22 AM
bradd bradd is offline
Mirth Employee
 
Join Date: May 2009
Location: Irvine, CA
Posts: 133
bradd is on a distinguished road
Default

is the error coming from eclipse or mirth? and can you post it again

Also, your channel looks fine

Last edited by bradd; 08-19-2010 at 09:26 AM.
Reply With Quote
  #14  
Old 08-19-2010, 10:56 AM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Smile Thanks Bradd

Hi there

With the code that you have posted we have an error on mirth.

On eclipse we have a slightly problem saying that

started with null constructor

Posted on eclipse post images (image1.jpg at bottom).

I think we solved that, then we exported like you said.

And then the problem remains on mirth. (posted screenshots on lastpost of the first page).

Did I understood well your question or isn't done anything like this ?

Thanks once agian.
Reply With Quote
  #15  
Old 08-19-2010, 11:58 AM
bradd bradd is offline
Mirth Employee
 
Join Date: May 2009
Location: Irvine, CA
Posts: 133
bradd is on a distinguished road
Default

your problem with Mirth is that the javascript reader needs to return the message. So if the input is xml you need to do a

return "<xml>data</xml>";

I'm not sure what you will need to do if the input is DICOM, it gets a bit tricky. I'm not sure what you are trying to do with DICOM messages so I can't advise you on what to do next.
Reply With Quote
  #16  
Old 08-19-2010, 11:59 AM
Mireth Mireth is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 27
Mireth is on a distinguished road
Default jar problem

Hi there,

As for your null constructor problem, hopefully you solved it, but if not you should just get rid of it. I'm 99% sure classes don't always have to have constructors.

As to your channel problem, in my channel which references a java program I used the class name as well in the object declaration. Try this:

var object = new Packages.qr.qr();
object.execute;


Hope that works. Also just so we are clear, does your program run as expected if you run it in eclipse? Thanks for the info.

-Mireth
Reply With Quote
  #17  
Old 08-20-2010, 01:04 AM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Default Thanks Mireth

Hi Thanks for the help


But I have made that expirience on mrth channel.


var object = new Packages.qr.qr();
object.execute;



Althout and in the response of your last line .

On eclipse the program is runnable and executing like is programmed, althout it does not work on mirth.

Errors


[2010-08-18 13:11:03,890] FATAL (org.mule.impl.DefaultComponentExceptionStrategy:8 4): The error is: null
java.lang.NullPointerException
at com.webreach.mirth.connectors.js.JavaScriptMessage Receiver.poll(JavaScriptMessageReceiver.java:88)
at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:90)
at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
at java.lang.Thread.run(Unknown Source)

[2010-08-18 13:09:08,875] FATAL (org.mule.impl.DefaultComponentExceptionStrategy:8 3): The Default Component Exception Strategy has been invoked but there is no current event on the context


[2010-08-18 13:11:23,906] ERROR (com.webreach.mirth.connectors.js.JavaScriptMessag eReceiver:152): org.mozilla.javascript.EcmaError: TypeError: [JavaPackage testefinal] is not a function, it is object. (cd8d54a5-375b-4f02-9951-88025c3fd4d2#3)
Edit/Delete Message


Could it be something wrong with configuration on channel ?
Reply With Quote
  #18  
Old 08-20-2010, 05:32 AM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Default Brad

Hi there .


What is intented to do with mirth channel and the jar file is to do a query and retrive with dcm4chee tool.

dcmqr -L DCM4CHEE:11113 mil@192.168.100.2:104 -cmove DCM4CHEE -qPatientID=123456 -cstoredest c:\test

So this is the purpose for the batch file that not run.

Any help Brad ?
Reply With Quote
  #19  
Old 08-20-2010, 07:39 AM
Mireth Mireth is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 27
Mireth is on a distinguished road
Default

The only thing I can think of you haven't posted a screen of is the placement of your jar file. If you are getting a null pointer exception maybe it can't find your jar file. Are you sure you have it in the correct folder? The "Mirth/lib/custom" one?

Also, if you haven't already done it, try getting rid of your null constructor. Maybe the program runs through eclipse which clearly notices the null constructor, but when you call the method through Mirth it hangs. Let me know how it goes.

Last edited by Mireth; 08-20-2010 at 07:47 AM.
Reply With Quote
  #20  
Old 08-20-2010, 10: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
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation