Señores tengo un error al intentar de crear una lista Dinamica, ya me he guiado con la informacion que he encontrado en la comunidad Alfresco.
Este es unos de las clases:
<code>
package ve.gob.cne.test;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.sql.*;
import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint;
import org.alfresco.web.bean.generator.BaseComponentGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import ve.gob.cne.sarc.catalogo.servicio.cliente.CatalogoServicioCliente;
import ve.gob.cne.sarc.catalogo.servicio.comunes.PeticionEntePublico;
import ve.gob.cne.sarc.catalogo.servicio.comunes.RespuestaEntePublico;
import ve.gob.cne.sarc.comunes.Cabecera;
import ve.gob.cne.sarc.comunes.CabeceraRespuesta;
import ve.gob.cne.sarc.comunes.catalogo.EntePublico;
import java.io.Serializable;
import javax.faces.model.SelectItem;
public class ListOfValuesQueryConstraint extends ListOfValuesConstraint implements Serializable {
private static Log logger = LogFactory.getLog(BaseComponentGenerator.class);
private static final long serialVersionUID=1;
private List<String> allowedLabels;
public void setAllowedValues(List allowedValues) {}
public void setCaseSensitive(boolean caseSensitive) {}
public void initialize() {
super.setCaseSensitive(false);
this.loadDB();
}
public List<String> getAllowedLabels() {
return this.allowedLabels;
}
public void setAllowedLabels(List<String> allowedLabels) {
this.allowedLabels=allowedLabels;
}
public List<SelectItem> getSelectItemList() {
List<SelectItem> result = new ArrayList<SelectItem>(this.getAllowedValues().size());
for(int i=0;i<this.getAllowedValues().size();i++) {
result.add(new SelectItem((Object)this.getAllowedValues().get(i),this.allowedLabels.get(i)));
}
return result;
}
protected void loadDB() {
List<String> av = new ArrayList<String>();
List<String> al=new ArrayList<String>();
try {
System.out.println("cargando …..1");
CatalogoServicioCliente cliente = new CatalogoServicioCliente();
Cabecera cabecera = new Cabecera();
cabecera.setInstanteEnvio(new Date(0));
LinkedHashMap<String, String> mapaUtil = new LinkedHashMap<String, String>();
PeticionEntePublico peticionEntePublico = new PeticionEntePublico();
peticionEntePublico.setCabecera(cabecera);
EntePublico entePublico = new EntePublico();
entePublico.setNombre("ewewq");
peticionEntePublico.setEntePublico(entePublico);
RespuestaEntePublico respuestaEntePublico = cliente.consultarEntePublicoTodos(peticionEntePublico);
CabeceraRespuesta cabeceraRespuesta = respuestaEntePublico.getCabeceraRespuesta();
List<EntePublico> listaEntesPublicos = respuestaEntePublico.getEntePublico();
LinkedHashMap<String, String> tipoEnte = new LinkedHashMap<String, String>();
// TODO Corregir en el servicio el envio de codigo de programador
int i = 0;
for (EntePublico entePublico1 : listaEntesPublicos) {
tipoEnte.put(entePublico1.getNombre(), i++ + "");
av.add(entePublico1.getNombre());
al.add(entePublico1.getNombre());
}
}
catch (Exception e) {}
super.setAllowedValues(av);
this.setAllowedLabels(al);
}
}
<code>
EL error que me da es el siguiente:
<code>
SEVERE: Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [C:\Alfresco1\tomcat\shared\classes\alfresco\extension\registroCivilModel-context.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/sun/jersey/api/client/WebResource
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:633)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/sun/jersey/api/client/WebResource
at ve.gob.cne.test.ListOfValuesQueryConstraint.loadDB(ListOfValuesQueryConstraint.java:92)
at ve.gob.cne.test.ListOfValuesQueryConstraint.initialize(ListOfValuesQueryConstraint.java:38)
at org.alfresco.repo.dictionary.M2ConstraintDefinition.resolveInternal(M2ConstraintDefinition.java:290)
at org.alfresco.repo.dictionary.M2ConstraintDefinition.resolveDependencies(M2ConstraintDefinition.java:122)
at org.alfresco.repo.dictionary.M2ConstraintDefinition.resolveInternal(M2ConstraintDefinition.java:164)
at org.alfresco.repo.dictionary.M2ConstraintDefinition.resolveDependencies(M2ConstraintDefinition.java:122)
at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:102)
at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:163)
at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModelImpl(DictionaryDAOImpl.java:266)
at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModel(DictionaryDAOImpl.java:252)
at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:155)
at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:105)
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.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1639)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1580)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1510)
… 26 more
Caused by: java.lang.ClassNotFoundException: com.sun.jersey.api.client.WebResource
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
… 45 more
<code>
COmo podria resolver este error? que debo importar?