Quantcast

Result type = json error unknown location

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Result type = json error unknown location

Cesar Lopez
Hi!

I try doing the Grid example of Struts2 jQuery Plugin Showcase page:
http://struts.jgeppert.com/struts2-jquery-showcase/index.action

but when I want to start apache server, it display the following
error:

SEVERE: Dispatcher initialization failed
Unable to load configuration. - [unknown location]
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:
69)
        at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:
390)
        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
        at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:
69)
        at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:
51)
        at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:
295)
        at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:
422)
        at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:
115)
        at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:
4072)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4726)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
463)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:
525)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:
754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: The Result type [json] which is defined in the Result
annotation on the class [class
com.gemalto.xcelerator.tt.actions.competition.LoadGridCompetitionsAction]
or determined by the file extension or is the default result type for
the PackageConfig of the action, could not be found as a result-type
defined for the Struts/XWork package
[com.gemalto.xcelerator.tt.actions.competition#convention-
default#concurso] - [unknown location]
        at
org.apache.struts2.convention.DefaultResultMapBuilder.createResultConfig(DefaultResultMapBuilder.java:
438)
        at
org.apache.struts2.convention.DefaultResultMapBuilder.createFromAnnotations(DefaultResultMapBuilder.java:
410)
        at
org.apache.struts2.convention.DefaultResultMapBuilder.build(DefaultResultMapBuilder.java:
202)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.createActionConfig(PackageBasedActionConfigBuilder.java:
864)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfiguration(PackageBasedActionConfigBuilder.java:
650)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:
335)
        at
org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:
53)
        at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:
215)
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:
66)
        ... 22 more

jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - [unknown location]
        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:449)
        at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:
69)
        at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:
51)
        at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:
295)
        at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:
422)
        at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:
115)
        at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:
4072)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4726)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
463)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:
525)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:
754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: Unable to load configuration. - [unknown location]
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:
69)
        at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:
390)
        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
        ... 20 more
Caused by: The Result type [json] which is defined in the Result
annotation on the class [class
com.gemalto.xcelerator.tt.actions.competition.LoadGridCompetitionsAction]
or determined by the file extension or is the default result type for
the PackageConfig of the action, could not be found as a result-type
defined for the Struts/XWork package
[com.gemalto.xcelerator.tt.actions.competition#convention-
default#concurso] - [unknown location]
        at
org.apache.struts2.convention.DefaultResultMapBuilder.createResultConfig(DefaultResultMapBuilder.java:
438)
        at
org.apache.struts2.convention.DefaultResultMapBuilder.createFromAnnotations(DefaultResultMapBuilder.java:
410)
        at
org.apache.struts2.convention.DefaultResultMapBuilder.build(DefaultResultMapBuilder.java:
202)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.createActionConfig(PackageBasedActionConfigBuilder.java:
864)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfiguration(PackageBasedActionConfigBuilder.java:
650)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:
335)
        at
org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:
53)
        at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:
215)
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:
66)
        ... 22 more

jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
start
SEVERE: Error filterStart
jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
start
SEVERE: Context [/XceleratorTTII] startup failed due to previous
errors
jun 05, 2012 12:23:12 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: The web application [/XceleratorTTII] created a ThreadLocal
with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10]
(value [com.opensymphony.xwork2.inject.ContainerImpl$10@182f0c6]) and
a value of type [java.lang.Object[]] (value
[[Ljava.lang.Object;@18d708f]) but failed to remove it when the web
application was stopped. This is very likely to create a memory leak.
jun 05, 2012 12:23:12 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: The web application [/XceleratorTTII] created a ThreadLocal
with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10]
(value [com.opensymphony.xwork2.inject.ContainerImpl$10@d8c235]) and a
value of type [java.lang.Object[]] (value
[[Ljava.lang.Object;@b6607a]) but failed to remove it when the web
application was stopped. This is very likely to create a memory leak.
jun 05, 2012 12:23:12 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
jun 05, 2012 12:23:13 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
jun 05, 2012 12:23:13 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16  config=null
jun 05, 2012 12:23:13 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1103 ms

===============================================================================
jsp
===============================================================================
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@taglib uri="/struts-tags" prefix="s" %>
<%@taglib uri="/struts-jquery-tags" prefix="sj" %>
<%@taglib uri="/struts-jquery-grid-tags" prefix="sjg" %>

<!DOCTYPE html PUBLIC
        "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
        <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
        <link href="../css/xcelerator.css" rel="stylesheet"  type="text/
css">
        <title></title>
</head>
<body>
        <!-- Header -->
        <div id="cabecera">
                <center><div id="header"></div></center>
        </div>
        <!-- END Header -->

        <!-- Menu -->
        <div id="menu">
                <div class="menu">
                        <s:property value="#session.menu"  escapeHtml=""  />
                </div>
        </div>
        <!-- END Menu -->

        <!-- BEGIN Contenido -->
        <div id="contenido">
                <s:url id="remoteurl" action="loadGridConcurso" namespace="/
concurso" />
                <sjg:grid
                        id="gridTable"
                        caption="Concursos"
                        dataType="json"
                        href="%{remoteurl}"
                        pager="true"
                        gridModel="gridModel"
                        rowList="10,15,20"
                        rowNum="10"
                        rownumbers="true"
                >
                        <!-- El "name" de cada columna debe coincidir con cada atributo del
objeto Bean (UserTO) que representa cada registro de la tabla -->
                        <sjg:gridColumn name="idConcurso" index="idConcurso" title="no.
Concurso" sortable="true"/>
                        <sjg:gridColumn name="nombre" index="nombre" title="nombre del
concurso" sortable="true" />
                </sjg:grid>

        </div>
        <!-- END Contenido -->

        <!-- BEGIN Footer -->
        <div id="footer">
                <div id="logo_footer"></div>
        </div>
        <!-- END Footer -->
</body>
</html>
===============================================================================


===============================================================================
Action
===============================================================================
package com.gemalto.xcelerator.tt.actions.competition;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.interceptor.SessionAware;

import com.gemalto.xcelerator.beans.CompetitionBean;
import com.gemalto.xcelerator.tt.bos.competition.CompetitionBO;
import com.opensymphony.xwork2.ActionSupport;

@Namespace(value="concurso")
public class LoadGridCompetitionsAction extends ActionSupport
implements SessionAware {

        private static final long serialVersionUID = 1L;

        private Map<String,Object>sesion;
        private Log log;

        /** lista de resultados */
        private List<CompetitionBean> gridModel;

        /** lista temporal */
        private List<CompetitionBean> myCompetition;

        /** Número de filas que queremos tener dentro del grid - atributo
"rowNum" del grid */
    private Integer rows = 0;

    /** Página actual. Por defecto el grid lo pone en 1 */
    private Integer page = 0;

    /** Páginas totales */
    private Integer total = 0;

    /** todos los registros (PUEDE LLAMARSE record) */
    private Integer record = 0;

   /** Orden - asc o desc */
    private String sord;

    /** Índice de la fila - i.e. click del usuario para ordenar */
    private String sidx;

    /** campo de búsqueda */
    private String searchField;

    /** cadena de búsqueda*/
    private String searchString;

    /** La operación de búsqueda
['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
*/
    private String searchOper;

    @SuppressWarnings("unused")
        private boolean loadonce = false;

        public LoadGridCompetitionsAction() {
                log= LogFactory.getLog(LoadGridCompetitionsAction.class);
        }

        @Override
        @Action(value="loadGridConcurso",
                        results={
                                @Result(name = "success", type = "json")
                        }
        )
        public String execute() throws Exception {
                if(sesion.size()==0)
                        return ERROR;
                else{
                        log.debug("Page " + getPage()+" Rows " + getRows() +" Sorting Order
"+ getSord()+" Index Row :" + getSidx());
                    log.debug("Search :" + searchField + " " + searchOper + " " +
searchString);

                    //Número de registros(Select count(*) from users)
            setRecord(new CompetitionBO().count());

            //Calcula HASTA qué registro será la consulta, suponiendo
que rows=10....
            int to = (getRows() * getPage());//.....la primera vez
to=10  (10*1)

            //Calcula DESDE qué registro se hará la consulta...
            int from = to - getRows();//....from=0  (10-10)

            //si la variable "to" sobrepasa el número de registros
disponible, entonces le ponemos ese valor máximo de registros.
            if(to>getRecord())to=getRecord();

            //Utilizamos este List temporal para almacenar cada Objeto
UserTO (Registro) que devolvió la consulta
            myCompetition = new
CompetitionBO().getCompetitionGridLis(from, to);

            //Le pasamos ese List lleno al List "gridModel", que es el
que finalmente ocupará el JQGrid para dibujar la tabla..
            setGridModel(myCompetition);

          //calcula el total de páginas que genera la consulta
            total = (int) Math.ceil((double) getRecord() / (double)
getRows());

                        return SUCCESS;
                }
        }

        public void setSession(Map<String, Object> session) {
                sesion=session;
        }

        public String getJSON() throws Exception{
        return execute();
        }

        /*
         * Getters and Setters
         */
        /**
           * @return how many rows we want to have into the grid
           */
          public Integer getRows()
          {
            return rows;
          }

          /**
           * @param rows
           *          how many rows we want to have into the grid
           */
          public void setRows(Integer rows)
          {
            this.rows = rows;
          }

          /**
           * @return current page of the query
           */
          public Integer getPage()
          {
            return page;
          }

          /**
           * @param page
           *          current page of the query
           */
          public void setPage(Integer page)
          {
            this.page = page;
          }

          /**
           * @return total pages for the query
           */
          public Integer getTotal()
          {
            return total;
          }

          /**
           * @param total
           *          total pages for the query
           */
          public void setTotal(Integer total)
          {
            this.total = total;
          }

          /**
           * @return total number of records for the query. e.g. select
count(*) from
           *         table
           */
          public Integer getRecord()
          {
            return record;
          }

          /**
           * @param record
           *          total number of records for the query. e.g. select
count(*) from
           *          table
           */
          public void setRecord(Integer record)
          {

            this.record = record;

            if (this.record > 0 && this.rows > 0)
            {
              this.total = (int) Math.ceil((double) this.record / (double)
this.rows);
            }
            else
            {
              this.total = 0;
            }
          }

          /**
           * @return an collection that contains the actual data
           */
          public List<CompetitionBean> getGridModel()
          {
            return gridModel;
          }

          /**
           * @param gridModel
           *          an collection that contains the actual data
           */
          public void setGridModel(List<CompetitionBean> gridModel)
          {
            this.gridModel = gridModel;
          }

          /**
           * @return sorting order
           */
          public String getSord()
          {
            return sord;
          }

          /**
           * @param sord
           *          sorting order
           */
          public void setSord(String sord)
          {
            this.sord = sord;
          }

          /**
           * @return get index row - i.e. user click to sort.
           */
          public String getSidx()
          {
            return sidx;
          }

          /**
           * @param sidx
           *          get index row - i.e. user click to sort.
           */
          public void setSidx(String sidx)
          {
            this.sidx = sidx;
          }

          public void setSearchField(String searchField)
          {
            this.searchField = searchField;
          }

          public void setSearchString(String searchString)
          {
            this.searchString = searchString;
          }

          public void setSearchOper(String searchOper)
          {
            this.searchOper = searchOper;
          }

          public void setLoadonce(boolean loadonce)
          {
            this.loadonce = loadonce;
          }

}
===============================================================================
I'm using eclipce indigo IDE
I have the following jars included in /WEB-INF/lib folder and also add
a user library witrh the same jars:

asm-3.3.jar
asm-commons-3.3.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
freemarker-2.3.18.jar
javassist-3.11.0.GA.jar
mysql-connector-java-5.1.20-bin.jar
ognl-3.0.4.jar
servlet-api.jar
struts2-convention-plugin-2.3.1.2.jar
struts2-core-2.3.1.2.jar
struts2-jquery-plugin-3.3.1.jar
struts2-json-plugin-2.3.1.2.jar
xwork-core-2.3.1.2.jar
struts2-jquery-grid-plugin-3.3.1.jar
json-lib-2.3-jdk15.jar

Do I need others jar?

Can you give a list of jars that works OK with struts2 and json and
jqgrid ?

Regards!

--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Result type = json error unknown location

imbe
For json plugin work you need:
 commons-lang3-3.1.jar
I had a similar problem, and it solved the problem!

Successfully



-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Cesar Lopez
Sent: Tuesday, June 05, 2012 8:56 PM
To: struts2-jquery
Subject: [struts2-jquery] Result type = json error unknown location

Hi!

I try doing the Grid example of Struts2 jQuery Plugin Showcase page:
http://struts.jgeppert.com/struts2-jquery-showcase/index.action

but when I want to start apache server, it display the following
error:

SEVERE: Dispatcher initialization failed Unable to load configuration. -
[unknown location]
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rationManager.java:
69)
        at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatche
r.java:
390)
        at
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
        at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperation
s.java:
69)
        at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(S
trutsPrepareAndExecuteFilter.java:
51)
        at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilter
Config.java:
295)
        at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFil
terConfig.java:
422)
        at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterCon
fig.java:
115)
        at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:
4072)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4726)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
463)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:
525)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:
754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: The Result type [json] which is defined in the Result annotation
on the class [class
com.gemalto.xcelerator.tt.actions.competition.LoadGridCompetitionsAction]
or determined by the file extension or is the default result type for the
PackageConfig of the action, could not be found as a result-type defined for
the Struts/XWork package
[com.gemalto.xcelerator.tt.actions.competition#convention-
default#concurso] - [unknown location]
        at
org.apache.struts2.convention.DefaultResultMapBuilder.createResultConfig(Def
aultResultMapBuilder.java:
438)
        at
org.apache.struts2.convention.DefaultResultMapBuilder.createFromAnnotations(
DefaultResultMapBuilder.java:
410)
        at
org.apache.struts2.convention.DefaultResultMapBuilder.build(DefaultResultMap
Builder.java:
202)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.createActionCo
nfig(PackageBasedActionConfigBuilder.java:
864)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfigura
tion(PackageBasedActionConfigBuilder.java:
650)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionCon
figs(PackageBasedActionConfigBuilder.java:
335)
        at
org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(Classpat
hPackageProvider.java:
53)
        at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(Def
aultConfiguration.java:
215)
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rationManager.java:
66)
        ... 22 more

jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
filterStart
SEVERE: Exception starting filter struts2 Unable to load configuration. -
[unknown location]
        at
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:449)
        at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperation
s.java:
69)
        at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(S
trutsPrepareAndExecuteFilter.java:
51)
        at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilter
Config.java:
295)
        at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFil
terConfig.java:
422)
        at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterCon
fig.java:
115)
        at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:
4072)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4726)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1057)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
463)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:
525)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:
754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: Unable to load configuration. - [unknown location]
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rationManager.java:
69)
        at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatche
r.java:
390)
        at
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
        ... 20 more
Caused by: The Result type [json] which is defined in the Result annotation
on the class [class
com.gemalto.xcelerator.tt.actions.competition.LoadGridCompetitionsAction]
or determined by the file extension or is the default result type for the
PackageConfig of the action, could not be found as a result-type defined for
the Struts/XWork package
[com.gemalto.xcelerator.tt.actions.competition#convention-
default#concurso] - [unknown location]
        at
org.apache.struts2.convention.DefaultResultMapBuilder.createResultConfig(Def
aultResultMapBuilder.java:
438)
        at
org.apache.struts2.convention.DefaultResultMapBuilder.createFromAnnotations(
DefaultResultMapBuilder.java:
410)
        at
org.apache.struts2.convention.DefaultResultMapBuilder.build(DefaultResultMap
Builder.java:
202)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.createActionCo
nfig(PackageBasedActionConfigBuilder.java:
864)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfigura
tion(PackageBasedActionConfigBuilder.java:
650)
        at
org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionCon
figs(PackageBasedActionConfigBuilder.java:
335)
        at
org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(Classpat
hPackageProvider.java:
53)
        at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(Def
aultConfiguration.java:
215)
        at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rationManager.java:
66)
        ... 22 more

jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
start
SEVERE: Error filterStart
jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
start
SEVERE: Context [/XceleratorTTII] startup failed due to previous errors jun
05, 2012 12:23:12 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: The web application [/XceleratorTTII] created a ThreadLocal with key
of type [com.opensymphony.xwork2.inject.ContainerImpl$10]
(value [com.opensymphony.xwork2.inject.ContainerImpl$10@182f0c6]) and a
value of type [java.lang.Object[]] (value
[[Ljava.lang.Object;@18d708f]) but failed to remove it when the web
application was stopped. This is very likely to create a memory leak.
jun 05, 2012 12:23:12 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: The web application [/XceleratorTTII] created a ThreadLocal with key
of type [com.opensymphony.xwork2.inject.ContainerImpl$10]
(value [com.opensymphony.xwork2.inject.ContainerImpl$10@d8c235]) and a value
of type [java.lang.Object[]] (value
[[Ljava.lang.Object;@b6607a]) but failed to remove it when the web
application was stopped. This is very likely to create a memory leak.
jun 05, 2012 12:23:12 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080 jun 05, 2012 12:23:13 PM
org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009 jun 05, 2012 12:23:13 PM
org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16  config=null jun 05, 2012 12:23:13 PM
org.apache.catalina.startup.Catalina start
INFO: Server startup in 1103 ms

============================================================================
===
jsp
============================================================================
===
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@taglib uri="/struts-tags" prefix="s" %> <%@taglib
uri="/struts-jquery-tags" prefix="sj" %> <%@taglib
uri="/struts-jquery-grid-tags" prefix="sjg" %>

<!DOCTYPE html PUBLIC
        "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
        <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
        <link href="../css/xcelerator.css" rel="stylesheet"  type="text/
css">
        <title></title>
</head>
<body>
        <!-- Header -->
        <div id="cabecera">
                <center><div id="header"></div></center>
        </div>
        <!-- END Header -->

        <!-- Menu -->
        <div id="menu">
                <div class="menu">
                        <s:property value="#session.menu"  escapeHtml=""  />
                </div>
        </div>
        <!-- END Menu -->

        <!-- BEGIN Contenido -->
        <div id="contenido">
                <s:url id="remoteurl" action="loadGridConcurso" namespace="/
concurso" />
                <sjg:grid
                        id="gridTable"
                        caption="Concursos"
                        dataType="json"
                        href="%{remoteurl}"
                        pager="true"
                        gridModel="gridModel"
                        rowList="10,15,20"
                        rowNum="10"
                        rownumbers="true"
                >
                        <!-- El "name" de cada columna debe coincidir con
cada atributo del objeto Bean (UserTO) que representa cada registro de la
tabla -->
                        <sjg:gridColumn name="idConcurso" index="idConcurso"
title="no.
Concurso" sortable="true"/>
                        <sjg:gridColumn name="nombre" index="nombre"
title="nombre del concurso" sortable="true" />
                </sjg:grid>

        </div>
        <!-- END Contenido -->

        <!-- BEGIN Footer -->
        <div id="footer">
                <div id="logo_footer"></div>
        </div>
        <!-- END Footer -->
</body>
</html>
============================================================================
===


============================================================================
===
Action
============================================================================
===
package com.gemalto.xcelerator.tt.actions.competition;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.interceptor.SessionAware;

import com.gemalto.xcelerator.beans.CompetitionBean;
import com.gemalto.xcelerator.tt.bos.competition.CompetitionBO;
import com.opensymphony.xwork2.ActionSupport;

@Namespace(value="concurso")
public class LoadGridCompetitionsAction extends ActionSupport implements
SessionAware {

        private static final long serialVersionUID = 1L;

        private Map<String,Object>sesion;
        private Log log;

        /** lista de resultados */
        private List<CompetitionBean> gridModel;

        /** lista temporal */
        private List<CompetitionBean> myCompetition;

        /** Número de filas que queremos tener dentro del grid - atributo
"rowNum" del grid */
    private Integer rows = 0;

    /** Página actual. Por defecto el grid lo pone en 1 */
    private Integer page = 0;

    /** Páginas totales */
    private Integer total = 0;

    /** todos los registros (PUEDE LLAMARSE record) */
    private Integer record = 0;

   /** Orden - asc o desc */
    private String sord;

    /** Índice de la fila - i.e. click del usuario para ordenar */
    private String sidx;

    /** campo de búsqueda */
    private String searchField;

    /** cadena de búsqueda*/
    private String searchString;

    /** La operación de búsqueda
['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
*/
    private String searchOper;

    @SuppressWarnings("unused")
        private boolean loadonce = false;

        public LoadGridCompetitionsAction() {
                log= LogFactory.getLog(LoadGridCompetitionsAction.class);
        }

        @Override
        @Action(value="loadGridConcurso",
                        results={
                                @Result(name = "success", type = "json")
                        }
        )
        public String execute() throws Exception {
                if(sesion.size()==0)
                        return ERROR;
                else{
                        log.debug("Page " + getPage()+" Rows " + getRows()
+" Sorting Order "+ getSord()+" Index Row :" + getSidx());
                    log.debug("Search :" + searchField + " " + searchOper +
" " + searchString);

                    //Número de registros(Select count(*) from users)
            setRecord(new CompetitionBO().count());

            //Calcula HASTA qué registro será la consulta, suponiendo que
rows=10....
            int to = (getRows() * getPage());//.....la primera vez
to=10  (10*1)

            //Calcula DESDE qué registro se hará la consulta...
            int from = to - getRows();//....from=0  (10-10)

            //si la variable "to" sobrepasa el número de registros
disponible, entonces le ponemos ese valor máximo de registros.
            if(to>getRecord())to=getRecord();

            //Utilizamos este List temporal para almacenar cada Objeto
UserTO (Registro) que devolvió la consulta
            myCompetition = new
CompetitionBO().getCompetitionGridLis(from, to);

            //Le pasamos ese List lleno al List "gridModel", que es el que
finalmente ocupará el JQGrid para dibujar la tabla..
            setGridModel(myCompetition);

          //calcula el total de páginas que genera la consulta
            total = (int) Math.ceil((double) getRecord() / (double)
getRows());

                        return SUCCESS;
                }
        }

        public void setSession(Map<String, Object> session) {
                sesion=session;
        }

        public String getJSON() throws Exception{
        return execute();
        }

        /*
         * Getters and Setters
         */
        /**
           * @return how many rows we want to have into the grid
           */
          public Integer getRows()
          {
            return rows;
          }

          /**
           * @param rows
           *          how many rows we want to have into the grid
           */
          public void setRows(Integer rows)
          {
            this.rows = rows;
          }

          /**
           * @return current page of the query
           */
          public Integer getPage()
          {
            return page;
          }

          /**
           * @param page
           *          current page of the query
           */
          public void setPage(Integer page)
          {
            this.page = page;
          }

          /**
           * @return total pages for the query
           */
          public Integer getTotal()
          {
            return total;
          }

          /**
           * @param total
           *          total pages for the query
           */
          public void setTotal(Integer total)
          {
            this.total = total;
          }

          /**
           * @return total number of records for the query. e.g. select
count(*) from
           *         table
           */
          public Integer getRecord()
          {
            return record;
          }

          /**
           * @param record
           *          total number of records for the query. e.g. select
count(*) from
           *          table
           */
          public void setRecord(Integer record)
          {

            this.record = record;

            if (this.record > 0 && this.rows > 0)
            {
              this.total = (int) Math.ceil((double) this.record / (double)
this.rows);
            }
            else
            {
              this.total = 0;
            }
          }

          /**
           * @return an collection that contains the actual data
           */
          public List<CompetitionBean> getGridModel()
          {
            return gridModel;
          }

          /**
           * @param gridModel
           *          an collection that contains the actual data
           */
          public void setGridModel(List<CompetitionBean> gridModel)
          {
            this.gridModel = gridModel;
          }

          /**
           * @return sorting order
           */
          public String getSord()
          {
            return sord;
          }

          /**
           * @param sord
           *          sorting order
           */
          public void setSord(String sord)
          {
            this.sord = sord;
          }

          /**
           * @return get index row - i.e. user click to sort.
           */
          public String getSidx()
          {
            return sidx;
          }

          /**
           * @param sidx
           *          get index row - i.e. user click to sort.
           */
          public void setSidx(String sidx)
          {
            this.sidx = sidx;
          }

          public void setSearchField(String searchField)
          {
            this.searchField = searchField;
          }

          public void setSearchString(String searchString)
          {
            this.searchString = searchString;
          }

          public void setSearchOper(String searchOper)
          {
            this.searchOper = searchOper;
          }

          public void setLoadonce(boolean loadonce)
          {
            this.loadonce = loadonce;
          }

}
============================================================================
===
I'm using eclipce indigo IDE
I have the following jars included in /WEB-INF/lib folder and also add a
user library witrh the same jars:

asm-3.3.jar
asm-commons-3.3.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang-2.5.jar
commons-logging-1.1.1.jar
commons-logging-api-1.1.jar
freemarker-2.3.18.jar
javassist-3.11.0.GA.jar
mysql-connector-java-5.1.20-bin.jar
ognl-3.0.4.jar
servlet-api.jar
struts2-convention-plugin-2.3.1.2.jar
struts2-core-2.3.1.2.jar
struts2-jquery-plugin-3.3.1.jar
struts2-json-plugin-2.3.1.2.jar
xwork-core-2.3.1.2.jar
struts2-jquery-grid-plugin-3.3.1.jar
json-lib-2.3-jdk15.jar

Do I need others jar?

Can you give a list of jars that works OK with struts2 and json and jqgrid ?

Regards!

--
You received this message because you are subscribed to the Google Groups
"struts2-jquery" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to
[hidden email].
For more options, visit this group at
http://groups.google.com/group/struts2-jquery?hl=en.

--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Result type = json error unknown location

Cesar Lopez
In reply to this post by Cesar Lopez
Hi!

I solve this problem adding the anotation:
@ParentPackage( value="json-default" )

Regards


On Jun 5, 12:56 pm, Cesar Lopez <[hidden email]> wrote:

> Hi!
>
> I try doing the Grid example of Struts2 jQuery Plugin Showcase page:http://struts.jgeppert.com/struts2-jquery-showcase/index.action
>
> but when I want to start apache server, it display the following
> error:
>
> SEVERE: Dispatcher initialization failed
> Unable to load configuration. - [unknown location]
>         at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:
> 69)
>         at
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:
> 390)
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
>         at
> org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:
> 69)
>         at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:
> 51)
>         at
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:
> 295)
>         at
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:
> 422)
>         at
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:
> 115)
>         at
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:
> 4072)
>         at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:
> 4726)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
> 1057)
>         at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
> 1057)
>         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
> 463)
>         at
> org.apache.catalina.core.StandardService.start(StandardService.java:
> 525)
>         at org.apache.catalina.core.StandardServer.start(StandardServer.java:
> 754)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
>         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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
> Caused by: The Result type [json] which is defined in the Result
> annotation on the class [class
> com.gemalto.xcelerator.tt.actions.competition.LoadGridCompetitionsAction]
> or determined by the file extension or is the default result type for
> the PackageConfig of the action, could not be found as a result-type
> defined for the Struts/XWork package
> [com.gemalto.xcelerator.tt.actions.competition#convention-
> default#concurso] - [unknown location]
>         at
> org.apache.struts2.convention.DefaultResultMapBuilder.createResultConfig(DefaultResultMapBuilder.java:
> 438)
>         at
> org.apache.struts2.convention.DefaultResultMapBuilder.createFromAnnotations(DefaultResultMapBuilder.java:
> 410)
>         at
> org.apache.struts2.convention.DefaultResultMapBuilder.build(DefaultResultMapBuilder.java:
> 202)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.createActionConfig(PackageBasedActionConfigBuilder.java:
> 864)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfiguration(PackageBasedActionConfigBuilder.java:
> 650)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:
> 335)
>         at
> org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:
> 53)
>         at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:
> 215)
>         at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:
> 66)
>         ... 22 more
>
> jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
> filterStart
> SEVERE: Exception starting filter struts2
> Unable to load configuration. - [unknown location]
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:449)
>         at
> org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:
> 69)
>         at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:
> 51)
>         at
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:
> 295)
>         at
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:
> 422)
>         at
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:
> 115)
>         at
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:
> 4072)
>         at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:
> 4726)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
> 1057)
>         at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
> 1057)
>         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
> 463)
>         at
> org.apache.catalina.core.StandardService.start(StandardService.java:
> 525)
>         at org.apache.catalina.core.StandardServer.start(StandardServer.java:
> 754)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
>         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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
> Caused by: Unable to load configuration. - [unknown location]
>         at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:
> 69)
>         at
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:
> 390)
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
>         ... 20 more
> Caused by: The Result type [json] which is defined in the Result
> annotation on the class [class
> com.gemalto.xcelerator.tt.actions.competition.LoadGridCompetitionsAction]
> or determined by the file extension or is the default result type for
> the PackageConfig of the action, could not be found as a result-type
> defined for the Struts/XWork package
> [com.gemalto.xcelerator.tt.actions.competition#convention-
> default#concurso] - [unknown location]
>         at
> org.apache.struts2.convention.DefaultResultMapBuilder.createResultConfig(DefaultResultMapBuilder.java:
> 438)
>         at
> org.apache.struts2.convention.DefaultResultMapBuilder.createFromAnnotations(DefaultResultMapBuilder.java:
> 410)
>         at
> org.apache.struts2.convention.DefaultResultMapBuilder.build(DefaultResultMapBuilder.java:
> 202)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.createActionConfig(PackageBasedActionConfigBuilder.java:
> 864)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildConfiguration(PackageBasedActionConfigBuilder.java:
> 650)
>         at
> org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:
> 335)
>         at
> org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:
> 53)
>         at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:
> 215)
>         at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:
> 66)
>         ... 22 more
>
> jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
> start
> SEVERE: Error filterStart
> jun 05, 2012 12:23:12 PM org.apache.catalina.core.StandardContext
> start
> SEVERE: Context [/XceleratorTTII] startup failed due to previous
> errors
> jun 05, 2012 12:23:12 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: The web application [/XceleratorTTII] created a ThreadLocal
> with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10]
> (value [com.opensymphony.xwork2.inject.ContainerImpl$10@182f0c6]) and
> a value of type [java.lang.Object[]] (value
> [[Ljava.lang.Object;@18d708f]) but failed to remove it when the web
> application was stopped. This is very likely to create a memory leak.
> jun 05, 2012 12:23:12 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: The web application [/XceleratorTTII] created a ThreadLocal
> with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10]
> (value [com.opensymphony.xwork2.inject.ContainerImpl$10@d8c235]) and a
> value of type [java.lang.Object[]] (value
> [[Ljava.lang.Object;@b6607a]) but failed to remove it when the web
> application was stopped. This is very likely to create a memory leak.
> jun 05, 2012 12:23:12 PM org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> jun 05, 2012 12:23:13 PM org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:8009
> jun 05, 2012 12:23:13 PM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/16  config=null
> jun 05, 2012 12:23:13 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 1103 ms
>
> ===============================================================================
> jsp
> ===============================================================================
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>     pageEncoding="ISO-8859-1"%>
>
> <%@taglib uri="/struts-tags" prefix="s" %>
> <%@taglib uri="/struts-jquery-tags" prefix="sj" %>
> <%@taglib uri="/struts-jquery-grid-tags" prefix="sjg" %>
>
> <!DOCTYPE html PUBLIC
>         "-//W3C//DTD HTML 4.01 Transitional//EN"
>         "http://www.w3.org/TR/html4/loose.dtd">
>
> <html>
> <head>
>         <meta http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1">
>         <link href="../css/xcelerator.css" rel="stylesheet"  type="text/
> css">
>         <title></title>
> </head>
> <body>
>         <!-- Header -->
>         <div id="cabecera">
>                 <center><div id="header"></div></center>
>         </div>
>         <!-- END Header -->
>
>         <!-- Menu -->
>         <div id="menu">
>                 <div class="menu">
>                         <s:property value="#session.menu"  escapeHtml=""  />
>                 </div>
>         </div>
>         <!-- END Menu -->
>
>         <!-- BEGIN Contenido -->
>         <div id="contenido">
>                 <s:url id="remoteurl" action="loadGridConcurso" namespace="/
> concurso" />
>                 <sjg:grid
>                         id="gridTable"
>                         caption="Concursos"
>                         dataType="json"
>                         href="%{remoteurl}"
>                         pager="true"
>                         gridModel="gridModel"
>                         rowList="10,15,20"
>                         rowNum="10"
>                         rownumbers="true"
>                 >
>                         <!-- El "name" de cada columna debe coincidir con cada atributo del
> objeto Bean (UserTO) que representa cada registro de la tabla -->
>                         <sjg:gridColumn name="idConcurso" index="idConcurso" title="no.
> Concurso" sortable="true"/>
>                         <sjg:gridColumn name="nombre" index="nombre" title="nombre del
> concurso" sortable="true" />
>                 </sjg:grid>
>
>         </div>
>         <!-- END Contenido -->
>
>         <!-- BEGIN Footer -->
>         <div id="footer">
>                 <div id="logo_footer"></div>
>         </div>
>         <!-- END Footer -->
> </body>
> </html>
> ===============================================================================
>
> ===============================================================================
> Action
> ===============================================================================
> package com.gemalto.xcelerator.tt.actions.competition;
>
> import java.util.List;
> import java.util.Map;
>
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> import org.apache.struts2.convention.annotation.Action;
> import org.apache.struts2.convention.annotation.Namespace;
> import org.apache.struts2.convention.annotation.Result;
> import org.apache.struts2.interceptor.SessionAware;
>
> import com.gemalto.xcelerator.beans.CompetitionBean;
> import com.gemalto.xcelerator.tt.bos.competition.CompetitionBO;
> import com.opensymphony.xwork2.ActionSupport;
>
> @Namespace(value="concurso")
> public class LoadGridCompetitionsAction extends ActionSupport
> implements SessionAware {
>
>         private static final long serialVersionUID = 1L;
>
>         private Map<String,Object>sesion;
>         private Log log;
>
>         /** lista de resultados */
>         private List<CompetitionBean> gridModel;
>
>         /** lista temporal */
>         private List<CompetitionBean> myCompetition;
>
>         /** Número de filas que queremos tener dentro del grid - atributo
> "rowNum" del grid */
>     private Integer rows = 0;
>
>     /** Página actual. Por defecto el grid lo pone en 1 */
>     private Integer page = 0;
>
>     /** Páginas totales */
>     private Integer total = 0;
>
>     /** todos los registros (PUEDE LLAMARSE record) */
>     private Integer record = 0;
>
>    /** Orden - asc o desc */
>     private String sord;
>
>     /** Índice de la fila - i.e. click del usuario para ordenar */
>     private String sidx;
>
>     /** campo de búsqueda */
>     private String searchField;
>
>     /** cadena de búsqueda*/
>     private String searchString;
>
>     /** La operación de búsqueda
> ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc']
> */
>     private String searchOper;
>
>     @SuppressWarnings("unused")
>         private boolean loadonce = false;
>
>         public LoadGridCompetitionsAction() {
>                 log= LogFactory.getLog(LoadGridCompetitionsAction.class);
>         }
>
>         @Override
>         @Action(value="loadGridConcurso",
>                         results={
>                                 @Result(name = "success", type = "json")
>                         }
>         )
>         public String execute() throws Exception {
>                 if(sesion.size()==0)
>                         return ERROR;
>                 else{
>                         log.debug("Page " + getPage()+" Rows " + getRows() +" Sorting Order
> "+ getSord()+" Index Row :" + getSidx());
>                     log.debug("Search :" + searchField + " " + searchOper + " " +
> searchString);
>
>                     //Número de registros(Select count(*) from users)
>             setRecord(new CompetitionBO().count());
>
>             //Calcula HASTA qué registro será la consulta, suponiendo
> que rows=10....
>             int to = (getRows() * getPage());//.....la primera vez
> to=10  (10*1)
>
>             //Calcula DESDE qué registro se hará la consulta...
>             int from = to - getRows();//....from=0  (10-10)
>
>             //si la variable "to" sobrepasa el número de registros
> disponible, entonces le ponemos ese valor máximo de registros.
>             if(to>getRecord())to=getRecord();
>
>             //Utilizamos este List temporal para almacenar cada Objeto
> UserTO (Registro) que devolvió la consulta
>             myCompetition = new
> CompetitionBO().getCompetitionGridLis(from, to);
>
>             //Le pasamos ese List lleno al List "gridModel", que es el
> que finalmente ocupará el JQGrid para dibujar la tabla..
>             setGridModel(myCompetition);
>
>           //calcula el total de páginas que genera la consulta
>             total = (int) Math.ceil((double) getRecord() / (double)
> getRows());
>
>                         return SUCCESS;
>                 }
>         }
>
>         public void setSession(Map<String, Object> session) {
>                 sesion=session;
>         }
>
>         public String getJSON() throws Exception{
>         return execute();
>         }
>
>         /*
>          * Getters and Setters
>          */
>         /**
>            * @return how many rows we want to have into the grid
>            */
>           public Integer getRows()
>           {
>             return rows;
>           }
>
>           /**
>            * @param rows
>            *          how many rows we want to have into the grid
>            */
>           public void setRows(Integer rows)
>           {
>             this.rows = rows;
>           }
>
>           /**
>            * @return current page of the query
>            */
>           public Integer getPage()
>           {
>             return page;
>           }
>
>           /**
>            * @param page
>            *          current page of the query
>            */
>           public void setPage(Integer page)
>           {
>             this.page = page;
>           }
>
>           /**
>            * @return total pages for the query
>            */
>           public Integer getTotal()
>           {
>             return total;
>           }
>
>           /**
>            * @param total
>            *          total pages for the query
>            */
>           public void setTotal(Integer total)
>           {
>             this.total = total;
>           }
>
>           /**
>            * @return total number of records for the query. e.g. select
> count(*) from
>            *         table
>            */
>           public Integer getRecord()
>           {
>             return record;
>           }
>
>           /**
>            * @param record
>            *          total number of records for the query. e.g. select
> count(*) from
>            *          table
>            */
>           public void setRecord(Integer record)
>           {
>
>             this.record = record;
>
>             if (this.record > 0 && this.rows > 0)
>             {
>               this.total = (int) Math.ceil((double) this.record / (double)
> this.rows);
>             }
>             else
>             {
>               this.total = 0;
>             }
>           }
>
>           /**
>            * @return an collection that contains the actual data
>            */
>           public List<CompetitionBean> getGridModel()
>           {
>             return gridModel;
>           }
>
>           /**
>            * @param gridModel
>            *          an collection that contains the actual data
>            */
>           public void setGridModel(List<CompetitionBean> gridModel)
>           {
>             this.gridModel = gridModel;
>           }
>
>           /**
>            * @return sorting order
>            */
>           public String getSord()
>           {
>             return sord;
>           }
>
>           /**
>            * @param sord
>            *          sorting order
>            */
>           public void setSord(String sord)
>           {
>             this.sord = sord;
>           }
>
>           /**
>            * @return get index row - i.e. user click to sort.
>            */
>           public String getSidx()
>           {
>             return sidx;
>           }
>
>           /**
>            * @param sidx
>            *          get index row - i.e. user click to sort.
>            */
>           public void setSidx(String sidx)
>           {
>             this.sidx = sidx;
>           }
>
>           public void setSearchField(String searchField)
>           {
>             this.searchField = searchField;
>           }
>
>           public void setSearchString(String searchString)
>           {
>             this.searchString = searchString;
>           }
>
>           public void setSearchOper(String searchOper)
>           {
>             this.searchOper = searchOper;
>           }
>
>           public void setLoadonce(boolean loadonce)
>           {
>             this.loadonce = loadonce;
>           }
>
> }
>
> ===============================================================================
> I'm using eclipce indigo IDE
> I have the following jars included in /WEB-INF/lib folder and also add
> a user library witrh the same jars:
>
> asm-3.3.jar
> asm-commons-3.3.jar
> commons-fileupload-1.2.2.jar
> commons-io-2.0.1.jar
> commons-lang-2.5.jar
> commons-logging-1.1.1.jar
> commons-logging-api-1.1.jar
> freemarker-2.3.18.jar
> javassist-3.11.0.GA.jar
> mysql-connector-java-5.1.20-bin.jar
> ognl-3.0.4.jar
> servlet-api.jar
> struts2-convention-plugin-2.3.1.2.jar
> struts2-core-2.3.1.2.jar
> struts2-jquery-plugin-3.3.1.jar
> struts2-json-plugin-2.3.1.2.jar
> xwork-core-2.3.1.2.jar
> struts2-jquery-grid-plugin-3.3.1.jar
> json-lib-2.3-jdk15.jar
>
> Do I need others jar?
>
> Can you give a list of jars that works OK with struts2 and json and
> jqgrid ?
>
> Regards!

--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.

Loading...