web stats
Using com.mirth.connect.client.core.Client - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2016, 02:20 PM
jonathanlent jonathanlent is offline
OBX.1 Kenobi
 
Join Date: Aug 2014
Location: Denton, TX
Posts: 41
jonathanlent is on a distinguished road
Default Using com.mirth.connect.client.core.Client

Right, so I'd prefer to not use the REST API from Groovy and would rather use the Client proxy class, if possible.

After including the client-lib directory contents in my path in IntelliJ, I run the following Groovy script against my local machine:

Code:
import com.mirth.connect.client.core.Client

def client = new Client("https://127.0.0.1:8443/")
println client.login("admin","admin")
client.close()
Yielding
Code:
Caught: com.mirth.connect.client.core.ClientException: com.mirth.connect.donkey.util.xstream.SerializerException: java.lang.IllegalAccessError: tried to access class org.mozilla.javascript.NativeDate from class com.mirth.connect.model.converters.JavaScriptObjectConverter
com.mirth.connect.client.core.ClientException: com.mirth.connect.donkey.util.xstream.SerializerException: java.lang.IllegalAccessError: tried to access class org.mozilla.javascript.NativeDate from class com.mirth.connect.model.converters.JavaScriptObjectConverter
	at com.mirth.connect.client.core.Client$2.invoke(Client.java:267)
	at com.sun.proxy.$Proxy22.login(Unknown Source)
	at com.mirth.connect.client.core.Client.login(Client.java:301)
	at com.mirth.connect.client.core.api.servlets.UserServletInterface$login.call(Unknown Source)
	at mirthclient.run(mirthclient.groovy:7)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Should I even be bothering with this Client class or am I missing something obvious in the environment setup? I can't imagine that this flat out does not work, so I must be missing something about the setup.

Thanks for any insight, folks!
Reply With Quote
  #2  
Old 08-25-2016, 02:27 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

That class is overridden in mirth-client-core.jar. Sounds like you have some classloader priority issues in your Groovy setup.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 04-07-2017, 10:36 AM
bcerny bcerny is offline
Mirth Newb
 
Join Date: Oct 2016
Posts: 8
bcerny is on a distinguished road
Default

Ran into the same problem.

The solution was to properly order the jars on the classpath. Mirth-client-core.jar needs to come before the rhino jar.

Which IDE are you using?
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 04:59 PM.


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