Topic
6 replies Latest Post - ‏2014-04-21T08:44:59Z by Equal
Mauri_Claudio
Mauri_Claudio
10 Posts
ACCEPTED ANSWER

Pinned topic Data Studio, Java Stored procedures and external jar dependencies

‏2014-04-16T10:11:17Z |

Good Morning,

scenario: I'm using IBM Data Studio 4.1 and DB2 for Windows version 10.x .

I'm developing a Java Stored procedure in which i need to use an external jar which in turns exposes some utility classes I need.

Now while the stored procedure compiles ok in Data Studio, during deploying stage compiler complains that referenced classes cannot be found: indeed Data Studio calls javac compiler passing a classpath with starts with a '.' and other jars files, but no the one I added in build / external jar.

In previous version of Data Studio I was able to modify "compiler options" passing a classpath (with -classpath option) and that was enough. But with version 4.1 the classpath is overriden, so this workaround does not work... and I don't know where elsewhere i can specify which additional jars are required.

I really need your help...

Thanks in advance.

 

 

Updated on 2014-04-16T10:12:18Z at 2014-04-16T10:12:18Z by Mauri_Claudio
  • Equal
    Equal
    140 Posts
    ACCEPTED ANSWER

    Re: Data Studio, Java Stored procedures and external jar dependencies

    ‏2014-04-18T07:03:07Z  in response to Mauri_Claudio

    Hello,

    Thanks for your question. Are you using Data Studio 4.1 or 4.1.0.1? Which operation system are you on?

    I tested on 4.1 against Windows. It takes in the external jar in the class path. Could you please paste the error? Thanks!

    C:\Program Files\IBM\SQLLIB\java\jdk\bin\javac -classpath ".;C:\Program Files\IBM\SQLLIB\java\sqlj.zip";C:\Users\IBM_ADMIN\Desktop\test.jar;"C:\Program Files\IBM\SDPShared\plugins\com.ibm.datatools.db2_2.2.0.v20130515_2101\driver\db2jcc4.jar;C:\Program Files\IBM\SDPShared\plugins\com.ibm.datatools.db2_2.2.0.v20130515_2101\driver\db2jcc_license_cisuz.jar" com\Equal\Equal\testjar.java
    DB2ADMIN.TESTJAR - Javac completed.

    Equal

    • Mauri_Claudio
      Mauri_Claudio
      10 Posts
      ACCEPTED ANSWER

      Re: Data Studio, Java Stored procedures and external jar dependencies

      ‏2014-04-18T11:58:53Z  in response to Equal

      Thank you Equal for your answer.

      I'm working on a Windows 7 machine, with Data Studio 4.1.0.1.

      I've tried a lot of combinations.... first, I tried to deploy my java stored without giving any compiler option, just to see which classpath was used; then, I cut and pasted the Whole classpath resulting from the output, and no luck.

      At the end I've tried simply to pass -classpath C:\DataStudio\LibrerieLisa2\core.jar as parameter, and I get following error:

      JAVALIM.SPS_ELCIC - Deploy started.
      JAVALIM.SPS_ELCIC - Created temporary working directory C:\DataStudio\.metadata\.plugins\com.ibm.datatools.db2.routines.deploy.ui\bld1397822066550.
      "C:\Program Files\IBM\DS4.1.0.1\jdk\bin\javac" -classpath ".;C:\Program Files\IBM\SQLLIB\java\sqlj.zip";"C:\DataStudio\LibrerieLisa2\core.jar;C:\Program Files\IBM\SDPShared\plugins\com.ibm.datatools.db2_2.2.0.v20131115_1748\driver\db2jcc.jar;C:\Program Files\IBM\SDPShared\plugins\com.ibm.datatools.db2_2.2.0.v20131115_1748\driver\db2jcc_license_cisuz.jar" it\limontainformatica\luw\stored\SPS_ELCIC.java
      javac: flag non valido: ;
      Utilizzo: javac <options> <source files>
      utilizzare -help per un elenco di opzioni possibili
      JAVALIM.SPS_ELCIC - Removed temporary working directory C:\DataStudio\.metadata\.plugins\com.ibm.datatools.db2.routines.deploy.ui\bld1397822066550.

      I've tried with another JDK but same problem... I think that the issue is related to the fact that Data Studio wizard composes the classpath in a wrong way, indeed there's a semicolon misplaced:

      -classpath ".;C:\Program Files\IBM\SQLLIB\java\sqlj.zip";"C:\DataStudio\LibrerieLisa2

      With DS 3.1 this error doesn't occour.

      Thank you for your help.

      • Mauri_Claudio
        Mauri_Claudio
        10 Posts
        ACCEPTED ANSWER

        Re: Data Studio, Java Stored procedures and external jar dependencies

        ‏2014-04-18T12:01:33Z  in response to Mauri_Claudio

        I forget to say that following errors (reported by the compiler in Italian Language)

        javac: flag non valido: ;
        Utilizzo: javac <options> <source files>
        utilizzare -help per un elenco di opzioni possibili

        roughly translated in English are

        javac: invalid flag ;
        Usage: javac options source files
        use -help to list available options.

         

         

        • Equal
          Equal
          140 Posts
          ACCEPTED ANSWER

          Re: Data Studio, Java Stored procedures and external jar dependencies

          ‏2014-04-21T02:28:31Z  in response to Mauri_Claudio

          Hello,

          Thank you for your detail information. It's a defect of Data Stutio 4.1.0.1. If an immediate fix is required with regard to your situation, we need you to open a PMR. So that could send a patch to you. Or you could wait for the coming release in months. We're sorry for the inconvenience.

          Equal

          • Mauri_Claudio
            Mauri_Claudio
            10 Posts
            ACCEPTED ANSWER

            Re: Data Studio, Java Stored procedures and external jar dependencies

            ‏2014-04-21T08:33:51Z  in response to Equal

            Hi,

            thank you for your answer. Actually I don't think I can open a PMR since we're using DB2 + Data Studio not in a production enviroment, only for evaluation of a possible migration from Db2 for i (formerly: AS400) to a different platform: we didn't pay for support. I'm afraid that a PMR would be rejected, or that I'd not even be able to open it.

            I'll go on with previous version of DS, hoping that I'll not wait for a long time before next version will be released. Do you know if somehow I may file a bug ?

            Regards, and thank you again.

            • Equal
              Equal
              140 Posts
              ACCEPTED ANSWER

              Re: Data Studio, Java Stored procedures and external jar dependencies

              ‏2014-04-21T08:44:59Z  in response to Mauri_Claudio

              Hi,

              The bug is reported and tracked in our internal system. We're working on it. If you have any further problem, you are welcome to post it in this forum. Thanks!

              Equal