Announcement

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

    NPE with schemaBean

    I'm using 2.5 and getting this error.
    Here's the stack trace:
    Code:
    === 2012-03-20 18:27:41,575 [8-36] DEBUG ServletTools - setting cookie 'isc_cState' to: 'ready'
    === 2012-03-20 18:27:41,746 [8-35] WARN  BasicDataSource - Exception trying to invoke DataSourceTools method
    java.lang.NullPointerException
    	at com.isomorphic.base.Reflection.getBeanFields(Reflection.java:1562)
    	at com.isomorphic.tools.DataSourceTools._getDataSourceConfigFromJavaClass(DataSourceTools.java:152)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at com.isomorphic.base.Reflection.invokeStaticMethod(Reflection.java:712)
    	at com.isomorphic.base.Reflection.invokeNonVisibleStaticMethod(Reflection.java:687)
    	at com.isomorphic.datasource.BasicDataSource.createAutoDeriveDS(BasicDataSource.java:511)
    	at com.isomorphic.datasource.BasicDataSource.init(BasicDataSource.java:208)
    	at com.isomorphic.datasource.DataSource.initialize(DataSource.java:363)
    	at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:165)
    	at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:348)
    	at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110)
    	at com.isomorphic.datasource.DataSource.forName(DataSource.java:167)
    	at com.isomorphic.datasource.DataSource.forName(DataSource.java:159)
    	at com.isomorphic.datasource.DataSource.forName(DataSource.java:154)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:95)
    	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:102)
    	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:82)
    	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:87)
    	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:107)
    	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:83)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1360)
    	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
    	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
    	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
    	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
    	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
    	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
    	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
    	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
    	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
    	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
    	at org.eclipse.jetty.server.Server.handle(Server.java:349)
    	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
    	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:884)
    	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:938)
    	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
    	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
    	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
    	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
    	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
    	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
    	at java.lang.Thread.run(Unknown Source)
    and the quote.ds.xml for the custom datasource:
    Code:
    <DataSource
    	ID="quote"
    	schemaBean="com.integral.strategy.server.quote.SEQuote"
    	serverConstructor="com.integral.strategy.server.quote.smartgwt.QuoteDataSource"
        dropExtraFields="true" >
    </DataSource>
    I've tried removing the dropExtraFields, I've tried marking complex data members as transient, but without a little more info I'm shooting in the dark.

    #2
    This looks unrelated to the thread you posted it in, so we moved it to a new one.

    Please make sure you're using the latest patched build (see smartclient.com/builds). If you already are, report your version number (always do this).

    If it's still happening, if you can share the bean definition, we can take a look.

    Comment


      #3
      I'm using 2.5p, I even redownloaded it to be sure.

      The bean depends on a number of other classes (both generic classes and interfaces) and I'd rather not put too much source in a publicly visible location.

      I tried setting com.isomorphic.base.Reflection to "debug" in log4j.isc.config.xml but that didn't provide any additional info about which method/member is causing the problem.

      Comment


        #4
        In 2.5p, that line is a comment. If you have a new trace from your new build, please post it.

        Comment


          #5
          Here's the latest stack trace
          Code:
          === 2012-03-20 20:26:08,633 [2-34] WARN  BasicDataSource - Exception trying to invoke DataSourceTools method
          java.lang.NullPointerException
          	at com.isomorphic.base.Reflection.getBeanFields(Reflection.java:1562)
          	at com.isomorphic.tools.DataSourceTools._getDataSourceConfigFromJavaClass(DataSourceTools.java:152)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          	at java.lang.reflect.Method.invoke(Unknown Source)
          	at com.isomorphic.base.Reflection.invokeStaticMethod(Reflection.java:712)
          	at com.isomorphic.base.Reflection.invokeNonVisibleStaticMethod(Reflection.java:687)
          	at com.isomorphic.datasource.BasicDataSource.createAutoDeriveDS(BasicDataSource.java:511)
          	at com.isomorphic.datasource.BasicDataSource.init(BasicDataSource.java:208)
          	at com.isomorphic.datasource.DataSource.initialize(DataSource.java:363)
          	at com.isomorphic.datasource.BasicDataSource.fromConfig(BasicDataSource.java:165)
          	at com.isomorphic.datasource.DataSource.fromConfig(DataSource.java:348)
          	at com.isomorphic.datasource.FileSystemDSRepo.loadDS(FileSystemDSRepo.java:110)
          	at com.isomorphic.datasource.DataSource.forName(DataSource.java:167)
          	at com.isomorphic.datasource.DataSource.forName(DataSource.java:159)
          	at com.isomorphic.datasource.DataSource.forName(DataSource.java:154)
          	at com.isomorphic.datasource.PoolableDataSourceFactory.makeUnpooledObject(PoolableDataSourceFactory.java:95)
          	at com.isomorphic.datasource.PoolableDataSourceFactory.makeObject(PoolableDataSourceFactory.java:102)
          	at com.isomorphic.pool.PoolManager.borrowObject(PoolManager.java:82)
          	at com.isomorphic.datasource.DataSourceManager.getDataSource(DataSourceManager.java:87)
          	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:107)
          	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:83)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
          	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
          	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1360)
          	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
          	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
          	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
          	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
          	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
          	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
          	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
          	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
          	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
          	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
          	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
          	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
          	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
          	at org.eclipse.jetty.server.Server.handle(Server.java:349)
          	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
          	at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:884)
          	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:938)
          	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
          	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
          	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
          	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
          	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
          	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
          	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
          	at java.lang.Thread.run(Unknown Source)

          Comment


            #6
            Does your bean class have a method that starts with "get" or "is" and has arguments as parameters? i.e a method that is not a Java Bean accessor. Or a method that starts with "set" and has more than one parameter?

            Comment


              #7
              Yes, I have two methods called getAndSetXxx(yyy), which do atomic sets.
              Also a number of getters/setters that take an index integer for accessing a table of values within the object.
              Does 3.0 know enough to ignore getters/setters that don't satisfy it's needs (or that are excluded from the ds.xml file)?
              Although it's easy to refactor the method names, I'd prefer not to because they make sense in their context and they conform to our established naming conventions.
              Last edited by evanross; 21 Mar 2012, 05:12.

              Comment


                #8
                This turns out to be because Java Reflection returns an IndexedPropertyDescriptor for methods that look like a getter but accept an int parameter; for whatever reason, descriptors of this class return null when asked for the associated attribute type.

                We have fixed this for 2.5p, 3.0p and 3.1d - your non-standard getXxxxx() methods will now just be skipped. The change will be present in tomorrow's nightly builds.

                Comment

                Working...
                X