daust / JasperReportsIntegration

JasperReportsIntegration provides an interface to use the JasperReports reporting engine in an Oracle database application, specifically with Oracle Application Express (Oracle APEX).
BSD 3-Clause "New" or "Revised" License
56 stars 25 forks source link

Error on Package UTL_HTTP on @user_install.sql #112

Closed ocv1269 closed 2 years ago

ocv1269 commented 2 years ago

When Im install Jasperreports Integration 28.1 on Oracle 12c and APEX 22.1, user database , (@user_install.sql) , send me errors on creation and compilations of packages (XLIB_HTTP / XLIB_JASPERREPORTS / xlib_jasperreports_img) on %TYPE of this line : p_http_version IN utl_http.http_version_1_1%type default utl_http.http_version_1_1 .

Some package or utility that I need in the Database or permission or grant ?? , already run the utl_http installation, many times, but same error to install @user_install.sql

Or ...

Could it be some error in the definition of the variable type in the package?

Any advise to correct that??

Oracle 12c Database : 12.1.0.2 APEX 22.1 JRI : 2.8.1 Error on Package (1 of 2) Error on Package (2 of 2)

daust commented 2 years ago

You need access to UTL_HTTP as outlined in the requirements section: https://github.com/daust/JasperReportsIntegration/blob/dad9a6bbccdda2e425cd5c1d0354d4b3a5dac099/README.md#system-requirements

During installation, you need to run the script sys_install.sql as user SYS (see https://github.com/daust/JasperReportsIntegration/blob/dad9a6bbccdda2e425cd5c1d0354d4b3a5dac099/src/doc/github/installation-full.md#31-database-installation-sys), this grants the respective privileges: https://github.com/daust/JasperReportsIntegration/blob/2197f89ce2eeecbea927b0e676b513bed5254cbc/src/sql/sys_install.sql

Did you do that? When you follow the instructions, it should work.

ocv1269 commented 2 years ago

The error are not on SYS , or run sys_install image

ocv1269 commented 2 years ago

The error is on user_install.sql tell compilation errors on XLIB_HTTP , and anotrher packakes and libraries , says Wrong variable 👍

~~ Package Headers

Package created.

No errors.

Warning: Package created with compilation errors.

Errors for PACKAGE "XLIB_HTTP":

LINE/COL ERROR


50/4 PL/SQL: Declaration ignored 56/35 PLS-00206: %TYPE must be applied to a variable, column, field or attribute, not to "UTL_HTTP.HTTP_VERSION_1_1"

79/4 PL/SQL: Declaration ignored 83/30 PLS-00206: %TYPE must be applied to a variable, column, field or attribute, not to "UTL_HTTP.HTTP_VERSION_1_1"

Warning: Package created with compilation errors.

Errors for PACKAGE "XLIB_JASPERREPORTS":

LINE/COL ERROR


112/4 PL/SQL: Declaration ignored 130/34 PLS-00206: %TYPE must be applied to a variable, column, field or attribute, not to "UTL_HTTP.HTTP_VERSION_1_1"

134/4 PL/SQL: Declaration ignored 136/34 PLS-00206: %TYPE must be applied to a variable, column, field or attribute, not to "UTL_HTTP.HTTP_VERSION_1_1"

167/4 PL/SQL: Declaration ignored 186/34 PLS-00206: %TYPE must be applied to a variable, column, field or attribute, not to "UTL_HTTP.HTTP_VERSION_1_1"

LINE/COL ERROR


ocv1269 commented 2 years ago

Despite following all the installation instructions, the error remained... but we were able to resolve the error as follows:

We replaced in the SQL Scripts in the packages (for @user_install.sql ), the variable definition "utl_http.http_version_1_1%TYPE" (implied from a variable in the utl_http package) by the unspoken definition "VARCHAR2" , and it worked perfectly clean, that is Probable due to the definition of internal variables in the UTL_HTTP in Oracle Database version 12.1.0.2.

This was when analyzing the error that was generated over and over again when compiling packages in @user_install.sql

In fact we did it in the latest version JasperReportsIntegration V2.10.0 , and it is the same for versions 2.8 up to 2.10.0

I hope it will be useful to those who present the same error

Thanks a lot !!

image

daust commented 2 years ago

Thank you.

I also tracked it down, and actually I did add the following parameter to a few functions/procedures:

p_http_version         IN   utl_http.http_version_1_1%type default utl_http.http_version_1_1

This declaration references the following constants in the package UTL_HTTP:

  -- The HTTP protocol versions that can be used in the function begin_request
  HTTP_VERSION_1_0  CONSTANT VARCHAR2(64) := 'HTTP/1.0'; -- HTTP 1.0
  HTTP_VERSION_1_1  CONSTANT VARCHAR2(64) := 'HTTP/1.1'; -- HTTP 1.1

This declaration is valid in Oracle 21 (in which I tested), but not in 11g ... I tested against my old XE instance. Yeah, your solution is the correct one, and I will provide a fix for the upcoming version.

Thank you.

daust commented 1 year ago

The fix will be tracked through: https://github.com/daust/JasperReportsIntegration/issues/123