Skip to main content
Known Participant
October 26, 2011
Question

CFOBJECT/class accessing issues

  • October 26, 2011
  • 2 replies
  • 2244 views

Hello,

  1. Recently I have upgraded from CFMX 7.0 to CF 9.0 and having problems or issues accessing a class file output where I am getting a "blank"
    value. It is same code which is working with CF 7.0. I have registered the class file in CF 9.0 and re-started.
  2. In the java class, I am connecting to Cognos to get the data/report. And the report is returned as a string value.
  3. The code MyReportView.getDetails(sItemNumber); is returning a blank value, but it is still working with CF 7.0
  4. Have tried running the class/method using the command prompt and getting the correct output on the 64 bit machine with CF 9.0
  5. Any suggestions related to CF 9.0 or Cognos or anything related to CBOBJECT changes in CF 9.0 would be really helpful.


Here is my code

<cftry>

                <cfobject action=create type=java class="RList" name=MyReportView>

                                <cfscript>

                                                myRpt = MyReportView.getDetails(sItemNumber);

                                </cfscript>

               

                                <cfoutput>#myRpt#</cfoutput>

                               

                <cfcatch type = "any">

                                <cfset pErrorDetail = CFCATCH.Detail>

                                <cfset pErrorMessage = CFCATCH.Message>

                                <cfoutput>#pErrorDetail# , #pErrorMessage#</cfoutput>

                </cfcatch>

</cftry>

Other details

Java Virtual Machine Path : C:/ColdFusion9/runtime/jre
CF 9.0/64 bit

Cognos 8.3 sp5

Window 2008/64 bit

Thanks in advance.

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    October 29, 2011

    Tpaul wrote:


    Here is my code

    <cftry>

                    <cfobject action=create type=java class="RList" name=MyReportView>

                                    <cfscript>

                                                    myRpt = MyReportView.getDetails(sItemNumber);

                                    </cfscript>

                   

                                    <cfoutput>#myRpt#</cfoutput>

                                   

                    <cfcatch type = "any">

                                    <cfset pErrorDetail = CFCATCH.Detail>

                                    <cfset pErrorMessage = CFCATCH.Message>

                                    <cfoutput>#pErrorDetail# , #pErrorMessage#</cfoutput>

                    </cfcatch>

    </cftry>

    This might not mean much, but it does no harm to rule it out. Introduce quotes for the attributes, thus:

    <cfobject action="create" type="java" class="RList" name="MyReportView">

    Inspiring
    October 26, 2011

    Have you looked at:

    1) JavaCast-ing sItemNumber

    2) Checking to make sure the profile that CF is running as on your box has the correct permissions?  Try logging on as the CF user.

    3) Perform a dump of the catch block instead of just outputing Detail/Message and see if that gives you any additional details.

    TpaulAuthor
    Known Participant
    October 27, 2011

    Thanks for the reply.

    1. I have tried JavaCast for my varibale and same result (blank page)

    2. Local System Account radio button has been checked in for CF 7.0 and CF 9.0

    3. Have dumped the catch block, no errors but just a blank page.


    Not sure what else to verify at this point.

    Thanks

    Inspiring
    October 27, 2011

    My only other suggestion that might be helpful is to check the following:

    1) Make sure your classpath settings in the CF administrator include the correct directory/location of your java files.  If your directory structure differs between servers, this could be a problem.

    2) Make sure your local system account has access to execute the java class (e.g. write a test class outside of CF just to test to make sure your java is working)

    3) Are there any DSN's or other resources that need to be configured on the CF9 server in order for the Java object or Cognos system to work that might be missing?

    Does your code include any other formatting that would appear on the screen?  i.e. when you say you are getting a blank page back do you mean that NO content is being sent to the browser from the page or that there was no content to begin with outside of the output from your method call? Sometimes a CF error 500 can cause a blank screen in certain circumstances, however, no catch block dump seems to indicate that there is no error coming back, its just that your method call is returning a null or empty value. 

    My suspicion is still on account access permissions for the resources involved - however, I don't have any specific suggestions on how to troubleshoot that aside from diving into the system account/folder permissions.