Announcement

Collapse
No announcement yet.

Code completion with loaded Java Libraries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Code completion with loaded Java Libraries

    Is there anyway to have the code completion dialog show for custom java libraries? If not, does anyone have any suggestions on how make using java libraries easier? The only thing I could think of was to create code templates with the same signature as the java classes. I'd appreciate any advise

  • #2
    Technically yes, the Administrator client will search for any JARs on the classpath ending in "userutil-sources.jar", and automatically parse through the Java source files within to add them to the auto-completion dialog. Note that JARs on the client-side should be signed with a proper CA cert.
    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.

    Comment


    • #3
      I'm sorry, This might be a dumb question, But would that mean recompiling my jar files after specifying the classpath to be userutil-sources.jar? I've never dealt with Classpaths so my understanding is limited.

      Comment


      • #4
        How to sign the jar?

        Hello,
        I tried to add my jar to the code completion but unfortunately it didnĀ“t work.
        I tried following steps:
        1. Compiled my jar file new
        2. Renamed it to "myJar_userutil-source.jar"
        3. Signed it with a self created certificate (Maybe this is the problem? )
        4. Copied the file to ...\Mirth Connect\client-lib
        5. Stopped and restarted Mirth Service and load the Administrator new from the Server Manager

        When the Administrator starts I get an error:
        JAR - Ressourcen in JNLP-File are not signed by same certificate

        Does this error occurs because of my self signed certificate?
        Or do I have another problem?
        Thanks

        Comment


        • #5
          Hi,
          I know this is old but I was trying to have my java custom classes directly loaded into mirth in able to use them.
          But in order to have more and more classes I would like to have auto-completion dialog available.
          It's difficult to remember the names of the classes everytime I'm writing code.
          I start with only one jar file and already sign it with self signed CA.
          I was able to run Administrator Launcher and it accepted self signed certificate.
          I used Eclipse to export the jar file with the option Export Java source files and resources enable.
          Could see the classes inside the jar file with

          C:\Users\aremote>jar -tvf "C:\Program Files (x86)\Mirth Connect\client-lib\psl_func_userutil-sources.jar"
          579 Wed Aug 05 11:28:26 BST 2020 META-INF/MANIFEST.MF
          785 Wed Aug 05 11:28:26 BST 2020 META-INF/PTFUNC.SF
          1416 Wed Aug 05 11:28:26 BST 2020 META-INF/PTFUNC.RSA
          301 Mon Aug 03 15:24:40 BST 2020 .classpath
          390 Mon Aug 03 15:24:40 BST 2020 .project
          887 Tue Aug 04 16:43:56 BST 2020 pt/mymirthpackage/Class1.class
          301 Tue Aug 04 13:06:10 BST 2020 pt/mymirthpackage/Class1.java
          727 Tue Aug 04 16:46:54 BST 2020 pt/siemens/Class2.class
          310 Tue Aug 04 16:46:54 BST 2020 pt/siemens/Class2.java

          Could see that is correctly signed
          C:\Users\aremote>jarsigner -verify "C:\Program Files (x86)\Mirth Connect\custom-lib\psl_func_userutil-sources.jar" -verbose -keystore "C:\Program Files (x86)\Java\jre1.8.0_202\lib\security\cacerts"

          s k 579 Wed Aug 05 11:28:26 BST 2020 META-INF/MANIFEST.MF
          785 Wed Aug 05 11:28:26 BST 2020 META-INF/PTFUNC.SF
          1416 Wed Aug 05 11:28:26 BST 2020 META-INF/PTFUNC.RSA
          smk 301 Mon Aug 03 15:24:40 BST 2020 .classpath
          smk 390 Mon Aug 03 15:24:40 BST 2020 .project
          smk 887 Tue Aug 04 16:43:56 BST 2020 pt/mymirthpackage/Class1.class
          smk 301 Tue Aug 04 13:06:10 BST 2020 pt/mymirthpackage/Class1.java
          smk 727 Tue Aug 04 16:46:54 BST 2020 pt/siemens/Class2.class
          smk 310 Tue Aug 04 16:46:54 BST 2020 pt/siemens/Class2.java

          s = signature was verified
          m = entry is listed in manifest
          k = at least one certificate was found in keystore
          i = at least one certificate was found in identity scope

          - Signed by "CN=CN Field, OU=SIE, O=O Field, L=Lisbon, ST=Lisbon, C=PT"
          Digest algorithm: SHA-256
          Signature algorithm: SHA256withRSA, 2048-bit key

          jar verified.


          Do I need the certificate to be on C:\Program Files (x86)\Mirth Connect\appdata\keystore.jks

          Any idea what doing wrong?

          Best regards and thanks in advance
          Ricardo

          Comment


          • #6
            ricardojrgf I've never actually done this before, but I believe the certificate needs to be in the default truststore used by the jvm on the machine running the admin client.

            Comment

            Working...
            X