Announcement

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

    BasicDataSource ClassCastException

    This is a bastard. Only happens on the deployed version, in hosted mode and when running on the local machine in 'non-hosted' it is fine.

    Any ideas what could be causing this? It crashes inside the DataSourceLoader.

    Code:
    GET http://**SNIPPED**/live/sc/DataSource...tions%3E%3C%2Ftransaction%3E&protocolVersion=1.0
    GET http://**SNIPPED**.appspot.com/live/sc/DataSourceLoader?dataSource=event_DataSource,eventConversation_DataSource&isc_rpc=1&isc_v=SC_SNAPSHOT-2011-06-30&isc_xhr=1&isc_tnum=0&_transaction=%3Ctransaction%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum%20xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FtransactionNum%3E%3Coperations%20xsi%3Atype%3D%22xsd%3AList%22%3E%3Celem%3E__ISC_NULL__%3C%2Felem%3E%3C%2Foperations%3E%3C%2Ftransaction%3E&protocolVersion=1.0
    	
    200 OK
    		2.45s	
    ISC_Core.js (line 1274)
    ParamsHeadersPostPutResponseCacheHTML
    
    {
        ID:"event_DataSource",
        mappedBeanClass:"com.live.shared.data.Event",
        inheritsFrom:isc.DataSource.create({
            xmlFromConfig:"true",
            ID:"event_DataSource_inheritsFrom",
            dataSourceVersion:"1",
            serverType:"generic",
            generatedBy:"SC_SNAPSHOT-2011-06-30/Pro Deployment 2011-06-30",
            fields:[
                {
                    name:"id",
                    type:"integer"
                },
                {
                    name:"location",
                    type:"text"
                },
                {
                    name:"name",
                    type:"text"
                },
                {
                    name:"image",
                    type:"text"
                },
                {
                    name:"date",
                    type:"date"
                }
            ]
        })
    ,
        fields:[
            {
                displayField:"name",
                hidden:"true",
                name:"id",
                primaryKey:"true",
                type:"sequence"
            }
        ]
    }<BR>BaseServlet Global Exception<BR>
    <PRE>
    javax.servlet.ServletException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
    	at com.isomorphic.datasource.BasicDataSource.buildFieldData(BasicDataSource.java:662)
    	at com.isomorphic.datasource.BasicDataSource.init(BasicDataSource.java:218)
    	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:617)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    	at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    	at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:249)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:326)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    	at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    	at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
    	at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:260)
    	at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9673)
    	at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:422)
    	at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
    	at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
    	at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
    	at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
    	at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
    	at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    	at java.lang.Thread.run(Thread.java:636)
    
    	at com.isomorphic.servlet.DataSourceLoader.processRequest(DataSourceLoader.java:115)
    	at com.isomorphic.servlet.DataSourceLoader.doGet(DataSourceLoader.java:83)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    	at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    	at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:249)
    	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    	at org.mortbay.jetty.Server.handle(Server.java:326)
    	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    	at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
    	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    	at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
    	at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:260)
    	at com.google.apphosting.base.RuntimePb$EvaluationRuntime$2.handleRequest(RuntimePb.java:9673)
    	at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:422)
    	at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:573)
    	at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:448)
    	at com.google.tracing.TraceContext.runInContext(TraceContext.java:688)
    	at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:326)
    	at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:318)
    	at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:446)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    	at java.lang.Thread.run(Thread.java:636)
    </PRE>

    This is the datasource definition. ObjectifyDataSource extends BasicDataSource datasource.

    Code:
    <DataSource ID="event_DataSource" serverConstructor="com.live.server.services.ObjectifyDataSource"
    	mappedBeanClass="com.live.shared.data.Event">
    	<fields>
    		<field name="id" type="sequence" hidden="true" primaryKey="true" />
    		<field name="date" type="datetime" />
    		<field name="name" type="text" />
    		<field name="image" type="text" />
    		<field name="location" type="text" />
    	</fields>
    </DataSource>

    And for completeness, here is the class
    Code:
    package com.live.shared.data;
    
    import java.util.Date;
    
    import javax.persistence.Id;
    
    public class Event {
    
    	public static final String NAME = "name";
    
    	public static final String ID = "id";
    
    	@Id
    	Long id;
    
    	private Date date;
    
    	private String name;
    
    	private String image;
    
    	private String location;
    
    	public Long getId() {
    		return id;
    	}
    
    	public void setId(Long id) {
    		this.id = id;
    	}
    
    	public Date getDate() {
    		return date;
    	}
    
    	public void setDate(Date date) {
    		this.date = date;
    	}
    
    	public String getImage() {
    		return image;
    	}
    
    	public void setImage(String image) {
    		this.image = image;
    	}
    
    	public void setName(String name) {
    		this.name = name;
    	}
    
    	public String getName() {
    		return name;
    	}
    
    	public void setLocation(String location) {
    		this.location = location;
    	}
    
    	public String getLocation() {
    		return location;
    	}
    }

    #2
    Typically this means the schema files in sc/system/schema within smartgwtee.jar are not present or unreadable.

    Comment


      #3
      Thanks for the quick response. The read failure makes sense. One of the annoyances of the app-engine dev environment is it does not enforce permissions the same way. All fixed now.

      Comment

      Working...
      X