You are not logged in.
Pages: 1
Hello,
Using Postgresql I want to define a certain text field in the SQL.
A simple variant is this :
select
'some text' as label,
field1 as naam
from public.test_table
This is working oke in pgadmin and other SQL tools but when I add this to the SQL query in a dynamic list I get an error.
any help is appreciated.
Here is the error text:
net.datenwerke.gxtdto.client.servercommunication.exceptions.NonFatalException: The report could not be executed: Could not map 1111 to a java class
<br> at net.datenwerke.rs.base.server.table.TableReportUtilityServiceImpl.loadColumnDefinition(TableReportUtilityServiceImpl.java:283)
<br> at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
<br> at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
<br> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<br> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
<br> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
<br> at java.lang.reflect.Method.invoke(Unknown Source)
<br> at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
<br> at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
<br> at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
<br> at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
<br> at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
<br> at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
<br> at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
<br> at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
<br> at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
<br> at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
<br> at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
<br> at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
<br> at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:89)
<br> at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
<br> at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
<br> at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
<br> at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
<br> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
<br> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
<br> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
<br> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
<br> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
<br> at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
<br> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
<br> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
<br> at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:188)
<br> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
<br> at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
<br> at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
<br> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
<br> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
<br> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
<br> at java.lang.Thread.run(Unknown Source)
<br>Caused by: net.datenwerke.rs.core.service.reportmanager.exceptions.ReportExecutorException: The report could not be executed: Could not map 1111 to a java class
<br> at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:218)
<br> at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:119)
<br> at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:106)
<br> at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:101)
<br> at net.datenwerke.rs.base.service.reportengines.table.TableReportUtilsImpl.getReturnedColumns(TableReportUtilsImpl.java:180)
<br> at net.datenwerke.rs.base.service.reportengines.table.TableReportUtilsImpl.getReturnedPlainColumns(TableReportUtilsImpl.java:144)
<br> at net.datenwerke.rs.base.server.table.TableReportUtilityServiceImpl.loadColumnDefinition(TableReportUtilityServiceImpl.java:279)
<br> ... 43 more
<br>Caused by: java.lang.IllegalArgumentException: Could not map 1111 to a java class
<br> at net.datenwerke.rs.base.service.dbhelper.DatabaseHelper.mapSQLTypeToJava(DatabaseHelper.java:356)
<br> at net.datenwerke.rs.base.service.reportengines.table.output.object.TableDefinition.fromResultSetMetaData(TableDefinition.java:108)
<br> at net.datenwerke.rs.base.service.datasources.table.impl.TableDBDataSource.open(TableDBDataSource.java:269)
<br> at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.createReport(TableReportEngine.java:254)
<br> at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecuteNormal(TableReportEngine.java:187)
<br> at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecuteNormal(TableReportEngine.java:148)
<br> at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecute(TableReportEngine.java:90)
<br> at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:127)
<br> at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:186)
<br> ... 49 more
<br>
Last edited by jar (2016-03-23 19:30:43)
Offline
Hi,
PostgreSQL seems to handle string constants somewhat differently than other databases. It declares the type towards java as 1111 (meaning "OTHER"). To get this working it should be sufficient to do an explicit typecast, i.e.,
select
cast('some text' as varchar) as label,
field1 as naam
from public.test_table
Cheers,
Arno
Offline
Pages: 1