Announcement

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

    Extending DataSourceLoader (dynamic data sources), worked on 5.1p and not now on 6.0

    I replaced 6.0 jars (from 13-april-2016) with 5.1p jars from 11.march.2016 and it works on GAE
    On 5.1p my dynamic Data Sources work. On 6.0 I receive the message that DataSource do not exist and the location of static DataSource files where I should put it (see detail error from Console below).

    ??? Did something changed in 6.0 - Do I need to do something more or different ?????

    web.xml contains
    Code:
            <servlet>
                <servlet-name>DataSourceLoader</servlet-name>
                <servlet-class>com.smartgwt.sample.server.listener.MyDataSourceLoader</servlet-class>
            </servlet>
    and my java DataSource constructor is
    Code:
    ...
    import com.isomorphic.servlet.DataSourceLoader;
    ...
    public class MyDataSourceLoader extends DataSourceLoader {
         public MyDataSourceLoader() {
            super(); // call what was skiped in web.xml after replacing  <!--servlet-class>com.isomorphic.servlet.DataSourceLoader</servlet-class-->
    
            // !!!!!! it lookls like it is not entering this function in 6.0 !!!!!!
    
            DataSource.addDynamicDSGenerator( new DynamicDSGenerator() {
                    @Override public DataSource getDataSource( String arg0, DSRequest dsRequest) {
                            // ... construct and return an XML ....
                    }
           );      
    }
    Error message at ISC_Core.js:1152
    Code:
    12:28:01.408:XRP9:WARN:ResultSet:isc_ResultSet_0 (dataSource: aviz_stornare_miscari_string_master_DataSource, created by: isc_ListGrid_0):Bad data returned, ignoring: "java.lang.NoClassDefFoundError: Could not initialize class com.isomorphic.sql.SQLDriver<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.sql.SQLDataSource.init(SQLDataSource.java:307)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSource.initialize(DataSource.java:936)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:209)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:921)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSource.fromXML(DataSource.java:1103)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSource.fromXML(DataSource.java:1087)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSource.fromXML(DataSource.java:1056)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.smartgwt.sample.server.listener.MyDataSourceLoader$1.table_dyn_DataSource(MyDataSourceLoader.java:126)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.smartgwt.sample.server.listener.MyDataSourceLoader$1.getDataSource(MyDataSourceLoader.java:36)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSource.getDataSourceFromStack(DataSource.java:846)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSource.getDynamicDataSource(DataSource.java:817)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSource.forName(DataSource.java:465)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:134)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.pool.PoolManager.borrowUnpooledObject(PoolManager.java:143)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:155)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:107)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DSRequest.getDataSource(DSRequest.java:2278)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DSRequest.decodeUploadedStrings(DSRequest.java:793)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.datasource.DSRequest.&lt;init&gt;(DSRequest.java:676)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2309)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.rpc.RPCManager.&lt;init&gt;(RPCManager.java:369)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.rpc.RPCManager.&lt;init&gt;(RPCManager.java:349)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:147)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:37)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:50)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:260)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.Server.handle(Server.java:326)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:78)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:148)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:468)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:439)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:446)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:256)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:310)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:302)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:443)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:235)<BR>&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.Thread.run(Thread.java:745)<BR>"
    Last edited by dorin.ionescu; 20 Apr 2016, 02:46. Reason: Valid syntax for constructor

    #2
    Did you mean to post more information? You haven't explain what wasn't working. You've totally omitted any diagnostics or logs. You mention GAE as if something might have worked without GAE but not on GAE, but haven't clarified.

    Comment


      #3
      Hi dorin,

      what you are showing is no java constructor and I don't think this is even valid syntax.

      Best regards
      Blama

      Comment


        #4
        I call my DynamicDSGenerator like this:
        Code:
            <servlet>
                <servlet-name>RegisterDS</servlet-name>
                <servlet-class>.........server.RegisterDS</servlet-class>
                <load-on-startup>1</load-on-startup>
            </servlet>
        The class itself is like this:
        Code:
        public class RegisterDS extends HttpServlet {
            private static final long serialVersionUID = ...;
        
            @Override
            public void init() throws ServletException {
        ...
        ...
        ...
        DataSource.addDynamicDSGenerator(...)
        ...
        ...
        This works for me and I think I have this from the docs (can't find it right now). If you subclass DataSourceLoader like you do, you are most likely calling addDynamicDSGenerator() for every client that loads your application in the browser. I'm pretty sure this is not intended and don't know if it will introduce errors.

        Best regards
        Blama

        Comment


          #5
          Originally posted by Blama View Post
          I call my DynamicDSGenerator like this: ....
          Are you using 6.0 or 5.1p ?

          Comment


            #6
            Current 5.1p.

            Comment

            Working...
            X