Announcement

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

    RequestContext is missing the ServletContext

    Hi,

    I am new to this framework and if any body can help that would be greatly appreciated.

    What i doing is calling calling a method with DMI(below is sample code ).
    when i try to open this file from visual builder datasource it keep giving below error.

    sp threw exception
    java.lang.Exception: RequestContext is missing the ServletContext. Please ensur
    e you privide either a PageContext, a Servlet, or a ServletContext to your Reque
    stContex.instance() call.
    at com.isomorphic.rpc.ServerObject.<init>(ServerObject.java:210)
    at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:29
    8)
    at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:62
    )
    at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1172)
    at org.apache.jsp.tools.visualBuilder.vbOperations_jsp._jspService(vbOpe
    rations_jsp.java:97)


    Datasource
    <DataSource
    ID="quartzSpringDMI"
    serverType="generic"
    >
    <fields>
    <field name="jobGroupName" type="text" length="20"/>
    </fields>

    <serverObject lookupStyle="spring" bean="jobGroupDao"/>

    <operationBindings>
    <binding operationType="fetch" serverMethod="fetch">
    <serverObject lookupStyle="spring" bean="jobGroupDao"/>
    </binding>
    </operationBindings>
    </DataSource>

    #2
    This suggests that you did not include the Init servlet in your web.xml. See the Deploying SmartClient instructions in the SmartClient Reference.

    Comment


      #3
      I did

      Here is looks like

      <servlet>
      <servlet-name>Init</servlet-name>
      <servlet-class>com.isomorphic.base.Init</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>

      What i also noticed is if i remove below line from the file it can be opened in visualbuilder

      <serverObject lookupStyle="spring" bean="jobGroupDao"/>
      Last edited by smileforever; 25 Nov 2009, 12:24.

      Comment


        #4
        This turns out to be a bug caused by the way we're constructing the RPCManager in the specific case of Spring dataSources in Visual Builder. This is now fixed. We'd like to come up with a workaround for you - can you please let me know the exact version number of SmartClient or SmartGWT you're working with?

        Comment


          #5
          RequestContext

          I using version SmartClient_70rc2_Evaluation and spring framework version 2.0.6.


          Can i get update on this bug fix Its urgent. I need to show POC for the project which i am working.

          Thanks in advance.
          Last edited by smileforever; 27 Nov 2009, 11:43.

          Comment


            #6
            You should be able to work around this by editing the file "index.jsp" in your tools/visualBuilder folder. Around about line 24 you should see this line:

            Code:
            RPCManager.actionURL = Page.getAppDir() + "vbOperations.jsp";
            Remove or comment out that line, then restart your server and try again. Please let us know whether or not that works around the issue.

            Thanks
            Isomorphic Software Support

            Comment


              #7
              RequestContext

              After Commenting that line and restarted my server I am getting new error

              "Could not find a public method named: loadSchema on class com.isomorphic.examples.supplyItemDMI.

              Let me know if you need any additional information.

              Thanks.

              StackTrace :-

              java.lang.Exception: Couldn't find a public method named: loadSchema on class: c
              om.isomorphic.examples.SupplyItemDMI
              at com.isomorphic.rpc.ServerObject.findMethod(ServerObject.java:270)
              at com.isomorphic.rpc.ServerObject.getMethod(ServerObject.java:253)
              at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:30
              5)
              at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:62
              )
              at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1172)
              at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155)
              at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106)
              at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
              at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
              at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
              (StubSecurityHelper.java:226)
              at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
              tyHelper.java:124)
              at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
              a:283)
              at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
              at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
              va:42)
              at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.j
              ava:248)
              at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
              va:42)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
              n.run(WebAppServletContext.java:3393)
              at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
              dSubject.java:321)
              at weblogic.security.service.SecurityManager.runAs(Unknown Source)
              at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
              ervletContext.java:2140)
              at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
              ontext.java:2046)
              at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
              ava:1366)
              at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
              at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

              Comment


                #8
                When and how are you getting that?

                This error doesn't really make sense if the indicated change was the only change you made, but if you're somehow getting it, you can just remove that particular sample DataSource (from webroot/examples/shared/ds), or, remove all of them.

                Comment


                  #9
                  RequestContext is missing the ServletContext

                  Yes It doen't make sense. I also noticed that specific case of Spring dataSources it looks for loadschema method. For testing purpose i created a method in that class and started my server in debug mode and it is hitting that method when i try to add datasouce through visual Builder.

                  Comment


                    #10
                    So can you clarify how you're getting this error - you're going through one of the Visual Builder wizards for adding a new DataSource? Which one?

                    Comment


                      #11
                      RequestContext

                      When i try to add below datasouce to listgrid from visualBuilder i am getting that error.

                      All i need is from spring bean i call a method to get list of value and that values should set dynamically to listgrid. can u tell me how to do that or if possible sample code?
                      Last edited by smileforever; 30 Nov 2009, 10:24.

                      Comment


                        #12
                        When you say "All I need is...", do you mean you need to actually do this in Visual Builder, or do you mean you just want to know how to bind the ListGrid to the DataSource in SmartClient?

                        If the latter, there is extensive documentation (try scanning for databinding or DataBoundComponent), but a quick start would be:

                        isc.ListGrid.create({
                        ID: "myListGrid",
                        dataSource: quartzSpringDMI,
                        useAllDataSourceFields: true,
                        autoFetchData: true
                        });

                        Ensure you have loaded the dataSource first.

                        Comment

                        Working...
                        X