Boa tarde.
Criei um converter no vrator conforme fonte abaixo. Quando deixo como RequestScoped funciona bem, porém quando coloco como ApplicationScoped retorna a exception abaixo.
Ambiente: vraptor3 final, Glassfish v2.1.
[code]@Convert(Paging.class)
@ApplicationScoped
public class PagingConverter
implements Converter {
@Override
public Paging convert(String value, Class<? extends Paging> type, ResourceBundle bundle) {
if (value == null || value.trim().isEmpty()) {
return Paging.FIRST;
}
return new Paging(Integer.valueOf(value));
}
}[/code]
INFO: 17:48:15 WARN (PicoComponentRegistry.java:86) - VRaptor was already initialized, the contexts were created but you are registering a component.This is nasty. The original component might already be in use.Avoid doing it: xw.web.component.PagingConverter
INFO: 17:48:15 WARN (PicoComponentRegistry.java:86) - VRaptor was already initialized, the contexts were created but you are registering a component.This is nasty. The original component might already be in use.Avoid doing it: br.com.caelum.vraptor.Converter
INFO: 17:48:15 WARN (PicoComponentRegistry.java:86) - VRaptor was already initialized, the contexts were created but you are registering a component.This is nasty. The original component might already be in use.Avoid doing it: xw.web.component.BasicEntityIdConverter
INFO: 17:48:15 WARN (PicoComponentRegistry.java:86) - VRaptor was already initialized, the contexts were created but you are registering a component.This is nasty. The original component might already be in use.Avoid doing it: br.com.caelum.vraptor.Converter
SEVERE: WebModule[]PWC1270: Exception starting filter vraptor
org.picocontainer.PicoCompositionException: Duplicate Keys not allowed. Duplicate for 'interface br.com.caelum.vraptor.Converter'
at org.picocontainer.DefaultPicoContainer.addAdapterInternal(DefaultPicoContainer.java:381)
at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:486)
at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:460)
at br.com.caelum.vraptor.ioc.pico.PicoComponentRegistry.register(PicoComponentRegistry.java:89)
at br.com.caelum.vraptor.ioc.AbstractComponentRegistry.deepRegister(AbstractComponentRegistry.java:42)
at br.com.caelum.vraptor.ioc.AbstractComponentRegistry.deepRegister(AbstractComponentRegistry.java:46)
at br.com.caelum.vraptor.ioc.AbstractComponentRegistry.deepRegister(AbstractComponentRegistry.java:32)
at br.com.caelum.vraptor.ioc.pico.StereotypedComponentRegistrar.registerFrom(StereotypedComponentRegistrar.java:60)
at br.com.caelum.vraptor.ioc.pico.PicoProvider.start(PicoProvider.java:87)
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:103)
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:96)