Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RESTHandler and db connection

    SmartClient Version: v8.3p_2013-05-18/PowerEdition Deployment (built 2013-05-18)

    I'm trying to fetch data from a sql datasource using RESTHandler.

    The purpose is to feed a third party application.

    question: is it legal with our license or I've got to expose data using a hand written servlet?

    anyway, I got an error:

    Code:
    2013-05-27 18:39:25,287 INFO  SQLDataSource [builtinApplication.JPC_ACCOUNTS_fetch] Performing fetch operation with
    	criteria: {}	values: {} 
    2013-05-27 18:39:25,287 INFO  SQLWhereClause [builtinApplication.JPC_ACCOUNTS_fetch] empty condition 
    2013-05-27 18:39:25,287 INFO  SQLDataSource [builtinApplication.JPC_ACCOUNTS_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause 
    2013-05-27 18:39:25,287 INFO  SQLDataSource [builtinApplication.JPC_ACCOUNTS_fetch] Executing SQL query on 'dbJpcEP': SELECT JPC_ACCOUNTS.COGNOME, JPC_ACCOUNTS.EMAIL, JPC_ACCOUNTS.ID_REC, JPC_ACCOUNTS.NOME, JPC_ACCOUNTS.TELEFONO, JPC_ACCOUNTS.USER_ID FROM DBSALES.JPC_ACCOUNTS WHERE ('1'='1') 
    2013-05-27 18:39:25,287 DEBUG PoolableSQLConnectionFactory [builtinApplication.JPC_ACCOUNTS_fetch] Initializing SQL config for 'dbJpcEP' via JNDI 
    2013-05-27 18:39:25,288 ERROR SQLConnectionManager [builtinApplication.JPC_ACCOUNTS_fetch] Caught exception 
    javax.naming.NameNotFoundException: Name [jdbc/juve/dbJpcEP] is not bound in this Context. Unable to find [jdbc].
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
    	at com.isomorphic.sql.PoolableSQLConnectionFactory.makeUnpooledObject(PoolableSQLConnectionFactory.java:271)
    	at com.isomorphic.sql.PoolableSQLConnectionFactory.makeObject(PoolableSQLConnectionFactory.java:344)
    	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:974)
    	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:85)
    	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:69)
    	at com.isomorphic.sql.SQLConnectionManager.getConnection(SQLConnectionManager.java:156)
    	at com.isomorphic.sql.SQLTransaction.startTransaction(SQLTransaction.java:114)
    	at com.isomorphic.sql.SQLDataSource.getTransactionalConnection(SQLDataSource.java:356)
    	at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:533)
    	at com.isomorphic.sql.SQLDriver.executeQuery(SQLDriver.java:872)
    	at com.isomorphic.sql.SQLDataSource.executeNativeQuery(SQLDataSource.java:415)
    	at com.isomorphic.sql.SQLDataSource.executeNativeQuery(SQLDataSource.java:409)
    	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1402)
    	at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:314)
    	at com.isomorphic.sql.SQLDataSource.executeFetch(SQLDataSource.java:258)
    	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1367)
    	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:726)
    	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
    	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
    	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2033)
    	at com.isomorphic.servlet.RESTHandler.handleDSRequest(RESTHandler.java:341)
    	at com.isomorphic.servlet.RESTHandler.processRequest(RESTHandler.java:319)
    	at com.isomorphic.servlet.RESTHandler.doGet(RESTHandler.java:267)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at com.juve.utils.Log4jSessionFilter.doFilter(Log4jSessionFilter.java:65)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
    	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:109)
    	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
    	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at com.isomorphic.js.JSSyntaxScannerFilter.doFilter(JSSyntaxScannerFilter.java:241)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at java.lang.Thread.run(Thread.java:722)
    I'm calling fetch method with this URL typed in the browser:
    Code:
    https://localhost:8443/isomorphic/RESTHandler?_operationType=fetch&_dataSource=JPC_ACCOUNTS&isc_metaDataPrefix=_&isc_dataFormat=xml

    #2
    maybe the problem is that I'm using jndi resources defined in my webapp (context.xml) ?

    it's not clear to me if this is a case of standalone datasource usage.
    If so, which are the supported settings for database connection?

    Comment


      #3
      sorry, the problem seems that I must use an URL which contains the context path of my app, in my case:
      Code:
      https://localhost:8443/JpcEP/isomorphic/RESTHandler?_operationType=fetch&_dataSource=JPC_ACCOUNTS&isc_metaDataPrefix=_&isc_dataFormat=xml
      instead of:
      Code:
      https://localhost:8443/isomorphic/RESTHandler?_operationType=fetch&_dataSource=JPC_ACCOUNTS&isc_metaDataPrefix=_&isc_dataFormat=xml
      now my question is: why is it responding also on the https://localhost:8443/isomorphic/... URL ?

      Comment


        #4
        Couldn't tell you - RestHandler is just an ordinary servlet and there is no way, within a servlet, to choose what ports you are listening on. That's the kind of thing you configure in the application server.

        Comment

        Working...
        X