APEX Listener Connection - ORDS, SODA & JSON in the Database

Hello,
I tried connection using listnerAdmin.
When I tied to connect to APEX_PUBLIC_USER, I get the following error
Request could not be processed due to error:
Tue Jul 13 21:24:26 AST 2010
The Network Adapter could not establish the connectionWhat could be the reason for this?
Besides, I installed APEX 4.0 on my 10g database, how do I link with Listener?
Regards 

Which webserver are you using with Apex Listener?
Regards, 

I am using local standalone oc4j container
Rgds 

Sounds like a network error either in resolution of the hostname or access.
Is the database on a different machine or the same machine?
Is the listener on the default port of 1521 or a different port?
Can you ping the Database Server from the Application Server?
Is the listener port (default 1521) open on the Database Server?
Is the listener started (default LISTENER) on the database?
I would ask about the SID, but it isn't even getting there yet.
-Richard 

Thanks for the reply.
Both my database and oc4j are on same machine.
I found that particular issue and it was due to listener was not started, so i started listener( not sure how I could connect to db).
After entering all details in Connection page and clicked Apply, I get the following error
Requested url http://localhost:8888/apex/apex is not allowed.What could be the reason for this? 

Is the APEX_PUBLIC_USER account unloacked? And are you able to connect to database as APEX_PUBLIC_USER in SQL*Plus or SQLDeveloper?
Regards, 

Yes I am able to connect to user APEX_PUBLIC_USER. It is not locked.
Regards 

In the install guide for the listener it talks about configuration of the "Allowed Procedures".
This is under the security tab. Have you added the "apex" to that list? It shows this option under the example configuration. It would appear from your error that it is not allowing you to the page. A good default listing for this would be (of course additional input on this is fine :D):
apex, p, v, f, n, wwv_flow*, z
-Richard 

I added Allowed procedures, still I am getting same error message. 

I don't know if the change in configuration requires that that web application be restarted. Have you restarted it with the change in place for good measure?
-Richard 

Yes I did re-start 

Hi,
I have same problem.
The Decision in my situation such: configuration of the "Allowed Procedures" set values:
wwv_flow*, p, n, cust*, apex*, v, f, z
it is work. 

Did you change the hostname of your machine, after installing the database and the (database) listener ?
If so, than probably the listener.ora file contains the old hostname.
This happened to me one time, and I got the same error.
The listener.ora file can be found in $ORACLE_HOME/network/admin
Regards, 

The listener.ora file can be found in $ORACLE_HOME/network/admin This file will come into the picture only if you are using the TNS as the method when configuring apexlistener, not when using JDBC which is what is implied when you use port 1521 to connect to the DB.
Regards, 

Hi Prabodh,
Even if you configure the Apex Listener via JDBC the database listener (and thus the listener.ora file) must be correctly configured.
Otherwise network connections aren't forwarded from the client to the database (and vice-versa).
If the listener.ora file contains a wrong hostname then there is noway the Apex Listener can make any connection to the database.
Regards,
Ramon

Related

Getting Permission denied when called listenerConfigure and glassfish

This is a brand new install of 11g on ec2 - standard one edition. I then downloaded 4.1 apex and installed that and the new APEX listener. I set it up in standalone mode. I was able to get that up - I called the listenerConfigure. I was able to point to the apex_public_user, the instance I created and I was able to use to use Apex. Created a new Workspace, associated with a schema and got part of the new application running. All good...
I then wanted to use glassfish, as that's what we'll eventually deploy on. So, I changed the port for the 8080 oracle http server so I could use the glassfish 8080 port. Followed all the instructions there, setup the application, and everything appeared okay. Then, when called listenerConfigure using the https port, I fill in the apex_public_user password, the hostname and sid and I get a red box that has Error:
Request could not be processed due to error:
Mon May 28 22:24:51 EDT 2012
Permission denied
This is coming from the database I think. I suspect it's trying to call something or query something and cannot. There's nothing that appears in the glass fish server.log when this occurs. If I change something - say the SID name to something that doesn't exist and hit submit, I get a TNS-12505 error and I see that in the logs fine. So - I believe it's getting to the database. I just can't get any logs or see any trace of what it is trying to do beyond that. I suspect it may have something to do with the fact I already used this or registered the apex schema with the standalone listener? Searches don't bring anything up.
Is there any way to see what the configure does and see logs beyond what the server.log in glassfish shows? Would I need to re-instal apex - re-run the script? I'd lose any work I've already done there I assume...
Any suggestions, please let me know. Thanks 
Hello,
So, I changed the port for the 8080 oracle http server so I could use the glassfish 8080 port.Could it be there is still another service using that port? "Permission denied" could be something issued by the database internal XDB HTTP Server, which defaults to port 8080 as well.
Is your GlassFish located on a host that also runs a database?
If so, please make sure either your GlassFish or your XDB HTTP Server use a different port. The database command that configures the port used by XDB HTTP Server (to be run as sysdba) is
exec dbms_xdb.sethttpport(<portnumber>);
commit;If you don't need that service at all, you could disable it by setting the port to 0.
-Udo
P.S.: Please note that you've opened this thread as a "non-question". Please make sure to keep the "question-mark" so others will be able to get the right view on the thread. 
Thought I had that question mark checked...
To answer your question - yes, I did change the port. They are currently on the same host as this is just a dev setup right now. I can confirm the port:
SQL> SELECT dbms_xdb.gethttpport FROM dual;
GETHTTPPORT
-----------
8000
That's what it is set to currently. Note - if I try to go to the port 8000, it actually redirects to the f?p= link, but nothing appears after that. I don't care about using it from the old http db listener. Just trying to get it working with Glassfish.
If I hit the 8080/apex link, I get the 503 error - not available, which makes sense as it is not setup yet. So, if I hit the http://host:8080/apex/listenerConfigure or https://host:8181/apex/listenerConfigure, these do bring up the Application Express Listener page fine. I can see the request go through the glassfish server.log fine, so the ports are okay. It's just when I actually hit the Apply button that it tries to process my request.
Here's what the message looks like:
http://i1050.photobucket.com/albums/s404/cchanyi/ScreenShot2012-05-29at93117AM.png
Edited by: oldoracle on May 29, 2012 6:41 AM
Edited by: oldoracle on May 29, 2012 6:42 AM 
Note - I set the port to zero and it didn't make a difference. This is something that is definitely in the DB - in the APEX_PUBLIC_USER account this is having an issue once the listenerConfigure has been submitted. For example, if I change the password in that form to a wrong password and hit submit, this is what the response looks like:
http://i1050.photobucket.com/albums/s404/cchanyi/ScreenShot2012-05-29at95106AM.png
It's the ORA-1017 - invalid username password. Odd I'm not getting an ORA error with the permission denied, but I'm not. I may just completely rebuild Apex schema from scratch. Real pain, just wish I could see a trace or find out what it's doing under the covers... 
Do you see any additional information in the log when you hit the apply button to get the "Permission denied" error?
This could be a Java security issue, e.g. missing policies to allow the connection pool to open (additional) connections. Make sure your policies fit the hostname you entered for the connection in APEX Listener as well as the one that your database listener is confgured for. If these don't match, strange things can happen with security-enabled systems...
-Udo 
Nothing in the logs - at least, in the server.log. I'm not sure what other logs I can check.
Like I said - if I put the wrong connect string, sid, or password, the errors are logged in the glassfish server.log file when I hit submit. But, if I put all the correct information in - nothing is logged in the server.log and I just see permission denied. I'm pretty sure this is a database error - as I assume it's getting into the database, but failing doing something in there. My big question - are there any other logs that trace what it is doing at this point? 
Nothing in the logs - at least, in the server.log.That's odd...
I'm not sure what other logs I can check. Well, you could take a look into the database alert log and possibly the trace file that corresponds to the APEX Listener's login attempt.
Like I said - if I put the wrong connect string, sid, or password, the errors are logged in the glassfish server.log file when I hit submit.I understood that point. But probing the connection with a single JDBC connect and creating the UCP connection pool can be two different things. Do you have any Java security policies enabled on your system?
Another reason could be that the database listener answers, but not through the communication endpoint expected. That's why I asked to check how your database listener is configured.
I'd expect any database related error to be reported with the corresponding error code by APEX Listener. The fact that there is no such error code is an indication for a Java related issue.
Anyway you could of course also check the alert log and trace files, as mentioned above. They will usually be located in +$ORACLE_BASE/diag/rdbms/<instance_name>/trace+ .
-Udo 
There's nothing in any of the alert.logs or other trace files. I did a lot of searching for log files before posting and couldn't see anything.
This is a new server, new java, I didn't setup any special security. This is an EC2 ami, so whatever may be set there. Even if it were a java security issue, I would expect a stack trace or something to occur. What exactly happens in the Apex listener when we hit submit? Does it have it's own logs beyond what glassfish covers? You mention the apex listener configuration, but other than what I'm currently trying to do in the glassfish - are there any other configs? I thought that's what this step is to configure the listener.
Thanks for the effort - it just seems there's a blackbox around what the apex listener is doing - I can't tell what else it may be doing unless we got a stack trace or log. I fear I may have to start from scratch... skip the part where I setup the standalone. I had no issues until I got to this part. 
Even if it were a java security issue, I would expect a stack trace or something to occur. Which confirms my assumption that the denial is not happening in the database...
Even if it were a java security issue, I would expect a stack trace or something to occur.Well, only if it isn't catched by the application, which seems to be the case as you get an application level error message. Unfortunately, it's not a very comprehensive one.
What exactly happens in the Apex listener when we hit submit?Basically, APEX Listener probes the connection parameters you've entered and in case of success, it creates the connection pool and redirects you to the APEX start page.
So, if you say it works with APEX Listener in Standalone Mode, it can't be a general issue on your machine (not Java, not network, not database). It has to be related to your GlassFish setup. In general, deploying on GlassFish doesn't cause such problems... So if you followed the Installation Guide for the deployment (and requirements concerning JDK and GlassFish version; but I assume you've set up your fresh instance with current releases...), it's hard to guess.
Just a short shot: There is one more thing APEX Listener does when you hit submit - it tries to save the configuration to a file.
Could it be you didn't configure apex.home when you ran APEX Listener in Standalone Mode the first time, executed it with a different user than the one that runs your GlassFish right now, and your APEX Listener deployed on that GlassFish is not configured to use any config.dir or similar? In that case, it could be a file permission error. Try to delete the apex-config.xml that is probably stored in /tmp on your machine and try again.
-Udo 
Udo wrote:
Just a short shot: There is one more thing APEX Listener does when you hit submit - it tries to save the configuration to a file.
Could it be you didn't configure apex.home when you ran APEX Listener in Standalone Mode the first time, executed it with a different user than the one that runs your GlassFish right now, and your APEX Listener deployed on that GlassFish is not configured to use any config.dir or similar? In that case, it could be a file permission error. Try to delete the apex-config.xml that is probably stored in /tmp on your machine and try again.
-UdoSorry for the delay - out of the office. The minute I read this, I knew it was that. I had created an ApexHome. It was owned by oracle, but the glassfish is owned by glassfish. That was totally it. I modified permissions and it worked. Thanks for hanging in there Udo - your help is greatly appreciated...

How to find out Listner type

How would I know which listener I am using? EPG, Apache w/mod_plsql, or the APEX listener?
Thanks 
From the URL alone there is no sure way to tell.
If you have Web PL/SQL procedures that use flexible parameter passing, with an exclamation point (!) in front of the procedure name, these won't work in the current version of the APEX Listener. If you are using port 8080, you might suspect that you are using the EPG, but that isn't proof - Tomcat running the APEX Listener might also use this port by default. If you are using the EPG, then your URL will reference the same server that is running your database. But nothing stops you from running an application server on the same server as your database.
If you are using port 7777 or 7778, you might be using mod_plsql because Oracle Application Server often defaults to these ports. Weblogic running the APEX Listener defaults to 7001. Glassfish also uses a well known default port but I don't use that, so I'm not sure what it is.
The only sure way to know is to log into the server and see what's running. 
May I know where to check in the server for APEX listener type...?
thanks 
An option to find out would be to call the root page of the server, i.e. the URL with just protocol, host/domain name and port, e.g. http://yourhost.yourdomain:8080 and have a look at it. Most servers have a kind of home page to see if everything is working and presenting links for management applications. However, if your admin has disabled that page, you may not be able to see it.
If you have a windows server, you could then check if there is a service running for one of the possible J2EE Servers.
Another option would be to see which process is assigned to the port you are calling, e.g. using netstat. Depending on the OS you use, the options to use for netstat would be different. Probably netstat -h will give you all possible options. Look for the process-related one. If you have it, may need additional information on the location of that service on your server host. You could determine that with the help of the process list (e.g. ps or Task Manager) and the process id you get from netstat.
-Udo 
You could login to the workspace, Administrator->About
Apex Listener looks like this
APEX_LISTENER_VERSION     1.1.0.291.08.34
PLSQL_GATEWAY     WebDb
GATEWAY_IVERSION     3
SERVER_SOFTWARE     Mod-ApexEPG
APEX_LISTENER_VERSION     
PLSQL_GATEWAY     WebDb
GATEWAY_IVERSION     2
SERVER_SOFTWARE     Oracle Embedded PL/SQL Gateway/11.2.0.2.0
GATEWAY_INTERFACE     CGI/1.1
SERVER_PORT     8080
SERVER_NAME     XDB HTTP ServerI don't have a http server setup handy, probably it is obvious to tell from those variables. 
The "About Application Express" page doesn't show this information until APEX 4.0.
If you have an older version installed, you could print it anyway with the following statement in "SQL Workshop">"SQL Commands":
select owa_util.get_cgi_env( 'SERVER_SOFTWARE' ) from dual;The value for Oracle HTTP Server (in this case part of an OAS) might look as follows
Oracle-Application-Server-10g/10.1.2.2.0 Oracle-HTTP-Server-Udo 
Hi UDO, I ran your suggested script and got the following output
Oracle-Application-Server-10g/10.1.2.0.0 Oracle-HTTP-Server
may I know which APEX listener am I using...?
Thanks again for your assistance 
Hi,
the output you get says your APEX is hosted by a OHS (Oracle HTTP Server; using mod_plsql), which is part of an OAS (Oracle Application Server), so you aren't acutally using the APEX Listener. But that's nothing to worry about, as OHS is one of the supported web servers for APEX.
-Udo 
Yes, But I am unable to login to see apex screen. How will I find out wich is the right url to access APEX.
Thanks in Advance.
Shail

Cannot get listener config page

Hello,
I have just installed Apex 4.01 on Oracle EX 10 I can open Apex, apex admin pages. But I cant open http://localhost:8080/apex/listenerConfigure , and also listenerAdmin, listenerStatus pages. I am geting HTTP404 - The webpage cannot be found . I am starting listener using : java -jar C:\apex\ApexListener\apex.war It starts ok, opens listenerConfig page in last but it comes as a The webpage cannot be found Please suggest what might be the issue? 
Hi,
did you install the Oracle XE on the same host as you try to run the listener on?
If that's the case, I guess you didn't change or disable the HTTP Port used by the XDB HTTP server provided by the database. This is the default method of accessing APEX referred to as "Embedded PL/SQL Gateway" (EPG) in the APEX installation guide.
So if both services (EPG and APEX Listener) are configured to use the same port, only one of the two services will be able to use it and the other one won't be reachable. In your case, probably the database was started before the Listener, so it already used the port and the Listener couldn't bind to it.
The result you see fits perfectly - you reach your APEX installation via EPG.
To solve the conflict, you can either reconfigure the XDB HTTP Port or start your APEX Listener on a different port. The latter option is even easier. Just enter
java -Dapex.port=nnnn -jar C:\apex\ApexListener\apex.warwhere nnnn is the port to be used by the Listener which should differ from 8080.
-Udo 
Many Many Many thanks. Your help is highly appreciated.

Application listener not working

Hi,
I am trying to install oracle apex 4 on oracle 11g database.
when i tried to install standalone option.
everything went fine but when i tried to configure listener using http://<host>:<port>/apex/listenerConfigure.
i am getting page not found message on firefox and internet explorer 8 internet page cannot be displayed.
Please advice. 
Hi,
probably you have a port conflict, e.g. the XDB's HTTP Server of your 11g database running, which is the default if you installed APEX with your database, or some other service like Tomcat that uses port 8080.
Try to start the APEX Listener using a different port by passing in the corrsponding parameter apex.port, e.g.
java -Dapex.port=8081 -jar apex.warto start the standalone Listener on Port 8081 instead.
If that doesn't help, could you post the console output of the Listener's startup?
-Udo 
Hi Udo,
thanks for the help.it's working now.
but got stuck up at oracle apex listener configuration.
the error message is "network adopter could not establish the connection".
Please advice .what might went worng. 
Hi,
i am trying to connect using http://localhost:8081/apex/listenerConfigure
it defaultly prompted APEX_PUBLIC_USER,
connection type :basic,host name ,sid and port.
when i press apply button,it is giving message request could not process due to error,but there is no error message.
Please advice. 
Hi Sudhir,
do the parameters you enter for hostname, sid and port fit? Is the APEX_PUBLIC_USER unlocked? See the corresponding section of the APEX Installation Guide for details: http://download.oracle.com/docs/cd/E17556_01/doc/install.40/e15513/otn_install.htm#BABDEEIH
If that's not the reason, you may find detailed information for the error in the console output of the APEX Listener.
-Udo

configure application express listener

I am following the instrctions in the users guide 'installing oracle application express listner'
while configuring the listener
i get following errors, my input for host is localhost
port:8080 (i tried 1521 also because it was already filled in by default
and sid orcl (my local database installed on same machine)
Request could not be processed due to error:
Wed Jul 04 08:02:54 EDT 2012
IO Error: Got minus one from a read call
Request could not be processed due to error:
Wed Jul 04 08:04:03 EDT 2012
IO Error: The Network Adapter could not establish the connection
Please advise me what should be my parameters while configuring basic connection tab on the Application Express Listener screen.
thank you
j 
Hello j,
i get following errors, my input for host is localhost
port:8080 (i tried 1521 also because it was already filled in by default
and sid orcl (my local database installed on same machine)- localhost would be correct if your database listener is on the same machine
- port 8080 is probably wrong, as this is usually the port for your application server (e.g. APEX Listener in Standalone Mode)
- port 1521 should be right, but is possibly blocked by your firewall
- sid orcl is possibly wrong, because it sounds to much like the default sid which is usually changed during the installation
Please check which port your database listener is actually using for database connections by running
lsnrctl statusIf the ports you find there are not on the firewalls whitelist yet, you'll have to add them there.
For further questions please provide some more information about your environment, e.g. what OS are you on and how did you deploy your APEX Listener (Standalone Mode or which JEE Container?), etc.
-Udo 
hello UDO,
Thank you for responding to my question on July 4th. Happy 4th.
the out put from lsnrctl status is
C:\Users\sidhwaneyj>lsnrctl status
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 04-JUL-2012 12:43
:54
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 61: Unknown error
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=devdbs11.dodtvl.com)(POR
T=1521)))
apparently there is no listner. I have almost no knowledge of networki issues when it comes to web, firewall, listners etc.
Also, my local db name is 'orcl'. I usually do not change it.
j 
If the ports you find there are not on the firewalls whitelist yet, you'll have to add them there.
I have two db in my listner file
one localhost and the other remote. But I want to configure apex listener to my local database.
For further questions please provide some more information about your environment, e.g. what OS are you on and how did you deploy your APEX Listener (Standalone Mode or which JEE Container?), etc.
As you note in my output from the lstnrctl status my OS is 64 bit windows.
I installed apex listner in standalone mode .
Thank you
j 
Hello j,
apparently your database listener isn't working. You need to fix that before APEX Listener will be able to connect. If you don't find the solution yourself, perhaps post in {forum:id=61} where the database experts will probably be able to help you. I'd recommend to include both your database listener status output (as you've posted above) as well as your listener.ora and some other information, such as the value of your ORACLE_HOME, the state of your database listener service and possibly errors you find in the database listener's log file.
-Udo 
Hello Udo,
I fixed the problem of my DB listener. Now am reinstalling the apex listener.
the java -jar apex.war has been going since 45 minutes. first time install did not take this much time.
Also I appreciate if you let me know what exactly is happening during the install so I look in the database if proper users, procedures, files are being generated. It appears that second time install will take longer time, I have no idea how long I should leave it running.
Thank you
j 
Hello j,
the fact that it's running means it's configured.
I think you finished configuration the first time, but just hadn't your database listener up, so APEX Listener couldn't connect.
Since you used no additional parameters to start, the second "install" would use the default parameters and find the configuration you've created during your first install. If these have been correct, you should be able to use your APEX Listener instance right away.
Could you please post (or read) the console output you received after you started your APEX Listener?
-Udo

Categories

Resources