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

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #21  
Old 08-21-2010, 10:48 AM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Default Mireth

Hi there,


Sorry for the delay on my awnser,

But I've attachedwith the place of the files on mirth.

The null constructor is not appearing at the moment after start the mirth channel I've always got the error.

Thanks in advanced.
Attached Images
File Type: jpg mirth.JPG (40.6 KB, 31 views)
Reply With Quote
  #22  
Old 08-21-2010, 12:13 PM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Default Thanks once again Brad

Hi Brad,


I've got a problem running the code you posted on eclipse.

I attached a screenshot to see it.

I've been googling around since then and I hear that could be missing the function main .

for example:

public static void main(String[] args)

{

}




Is it possible ?


I could test in another development software.

What you sugest ?
Attached Images
File Type: jpg mirth2.JPG (23.3 KB, 18 views)
Reply With Quote
  #23  
Old 08-23-2010, 09:15 AM
bradd bradd is offline
Mirth Employee
 
Join Date: May 2009
Location: Irvine, CA
Posts: 133
bradd is on a distinguished road
Default

The code I posted was not meant to be run in eclipse, but it is callable from a jar. But yes, if you want to run it you will need a main method like the one you posted. This is not necessary for running the jar.
Reply With Quote
  #24  
Old 08-25-2010, 10:12 AM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Default One more thing Bradd

Hi there,


What software are you using to develop.

I would like to replicate your enviroment to mine just to check this situation.

Is it possible ?

Thanks
Reply With Quote
  #25  
Old 08-25-2010, 10:21 AM
metropath metropath is offline
OBX.3 Kenobi
 
Join Date: Jan 2010
Posts: 139
metropath is on a distinguished road
Default

Quote:
Originally Posted by Dr. L View Post
Hi there,


What software are you using to develop.

I would like to replicate your enviroment to mine just to check this situation.

Is it possible ?

Thanks
I'm pretty sure they all use Eclipse to develop. I was on the last developer call and that is what they told me. You can download the normal "Java Developer" edition and have their environment. Hope that helps.
__________________
Jimmy
- Denver, Colorado
Reply With Quote
  #26  
Old 08-25-2010, 11:13 AM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Default metropath

Hi there,

I would like to know where I'm a missing.
Reply With Quote
  #27  
Old 08-25-2010, 11:20 AM
bradd bradd is offline
Mirth Employee
 
Join Date: May 2009
Location: Irvine, CA
Posts: 133
bradd is on a distinguished road
Default

if you *really* want your program to run in eclipse(which isn't necessary) all you have to do is add a main method. Below is the modified source code:

Code:
public class qr {

    public qr(){
        
    }
    
    public String execute(){
        return "works";
    }
    
    public static void main (String[] args){
        qr q = new qr();
        System.out.println(q.execute());
    }
}
Reply With Quote
  #28  
Old 08-27-2010, 04:02 AM
Dr. L Dr. L is offline
OBX.1 Kenobi
 
Join Date: Aug 2010
Posts: 38
Dr. L is on a distinguished road
Default Bradd

Hi bradd

I've tried the steps has indicated in the second page of these posts and the result was:

ERROR-301: Transformer conversion error
ERROR MESSAGE: Error adapting message
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(U nknown Source)
at com.webreach.mirth.server.mule.adaptors.XMLAdaptor .populateMessage(XMLAdaptor.java:28)
at com.webreach.mirth.server.mule.adaptors.Adaptor.ge tMessage(Adaptor.java:52)
at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:316)
at org.mule.transformers.AbstractEventAwareTransforme r.doTransform(AbstractEventAwareTransformer.java:4 8)
at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:83)
at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:493)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)
at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:231)
at com.webreach.mirth.connectors.js.JavaScriptMessage Receiver.processMessage(JavaScriptMessageReceiver. java:109)
at com.webreach.mirth.connectors.js.JavaScriptMessage Receiver.poll(JavaScriptMessageReceiver.java:90)
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)


Althoug I have got the word "works" but with error is that what you want me to test ?

Is this normal or not ?

I have attached one screenshot of error when channel are running and the detailed error on the beginning.


Thanks in advanced.


Version Mirth Connect Administrator 1.8.2.4472
Attached Images
File Type: jpg Sem título.JPG (52.4 KB, 17 views)
Reply With Quote
  #29  
Old 08-27-2010, 10:18 AM
bradd bradd is offline
Mirth Employee
 
Join Date: May 2009
Location: Irvine, CA
Posts: 133
bradd is on a distinguished road
Default

ah, look at that, it works. It's throwing that error because you probably aren't passing a message after using the jar. Anyways use this example and build on it and you will be fine.
Reply With Quote
  #30  
Old 09-08-2010, 06:09 AM
benyssen benyssen is offline
OBX.1 Kenobi
 
Join Date: Sep 2010
Posts: 38
benyssen is on a distinguished road
Default

hi,

Here is my Error :

ERROR-300: Transformer error
ERROR MESSAGE: Error evaluating transformer
com.webreach.mirth.server.MirthJavascriptTransform erException:
CHANNEL: RemoteNotification-RX
CONNECTOR: Testing
SCRIPT SOURCE:
SOURCE CODE:
9:
10: var idrecord = msg['cud_objets_id'].toString();
11: var numobj = msg['cud_objets_numobj'].toString();
12: var cud = msg['cud_objets_cud'].toString();
13: var trt = msg['cud_objets_fgtrt'].toString();
14: var MyCls = new Packages.testmirthws.Main();
15: MyCls.DoTest(idrecord,numobj);
16: var t = MyCls.getT();
17:
18: }
LINE NUMBER: 14
DETAILS: TypeError: [JavaPackage testmirthws.Main] is not a function, it is object.


I made a java class with Netbeans IDE 6.5.1 using this post.

Here is java code :

package testmirthws;

public class Main {

private static TestingWS t = new TestingWS();

public static void main(String[] args) {
System.out.println("HELLO");
}

public static TestingWS getT() {
return t;
}

public static void setT(TestingWS aT) {
t = aT;
}

public void DoTest(String a, String b) {
System.out.println("Welcome to 'DoTest'");
t.setCode(a);
t.setCodeType(b);
}

}

Any idea ?
I need some help.
Thanx
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 08:52 AM.


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