Missing Context in related request using DMI datasource and lookuptype spring.
I am getting the error "RequestContext is missing the ServletContext. Please ensure you privide either a PageContext, a Servlet, or a ServletContext to your RequestContex.instance() call."
I am running latest patch of 3.0 (SmartClient Version: v8.2p_2012-09-19/Pro Deployment (built 2012-09-19))
I have two related datasources, bound by foreignkey. The first datasource contains these fields.
Each datasource has its own DMI Datasource class.
When using spring to load the dmi datasource classes, RequestContext complains that the context is missing when smartgwt server tries to fetch the related values from the dokmal datasource. When using lookupStyle new there is no error, even though I can see that the DSRequest.context is null on entering the dokmal dmi fetch metchod also in this case.
While using the dokmal datasource as a optiondatasource in the client (DSRequest.isClientRequest=true) there is no problem.
As you can see from the server logs, the first (client) request to dokmal works perfectly well, but the next, when dokmal is part of a related ds request, fails.
As a sidenote, I implemented the SmartClientInitListener as mentioned in an earlier post, but this did not change the behaviour.
Thanks in advance,
Regards
Hans Petter Simonsen - Evry Norway
I am getting the error "RequestContext is missing the ServletContext. Please ensure you privide either a PageContext, a Servlet, or a ServletContext to your RequestContex.instance() call."
I am running latest patch of 3.0 (SmartClient Version: v8.2p_2012-09-19/Pro Deployment (built 2012-09-19))
I have two related datasources, bound by foreignkey. The first datasource contains these fields.
Code:
<field name="dokmal" foreignKey="dokmal.kode"/> <field name="dokmalBetegn" includeFrom="dokmal.betegn"/> <field name="ndoktype" includeFrom="dokmal.ndoktype"/> <field name="ejfid" includeFrom="dokmal.efjid"/> <field name="art" includeFrom="dokmal.jpart"/>
When using spring to load the dmi datasource classes, RequestContext complains that the context is missing when smartgwt server tries to fetch the related values from the dokmal datasource. When using lookupStyle new there is no error, even though I can see that the DSRequest.context is null on entering the dokmal dmi fetch metchod also in this case.
While using the dokmal datasource as a optiondatasource in the client (DSRequest.isClientRequest=true) there is no problem.
As you can see from the server logs, the first (client) request to dokmal works perfectly well, but the next, when dokmal is part of a related ds request, fails.
Code:
=== 2012-09-20 13:29:25,447 [0-23] INFO IDACall - Performing 1 operation(s) === 2012-09-20 13:29:25,447 [0-23] INFO ServerObject - DMI on Spring bean: hjelperegisterDMI === 2012-09-20 13:29:25,430 [0-19] INFO RequestContext - URL: '/esa-ui/com.edb.esa.EsaUI/sc/IDACall', User-Agent: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)': MSIE with Accept-Encoding header, ready for compressed JS === 2012-09-20 13:29:25,452 [0-19] DEBUG XML - Parsed XML from (in memory stream): 2ms === 2012-09-20 13:29:25,452 [0-19] DEBUG RPCManager - Processing 1 requests. === 2012-09-20 13:29:25,456 [0-19] DEBUG RPCManager - Request #1 (DSRequest) payload: { criteria:{ said:1000002, createJournpostType:"SAIDONLY" }, operationConfig:{ dataSource:"journpostNew", operationType:"fetch" }, appID:"builtinApplication", operation:"template", oldValues:{ said:1000002, createJournpostType:"SAIDONLY" } } === 2012-09-20 13:29:25,456 [0-19] INFO IDACall - Performing 1 operation(s) === 2012-09-20 13:29:25,456 [0-19] WARN DataSourceDMI - DataSource journpostNew: received a request to execute an operation of type 'fetch' named 'template', but this operation is not defined to the dataSource. Falling back to default behavior for operationType 'fetch' === 2012-09-20 13:29:25,456 [0-19] INFO ServerObject - DMI on Spring bean: createJournpostDMI === 2012-09-20 13:29:34,722 [0-23] INFO DSResponse - DSResponse: List with 28 items === 2012-09-20 13:29:34,722 [0-23] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8 === 2012-09-20 13:29:34,722 [0-23] DEBUG RPCManager - DMI response, dropExtraFields: true === 2012-09-20 13:29:41,605 [0-19] INFO DSResponse - DSResponse: List with 1 items === 2012-09-20 13:29:41,605 [0-19] INFO ServerObject - DMI on Spring bean: hjelperegisterDMI === 2012-09-20 13:29:41,605 [0-19] WARN DataSourceDMI - Failed to create serverObject using operation level config. Will try to use DataSource level config instead. Actual error: RequestContext is missing the ServletContext. Please ensure you privide either a PageContext, a Servlet, or a ServletContext to your RequestContex.instance() call. === 2012-09-20 13:29:41,605 [0-19] INFO ServerObject - DMI on Spring bean: hjelperegisterDMI === 2012-09-20 13:29:41,605 [0-19] WARN RequestContext - dsRequest.execute() failed: java.lang.Exception: RequestContext is missing the ServletContext. Please ensure you privide either a PageContext, a Servlet, or a ServletContext to your RequestContex.instance() call. at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:225) at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:70) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:206) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:64) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1951) at com.isomorphic.datasource.DSRequest.applyRelatedDSRequest(DSRequest.java:4043) at com.isomorphic.datasource.DSRequest.fetchRelatedValues(DSRequest.java:3929) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1964) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199) at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 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:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
Thanks in advance,
Regards
Hans Petter Simonsen - Evry Norway
Comment