Announcement

Collapse
No announcement yet.

Building Mirth in Netbeans Mini-HowTo?

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

  • Building Mirth in Netbeans Mini-HowTo?

    Hi All!

    I've been doing a lot of playing around with Mirth and I like it a lot! I'm slowly getting the hang of things by using the available examples and modifying them to try different things. Unfortunately I find myself wanting to step through some of the code to see how various components work, or at least run Mirth in a more or less controlled way from a development GUI like Netbeans. I've seen some of the message board traffic discussing stuff like this but I haven't found enough detail on getting Mirth into Netbeans in order to successfully compile it (the client). I also realize all you folks are busy with development, etc. and apologize in advance if my questions (below) are a bit basic. Anyhoo, here goes ...

    I've downloaded the 1.4.0 source tree from https://www.mirthproject.org/svn. I've used Netbeans 5.5 to do some java development so I'm generally familiar with the environment (although I've never attempted to grab and load an existing large app into the thing). If I wanted to create a new Netbeans project to examine, compile, and run the Mirth GUI (client) exactly what pieces parts of the source tree do I need? Do I need both "trunk/client" and "tags/1.40/client"? In Netbeans, do I create a General project with existing source or an Enterprise project with existing source? When asked for the source do I include both the trunk and tags, or just the trunk?

    Better yet, does someone have a list of the steps required to get the Mirth GUI (or server for that matter) into Netbeans?
    Any guidance or pointers in the right direction would be greatly appreciated!!!!

    Thanks in advance!!!!!!

    Bob D.
    Bob Dilworth
    University of Toledo Medical Center
    Toledo, Ohio

  • #2
    Re: Building Mirth in Netbeans Mini-HowTo?

    Bob,

    One of the engineers on the client will reply back shortly, but just to steer you in the right direction:

    1. You will just need trunk/client
    2. You will also need mirth-client-core.jar from the distribution. Add this to your project classpath
    3. You will create a general project with existing source and include just the trunk.

    Hope this helps!
    -Chris
    Chris Lang

    Comment


    • #3
      Re: Building Mirth in Netbeans Mini-HowTo?

      Bob,

      1. Make 2 new Java projects in Netbeans. Let's call the first one Client and the second one Server.
      2. Check out the trunk from the SVN repository for the client into the base directory for the Client project.
      3. Check out the trunk from the SVN repository for the server into the base directory for the Server project.
      4. Modify build.bat int he Server directory so that it corresponds to your folders.
      5. Run build.bat
      6. Now open your Client project in Netbeans. Add all the .jar files in the lib directory of the Client folder to the libraries for that project.
      7. You should now be able to build the client.
      8. To build the server, follow the same steps for adding the files from the lib directory to the projects libraries.

      I only use Netbeans to make modifications to form components in the Client. Other than that, I would recommend using Eclipse as its debugging features are muchhhhhh better.

      -Brendan
      Brendan Haverlock | Mirth Software Engineer | Mirth Corporation

      Comment


      • #4
        Re: Building Mirth in Netbeans Mini-HowTo?

        Cool! Thanks so much for the info. I'll give it a shot & see what happens.

        Bob D.
        Bob Dilworth
        University of Toledo Medical Center
        Toledo, Ohio

        Comment


        • #5
          Re: Building Mirth in Netbeans Mini-HowTo?

          Hi Again!

          I'm having trouble building Mirth from the svn acquired source. Here's what's happening ...

          1. I downloaded https://www.mirthproject.org/svn/trunk/client to c:\mirthclient

          2. I downloaded https://www.mirthproject.org/svn/trunk/server to c:\mirthserver

          3. I modified c:\mirthserver\build.bat-template to:
          set SERVER_PATH="c:\mirthserver"
          set CLIENT_PATH="c:\mirthclient"
          set VERSION=1.4.0
          cd %SERVER_PATH%
          call ant create-client-core
          copy %SERVER_PATH%\mirth-client-core.jar %CLIENT_PATH%\lib\
          cd %CLIENT_PATH%
          call ant -buildfile ant-build.xml create-client
          copy %CLIENT_PATH%\dist\mirth-client.jar %SERVER_PATH%\webapp\lib\
          copy %SERVER_PATH%\mirth-client-core.jar %SERVER_PATH%\webapp\lib\
          copy %CLIENT_PATH%\lib\*.jar %SERVER_PATH%\webapp\lib\
          cd %SERVER_PATH%
          call ant create-setup -Dversion=%VERSION%
          pause

          4. I'm using javac for Java jdk1.5.0_06. The compiler is in my PATH. When I run build.bat I receive hundreds of java compiler errors. Here's a representative sample (not all inclusive):

          C:\mirthserver>set SERVER_PATH="c:\mirthserver"

          C:\mirthserver>set CLIENT_PATH="c:\mirthclient"

          C:\mirthserver>set VERSION=1.4.0

          C:\mirthserver>cd "c:\mirthserver"

          C:\mirthserver>call ant create-client-core
          Buildfile: build.xml

          init:
          [echo] Version: ${version}

          clean:
          [delete] Deleting directory C:\mirthserver\logs
          [mkdir] Created dir: C:\mirthserver\logs
          [delete] Deleting directory C:\mirthserver\classes

          compile:
          [mkdir] Created dir: C:\mirthserver\classes
          [javac] Compiling 340 source files to C:\mirthserver\classes
          [javac] C:\mirthserver\src\com\webreach\mirth\client\core\ Client.java:135: <identifier> expected
          [javac] public synchronized List<Channel> getChannel(Channel channel) throws ClientException {
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\client\core\ Client.java:528: &#039;;&#039; expected
          [javac] }
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\client\core\ Error.java:92: &#039;(&#039; or &#039;[&#039; expected
          [javac] List<NameValuePair> list = new ArrayList<NameValuePair>();
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\client\core\ MessageListHandler.java:80: <identifier> expected
          [javac] public List<MessageObject> getAllPages() throws ListHandlerException {
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\client\core\ MessageListHandler.java:128: &#039;;&#039; expected
          [javac] }
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\model\Alert. java:14: <identifier> expected
          [javac] private List<String> channels;
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\model\Alert. java:15: <identifier> expected
          [javac] private List<String> emails;

          ...

          [javac] C:\mirthserver\src\com\webreach\mirth\model\x12\Co mpositeType.java:47: illegal character: \64
          [javac] @XmlAccessorType(XmlAccessType.FIELD)
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\model\x12\Co mpositeType.java:48: illegal character: \64
          [javac] @XmlType(name = "CompositeType", propOrder = {
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\model\x12\Co mpositeType.java:58: illegal character: \64
          [javac] @XmlElement(name = "data_ele", required = true)
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\model\x12\Co mpositeType.java:59: illegal character: \64
          [javac] @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\model\x12\Co mpositeType.java:59: <identifier> expected
          [javac] @XmlJavaTypeAdapter(NormalizedStringAdapter.class)
          [javac] ^
          [javac] C:\mirthserver\src\com\webreach\mirth\model\x12\Co mpositeType.java:59: <identifier> expected
          [javac] @XmlJavaTypeAdapter(NormalizedStringAdapter.class)

          ...

          I seem to be missing a component or missing some step in the process. Any thoughts would be greatly appreciated!

          Bob D.
          Bob Dilworth
          University of Toledo Medical Center
          Toledo, Ohio

          Comment


          • #6
            Re: Building Mirth in Netbeans Mini-HowTo?

            Are you sure you&#039;re usging javac 1.5 ?

            What version of ant are you using ?

            Comment


            • #7
              Re: Building Mirth in Netbeans Mini-HowTo?

              Double checking I find that I&#039;m using javac under jdk 1.5.0_06 and ant version 1.6.5. To obtain this info I put a "javac -version" and an "ant -version" at the top of build.bat followed by a pause, then ran build.

              Bob D.
              Bob Dilworth
              University of Toledo Medical Center
              Toledo, Ohio

              Comment


              • #8
                Re: Building Mirth in Netbeans Mini-HowTo?

                Those errors are strange because it seems to have a problem with every line where a generic is being used, which would normally signify that you aren&#039;t using JDK 1.5.
                Brendan Haverlock | Mirth Software Engineer | Mirth Corporation

                Comment


                • #9
                  Re: Building Mirth in Netbeans Mini-HowTo?

                  Is it possible that he has an old JDK kicking around on his system that is conflicting? Maybe a PATH variable that isn&#039;t set?
                  Jon Bartels

                  Zen is hiring!!!!
                  http://consultzen.com/careers/
                  Talented healthcare IT professionals wanted. Engineers to sales to management.
                  Good benefits, great working environment, genuinely interesting work.

                  Comment


                  • #10
                    Re: Building Mirth in Netbeans Mini-HowTo?

                    Here&#039;s my PATH:

                    H:\>echo %PATH%
                    C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WIN DOWS\System32\Wbem;C:\WINDOWS\
                    system32\nls;C:\WINDOWS\system32\nls\english;C:\Pr ogram Files\Symantec\pcAnywher
                    e\;C:\eGate\client\bin;C:\Program Files\MySQL\MySQL Server 4.1\bin;C:\Program Fi
                    les\Common Files\GTK\2.0\bin;C:\Program Files\QuickTime\QTSystem\;C:\Sun\AppServ
                    er\bin;C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Program
                    Files\TextPad 4;C:\apache-ant-1.6.5\bin;C:\Program Files\Java\jdk1.5.0_06\bin;C:
                    \Sun\AppServer\bin;C:\maven-2.0.4\bin;W:.;X:.;Y:.

                    I do indeed have a couple of older JDKs on the system but shouldn&#039;t the above PATH point to jdk1.5.0_06?
                    Bob Dilworth
                    University of Toledo Medical Center
                    Toledo, Ohio

                    Comment


                    • #11
                      Re: Building Mirth in Netbeans Mini-HowTo?

                      Interesting...it should be pointing to the JDK 1.5. Is there another system you could try building Mirth on to try to rule out the system as the cause of the errors?
                      Brendan Haverlock | Mirth Software Engineer | Mirth Corporation

                      Comment


                      • #12
                        Re: Building Mirth in Netbeans Mini-HowTo?

                        Oddly enough, (or maybe not) it appears that I can indeed build the Mirth client within Netbeans itself if I specifically point it (Netbeans) to the correct java distro. There&#039;s obviously something amiss with my XP machine insofar as using the "correct" java compiler from the command line - or at least from Mirth&#039;s build.bat. My guess is there&#039;s some hosed up registry setting.

                        Ayway - thank you very much to all who responded!!!!!! You guys do a GREAT job responding to these questions!

                        Bob D.
                        Bob Dilworth
                        University of Toledo Medical Center
                        Toledo, Ohio

                        Comment


                        • #13
                          Can you tell me where I can get mirth-client-core.jar ?

                          Comment

                          Working...
                          X