Tuesday, April 22, 2008

Posting HTML items in an APEX environment

Ever got a nasty HTTP 404 error message in APEX? Or your url stays at /pls/apex/wwv_flow.accept and it doesn't do anything?

I had one on apexblogs.info, but not all the time, only occasionally. I couldn't understand what was going on.

What I normally do is having a look insight my page in Application Express to see what's going on. If I don't see it directly, I try some debugging techniques to investigate further, but I didn't find anything special in APEX or SQL Developer.
With Screen Sharing on my Mac I can easily show it to others too. Especially with XP programming it's useful, so also this time I showed John Scott, my partner at Apex Evangelists. His reaction is always to look into the Apache logs and most of the time that's where you find more information, but even then...

This is what was in the Apache log when I got a 404 error on apexblogs.info:

Tue Apr 22 09:02:54 2008] [error] [client 127.0.0.1] [ecid: 1208851374:a.b.c.d:29454:0:667,0] mod_plsql: /pls/apex/wwv_flow.accept HTTP-404 \nwwv_flow.accept: SIGNATURE (parameter names) MISMATCH\nVARIABLES IN FORM NOT IN PROCEDURE: CODE\nNON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM: \n 11:44 MISMATCH\nVARIABLES IN FORM NOT IN PROCEDURE: CODE

I was pretty sure my variables where correct... John spotted it. Some posts included html items which APEX interpreted not correctly. Well, APEX shouldn't interpret it neither, so the fix was to escape the items. I couldn't escape the whole message (or data I get from the rss feeds) as I want to reproduce the post as accurate as possible.

I hope the problems with apexblogs.info are fixed now. Time to develop further and in the meanwhile, if you find another error, please tell me.

12 comments:

Anonymous said...

cool tip

Anonymous said...
This comment has been removed by a blog administrator.
Dimitri Gielis said...

Thanks.

Wesley said...

I have gotten enough 404 errors since upgrading to 3.1 that I wish I had stayed on 3.0. But since they only happen in the development area I am forced to deal with them.

Anonymous said...

I am not sure I understand. Was Apex interpreting some HTML text as Apex variables?

Wesley said...

Apparently ApEx 3.1 doesn't work on 9.2.0 versions of the Oracle Database. The 3.1.1 is supposed to fix it. In any areas we have more than 4000 characters we get a 404 error.

Jaya said...

Hi ,

Our application uses custom images tailored to the need of the business.
Strangely ,I'm finding it difficult to upload these images via shared components.
DBA's have installed APEX 3.2.1 , later due to file upload issue they have applied the pacthset too,but i'm still encountering this issue. Size of the custom images are not more than 3KB.

Given below are the enviornment details
APEX Listener version .10.56.22.08
APEX Version : 3.2.1.00.12
Tomcat : 6.0.14

Case 1:

When I tried to upload a new image , error message displayed 'Upload New Image must be specified. Click browse to select an image from your local computer".Though it was browsed and selected from my local drive .

As logged in catalina.out


Using Config file:/third_party_applications/gesct/apache-tomcat-6.0.14/temp/APEX/apex-config.xml
-- listing properties --
PropertyCheckInterval=60
ValidateConnection=true
MinLimit=1
MaxLimit=10
InitialLimit=3
AbandonedConnectionTimeout=900
MaxStatementsLimit=100
InactivityTimeout=1800
APEX Listener version .10.56.22.08

java.io.FileNotFoundException: /third_party_applications/gesct/apache-tomcat-6.0.14/webapps/apex/WEB-INF\mimes.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:106)
....
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
java.sql.SQLException: ORA-06550: line 1, column 31:
PL/SQL: ORA-00942: table or view does not exist
ORA-06550: line 1, column 7:
PL/SQL: SQL Statement ignored

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
...
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)


Though the mimes.xml is available in this path /third_party_applications/gesct/apache-tomcat-6.0.14/webapps/apex/WEB-INF
I got an exception.Am I missing some privileges on table? If yes, Can you specify the table name?


Case 2: I'm unable to select the standard images available. I tried selecting "menu/bug_64.gif"
But nothing reflected in the application

The log messages in catalina.out

init: # headers=44
declare nm owa.vc_arr := ?;
vl owa.vc_arr := ?;
begin
owa.init_cgi_env( ?, nm, vl );
htp.init; htp.HTBUF_LEN := 63;
? := sys_context('USERENV','SID');
end;
SID:98
CALL:
begin
src=;
commit;
end;
BINDS

EXEC FAILED:ORA-06550: line 2, column 5:
PLS-00103: Encountered the symbol "=" when expecting one of the following:

:= . ( @ % ;
The symbol "=" was ignored.
ORA-06550: line 2, column 5:
PLS-00103: Encountered the symbol "=" when expecting one of the following:

:= . ( @ % ;
The symbol "=" was ignored.


Any help will be greatly appreciated !

Thanks
Jaya

Omar Sawalhah said...

Hi Dimitri,
Still replying to these comments,
I am getting this error when upgrading from 4.1 to 4.1.1. What Items do I have to escape, and I tried to disable all processes but no luck. your input is highly appreciated.

Omar

Praveen Chaudhary said...

Hi Dimitri,

I have apex URL integrated within my application.
but when i open reports in browser other than google chrome it works fine for me and reports gets open.
but when i open reports in google chrome its giving me an error - 403 forbidden.
the problem is only occurring in google chrome.

Recently my application has been moved from HTTP to HTTPS .

what can be reason and please provide the solution for this ?Please help.

Regards,
Praveen

Dimitri Gielis said...

Looks like it's a security feature that is stopping you.
It can be http to https or popup blocker or something like that.

gyana said...

Hi Dimitri,

I have apex URL integrated within my application.

URL like : https://slms.ABCDEF.com/apex/f?p=107:3:::::P_USER:c2FyZ2JlaGU=

Here from the other application we are passing :P_USER which is the user name of the current user .
I want to use that :P_USER variable value in my apex report for user authentication and other query operations . Please guide me how i can use the :P_USER value passed from the URL in APEX authentications .

Issues I am facing
-------------------
1. I can't able to use the :P_USER variable value in APEX to authenticate the user so the report is open for all now .(For now i am using apex authentication for temporary).

2. If somebody copy the URL and paste in other browser then the APEX report UI opens with out any security . How to prevent the copy paste URL working for customer ?

3. What are the other security method i can apply in the APEX by using the variable passed in URL ? :P_USER .

4. How i can achieve the SSO (Single sign on) APEX . We have integrated the APEX URL in other application and we have a requirement to implement the SSO . But i am new to apex and i have no idea how to implement . Could you please guide me on solving these issues .

Please send some steps how to do that in my email gyanabehera2013@gmail.com .

Thank you in advance .

Regards
Gyana

Oracle DBA said...

Hi, guys!
The following link provides the way to get all references to an Oracle object.
Also, it explains how to fix ORA-00942 error that is due to lack of permissions

http://dbpilot.net/2018/01/23/getting-all-child-objects-within-an-object/

...