Call a Java Class from a Tcl proc

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Call a Java Class from a Tcl proc

  • Creator
    Topic
  • #52071
    Aurelien Garros
    Participant

      Hello,

      I’m trying to call a java class from a TPS proc used in an UPOC read context like this :

      Code:

      set dispList [cljTPS {MODE $mode} {CONTEXT $ctx} {MSGID NULL} {ARGS {{CLASS testJava}}}]

      But this error occurs :

      Code:

      [pd  :pdtd:ERR /0:       conn_3:10/25/2010 15:49:01] Tcl error:
                    msgId    = none
                    proc       = ‘test’
                    args       = ”
                    result     = ‘java.lang.NullPointerException’
                    errorInfo: ‘
      java.lang.NullPointerException
                    at com.quovadx.cloverleaf.upoc.CloverEnv.processTPS(CloverEnv.java:1268)
         invoked from within
      “processTPS “$instanceMap($__userArgs) $context $mode $mh””
         (procedure “cljTPS” line 41)
         invoked from within
      “cljTPS {MODE $mode} {CONTEXT $ctx} {MSGID NULL} {ARGS {{CLASS testJava}}}”
         (”time” arm line 6)
         invoked from within
      “switch -exact — $mode {
             start {
                 # Perform special init functions
                 # N.B.: there may or may not be a MSGID key in args
      …”
         (procedure “test” line 16)
         invoked from within
      “test {CONTEXT pdupoc_read} {ARGS {}} {MODE time} {VERSION 3.0}”‘

      Does anybody have any idea how to call my java class ?

      Many thanks,

      Aurelien

    Viewing 1 reply thread
    • Author
      Replies
      • #72946
        garry r fisher
        Participant

          Hi Aurelien,

          This isn’t something I’ve ever tried but why are you using mixed code? Can’t you either write it all in Java or in Tcl?

          Regards

          Garry

        • #72947
          Aurelien Garros
          Participant

            Hi Garry,

            It was to call java class in a “if” condition but you’re right I can make this directly in my java class. Good idea.

            Thanks,

            Aurelien

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.