2 Replies Latest reply on Dec 2, 2013 5:16 PM by TobiasE

    4.0EA3 RESTful Services

    TobiasE

      Hi,

       

      I noticed that Kris Rice blogged about the new ability to define APEX Listener RESTful Services in SQL Developer 4.0:

       

      http://krisrice.blogspot.com/2013/08/sql-developer-meets-rest.html

       

      However, I have some trouble connecting to the RESTful Services in 4.0EA3 (same thing in 4.0EA2, didn't try it in 4.0EA1). First of all, I use the same "adminlistener" account that I use to connect to APEX Listener administration from sqldev (I don't know if this is the correct way), and when connecting, I get "500 Internal Server Error". The application server log contains this:

       

      oracle.dbtools.rt.web.WebErrorResponse internalError
      SEVERE: null
      JDBCException [kind=NO_DATA]
        at oracle.dbtools.common.jdbc.JDBCException.wrap(JDBCException.java:99)
        at oracle.dbtools.common.jdbc.JDBCQueryProvider.query(JDBCQueryProvider.java:63)
        at oracle.dbtools.common.jdbc.JDBCQueryProvider.query(JDBCQueryProvider.java:38)
        at oracle.dbtools.rt.jdbc.entity.JDBCEntityProviderBase.query(JDBCEntityProviderBase.java:358)
        at oracle.dbtools.rt.oauth.jdbc.JDBCScopesProvider.scopeRoles(JDBCScopesProvider.java:224)
        at oracle.dbtools.rt.oauth.jdbc.JDBCScopesProvider.retrieved(JDBCScopesProvider.java:111)
        at oracle.dbtools.rt.oauth.jdbc.JDBCScopesProvider.retrieved(JDBCScopesProvider.java:47)
        at oracle.dbtools.rt.jdbc.entity.JDBCEntityProviderBase.entity(JDBCEntityProviderBase.java:316)
        at oracle.dbtools.rt.jdbc.entity.JDBCEntityProviderBase.entity(JDBCEntityProviderBase.java:328)
        at oracle.dbtools.rt.oauth.jdbc.JDBCScopesProvider.byScopeName(JDBCScopesProvider.java:66)
        at oracle.dbtools.rt.oauth.scope.Scopes.byScopeName(Scopes.java:33)
        at oracle.dbtools.rt.oauth.builtin.jdbc.SQLDeveloperScopePaths.sqlDeveloperScope(SQLDeveloperScopePaths.java:100)
        at oracle.dbtools.rt.oauth.builtin.jdbc.SQLDeveloperScopePaths.scopeForPath(SQLDeveloperScopePaths.java:86)
        at oracle.dbtools.rt.oauth.ScopeAuthorizationPolicies.scope(ScopeAuthorizationPolicies.java:35)
        at oracle.dbtools.rt.oauth.BearerTokens.authenticate(BearerTokens.java:61)
        at oracle.dbtools.rt.authentication.AuthenticationService.authenticate(AuthenticationService.java:53)
        at oracle.dbtools.rt.authentication.AuthenticationService.verify(AuthenticationService.java:79)
        at oracle.dbtools.rt.web.RequestDispatchers.authenticate(RequestDispatchers.java:126)
        at oracle.dbtools.rt.web.RequestDispatchers.dispatch(RequestDispatchers.java:91)
        at oracle.dbtools.rt.web.ETags.checkPrecondition(ETags.java:53)
        at oracle.dbtools.rt.web.HttpEndpointBase.restfulServices(HttpEndpointBase.java:423)
        at oracle.dbtools.rt.web.HttpEndpointBase.service(HttpEndpointBase.java:162)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
      Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
      
      
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:505)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:223)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:886)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1288)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3612)
        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3656)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1495)
        at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:111)
        at $Proxy118.executeQuery(Unknown Source)
        at oracle.dbtools.common.jdbc.JDBCQueryImpl.resultSet(JDBCQueryImpl.java:92)
        at oracle.dbtools.common.jdbc.JDBCResultRowIterator.<init>(JDBCResultRowIterator.java:29)
        at oracle.dbtools.common.jdbc.JDBCQueryImpl.execute(JDBCQueryImpl.java:52)
        at oracle.dbtools.common.jdbc.JDBCQueryProvider.query(JDBCQueryProvider.java:60)
        ... 34 more
      

       

      Could anyone shed some light on how to make this feature work? I've been unable to find any mention of it, apart from Kris' blog entry.

       

      I use APEX 4.2.2, APEX Listener 2.0.3 and Weblogic 10.3.6.

       

      Thanks,

      Tobias

        • 1. Re: 4.0EA3 RESTful Services
          Kris Rice-Oracle

          For defining REST Services, you have to connect into the workspace you are defining them for. 

           

          In the dialog, enter the username for workspace, then in the last field it asks for the workspace name.

           

          -kris

          1 person found this helpful
          • 2. Re: 4.0EA3 RESTful Services
            TobiasE

            Thanks Kris, somehow I missed the workspace field in the connection dialog. However, I'm still having problems.

             

            My APEX Listener setup looks like this: I use the routing based on Request Path prefix to define separate databases under /apex: /apex/db_1, /apex/db_2 and so on. For each of these, I've configured a particular workspace which contains the RESTful Services (which means that the workspace isn't included in the URL when calling the services, unlike the default APEX Listener setup). When I include the workspace name (let's call it wspace1) in the connection dialog in sqldev, it automatically transforms the name from wspace1 to /wspace1/, which I assume means it tries to append the workspace to the URL (so the full URL to the RESTful services becomes /apex/db_1/wspace1). When connecting, I get 404 Not Found, because (again, I'm assuming here) it uses /apex/db_1/wspace1 rather than the correct URL /apex/db_1. On the other hand, if I remove the workspace name from the connection dialog, I get "access_denied" (without an HTTP status code).

             

            Is there a way to get the sqldev functionality to work in my case, assuming my understanding of why it doesn't work is correct?

             

            Thanks,

            Tobias