REDCap Survey Data Integration problem

Installation Forum (Inactive)
REDCap Survey Data Integration problem oskari timonen  2015-04-02 01:36
Status: Closed
 
Hi,

Trying to follow the documentation on REDCap Survey Data Integration ( https://www.labkey.org/wiki/home/Documentation/page.view?name=redCap ) without any success so far.

Confusion follows after steps creating netrc file.

- "Download the distribution file. Unzip the file."
1. Does this mean the "Binaries for Manual Linux/Unix/Mac Installation (tar.gz)", or the source?

- Execute the java main class org.labkey.redcap.RedcapExport, the program will accept these VM properties :"...
2. From binaries can't find such files. From source there's redcap folder /src/org/labkey/redcap/RedcapExport.java that I can't seem to compile.

Could someone help me out on this?
 
 
Brian Connolly responded:  2015-04-02 15:46
Hi Oskari,

I am sorry for the confusion in the documentation. We have updated the documentation to clarify it on how to acquire the REDCap command line tool distribution.

The REDCap command line tool is not part of the default distribution because it can take significant assistance to adapt it to a lab's workflows. Usually groups engage with LabKey Software to help them get their lab set up with this tool and extend its functionality. You’re still welcome to use the code without contracting with us.


You can build the module from source using a zip of the source available here: https://www.labkey.org/wiki/home/Documentation/page.view?name=sourceCode. Or by enlisting in the LabKey Server SVN: https://www.labkey.org/wiki/home/Documentation/page.view?name=svn

 
From your message it looks like you have downloaded the source code and were having trouble building the command line tool distribution file yourself. If you would like I can assist you in building the distribution or I can create a distribution file for you to download.

-Brian
 
oskari timonen responded:  2015-04-07 04:19
Hi Brian,

Thank you for your response.

I'd greatly appreciate if you could assist me in building the distribution.

- Oskari
 
Brian Connolly responded:  2015-04-07 11:04
Oskari,

FYI: Earlier this week, one of the developers here at LabKey was kind enough to create a compile the distribution file for the LabKey Server 15.1 release. The compiled distribution file is available at https://labkey.s3.amazonaws.com/downloads/general/r/15.1/LabKeyDevBuild-Redcap.zip


I would be happy to assist you. If you could provide me with more information on your development configuration and the errors that you received when attempting to perform the build.


A few other notes:
============================
- In our next release, v15.2, the command line tool will no longer be required.

- In 15.2, REDCap support will be fully integrated into LabKey Server. Configuration for the download of REDCap Survey data via the Manage tab in your Study.

- v15.2 will be released in July 2015.
 

Thank you,

Brian
 
oskari timonen responded:  2015-04-10 05:58
Brian,

Thank you for the compiled distribution file of the RedCap-tool.
Unfortunately I am not able to get it to work. I am trying to execute the .jar according to instructions.

We have a RedCap server running and I am able to connect to it's API with R.

I have tried the following (java version "1.8.0_40"):
> PS C:\Users\oskari\Desktop\LabKeyDevBuild-Redcap\LabKeyDevBuild-Redcap> java -classpath "lib/*;Redcap-DevBuild.jar" -DserverUrl="http://biodb.uef.fi/redcap/api/" -DprojectName="Test project Epilepsy" -DsubjectId="subject_id" -DexportLocation="c:/temp/export.zip" -DtimepointType="date" org.labkey.redcap.RedcapExport

 which gives the following error messages:

  INFO : Starting export
  Fri Apr 10 14:45:45 EEST 2015
  ERROR : URL, project name, subject ID field, and archive file name are not specified
  Fri Apr 10 14:45:45 EEST 2015
  ERROR : java.lang.IllegalArgumentException: URL, project name, subject ID field, and archive file name are not specified

        at org.labkey.redcap.RedcapConfiguration.getConfiguration(RedcapConfiguration.java:99)
        at org.labkey.redcap.RedcapExport.main(RedcapExport.java:100)


I also tried the same with config file:

  <?xml version="1.0" encoding="UTF-8"?>
          <redcapConfig xmlns="http://labkey.org/study/xml/redcapExport">
          <exportLocation>tempredcapArchive.zip</exportLocation>
          <timepointType>date</timepointType>
              <projects>
                    <project>
                      <projectName>Test project Epilepsy</projectName>
                      <serverUrl>http://biodb.uef.fi/redcap/api/</serverUrl>
                      <subjectId>subject_id</subjectId>
                  </project>
              </projects>
          </redcapConfig>

> java -classpath "lib/*;Redcap-DevBuild -DconfigFile="c:/temp/config.xml" org.labkey.redcap.RedcapExport

 which gives the following error messages:
 
  INFO : Starting export
  Fri Apr 10 15:39:06 EEST 2015
  INFO : Command Options
  archive path: C:\Users\oskari\Desktop\LabKeyDevBuild-Redcap\LabKeyDevBuild-Redcap\tempredcapArchive.zip
  timepoint type: DATE
  project name: Test project Epilepsy server URL : http://biodb.uef.fi/redcap/api/ subject ID : subject_id
        match subject ID by label : false

  Fri Apr 10 15:39:06 EEST 2015
  log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.SingleClientConnManager).
  log4j:WARN Please initialize the log4j system properly.
  ERROR : java.lang.NoClassDefFoundError: org/apache/tika/detect/Detector
          at org.labkey.api.reader.TabLoader.<clinit>(TabLoader.java:74)
          at org.labkey.redcap.RedcapCommandResponse.getLoader(RedcapCommandResponse.java:27)
          at org.labkey.redcap.RedcapExport.getDatasetMetadata(RedcapExport.java:231)
          at org.labkey.redcap.RedcapExport.exportProject(RedcapExport.java:126)
          at org.labkey.redcap.RedcapExport.main(RedcapExport.java:102)
  Caused by: java.lang.ClassNotFoundException: org.apache.tika.detect.Detector
          at java.net.URLClassLoader.findClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          ... 5 more


Could you help me out?

PS.

v15.2 sounds great!
 
Jon (LabKey DevOps) responded:  2015-04-21 16:43
Hi Ozkari,

We've uploaded a revised version of the RedCAP distribution here:

https://labkey.s3.amazonaws.com/downloads/general/r/15.1/LabKeyDevBuild-Redcap-15.1.zip

Can you give this one a try?

Regards,

Jon
 
oskari timonen responded:  2015-04-22 03:12
Hi Jon,

Thank you! This works.

I get couple of warnings, besides that I am able to import the RedCap export zip to Labkey.

Warnings:
  log4j:WARN No appenders could be found for logger (org.apache.ht
  log4j:WARN Please initialize the log4j system properly.

Thanks again! Regards,
Oskari
 
Jon (LabKey DevOps) responded:  2015-04-22 10:52
Hi Osarki,

Great! Regarding those warnings, it looks like the log4j logger wasn't initialized. It's not detrimental, but in case you want to have those warning messages cleared, you can change how it gets initialized. This is a common thing with Apache:

http://stackoverflow.com/questions/1140358/how-to-initialize-log4j-properly

Regards,

Jon