• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

vvmail mixed data type field population

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

  • vvmail mixed data type field population

    Hi,

    On upgrading from v3.2 to v4.0.20140515.0 we found that we could not compile programs where we had populated vvmail fields subject and body with a cat'ed combination of alpha and UCS2. Not a problem in itself but it was unexpected. After converting wholly to UCS2 and compiling, the programs error with;

    Cause . . . . . : RPG procedure VVMAIL_SEN in program VALENCEDEV/VVSRVPGM
    received Java exception "java.lang.NoClassDefFoundError: javax.mail.Session"
    when calling method "getDefaultInstance" with signature
    "(Ljava.util.Properties;)Ljavax.mail.Session;" in class
    "javax.mail.Session".

  • #2
    Yes, in Valence 4 we added UCS2 support to VVMAIL. Older RPG compilers, particularly V5R4, will require that you convert all elements to UCS2 when concatenating variables into a UCS2 string such as vvMail.body.

    Your error message suggests the Java Classpath is not being set properly inside your CGI job. In the Portal Admin app, Settings, please scroll down to the "IBM i Settings" section and verify you have a value in the "Java CLASSPATH setting" that includes "[ROOT_PATH]java/mail.jar". The default value for that setting is ".:[ROOT_PATH]java/iText-2.1.7.jar:[ROOT_PATH]java/documenttype.jar:[ROOT_PATH]java/activation.jar:[ROOT_PATH]java/mail.jar:[ROOT_PATH]java/MessageType.jar:".

    You should also verify that your ROOT_PATH is correct. The "Valence root path" setting is in the "Hidden Settings" section at the bottom. To see that section you must have the "Show hidden settings" checkbox ticked, which is in the "Portal Administration" section.

    Finally, verify you have a "mail.jar" file in the path indicated in the "java" folder inside your root path.

    If you're still having troubles, feel free to send an email to support.

    -Rob

    Comment


    • #3
      The program was called from the command line rather than the portal. The classpath was as you describe above except for the addition of

      [ROOT_PATH]java/cnxemail.jar:[ROOT_PATH]java/cnxpdf.jar

      on the end. Both mail.jar and cnxpdf.jar are present in the directory but not cnxemail.jar

      Comment


      • #4
        Oh, I didn't realize you were trying this interactively. I bet I know what the problem is...

        Go into WRKENVVAR and look at the CLASSPATH value. Do you see [ROOT_PATH] in there instead of something like /valence-4.0/? I suspect you do, since the constants used within VVUTILITY to search for open brackets and close brackets (OB and CB) will not have been initialized when VVMAIL is called outside the portal.

        To fix this I would recommend doing minor surgery to VVUTILITY. Go into the RPG source for VVUTILITY and page down to the "vvUtility_initJava..." line (statement number should be 3636.00). Right after the "/free" insert this line:

        vvOut_initialize();

        This will ensure the OB and CB constants are initialized.

        Save this change, compile the module (option 15), then update the Valence service program with the following command:

        UPDSRVPGM SRVPGM(VALENCE40/VVSRVPGM) MODULE(VALENCE40/VVUTILITY)

        (replace "VALENCE40" with the appropriate library name if necessary).

        Log out and back in again then see if it fixed your issue. If this works for you, let me know and we'll mirror the VVUTILITY adjustment on our end for the next build.

        -Rob

        Comment


        • #5
          UPDSRVPGM SRVPGM(VALENCE40/VVSRVPGM) MODULE(VALENCE40/VVUTILITY)

          gives;

          Cause . . . . . : Constituent module VVUTILITY originally from library
          VALENCE40 cannot be replaced by module VVUTILITY in library VALENCEDEV.
          Constituent module VVUTILITY is bound into SRVPGM VVSRVPGM in library
          VALENCEDEV and was created with storage model *SNGLVL. The replacement
          module was created with storage model *INHERIT. The storage model must be
          the same on the constituent and replacement modules.

          but;

          Option 15 (CRTSQLRPGI OBJTYPE(*MODULE)) has no Storage Model parameter.

          Comment


          • #6
            Sorry, for V5R4 you'll need to prompt the option 15 compile, hit F10, page down to the bottom and put STGMDL(*SNGLVL) in the COMPILEOPT parm.

            Comment


            • #7
              Ok the service program updated but unfortunately I still have the original error.

              I have requested a support call for

              http://cnxforum.com/showthread.php?1...-email-example

              maybe we should discuss this as well while we are at it?


              Also, we are on v7.1 this makes the mixed data issue a bit more prevalent.

              Comment


              • #8
                Very odd. We will send you an email shortly to set up a web meeting and sort this out.

                Comment

                Working...
                X