Reply To: Issues with rewrite and Weld not working

Splash Forums Rewrite Users Issues with rewrite and Weld not working Reply To: Issues with rewrite and Weld not working

#27743

maqjav
Participant

Adding that dependency I get the next error:

org.ocpsoft.rewrite.cdi.manager.BeanManagerUnavailableException: Failed to locate BeanManager using any of these providers: org.ocpsoft.rewrite.cdi.manager.DefaultJndiBeanManagerProvider(10), org.ocpsoft.rewrite.cdi.manager.ServletContainerJndiBeanManagerProvider(11)
	at org.ocpsoft.rewrite.cdi.manager.BeanManagerLocator.getBeanManager(BeanManagerLocator.java:85)
	at org.ocpsoft.rewrite.cdi.manager.BeanManagerAware.getBeanManager(BeanManagerAware.java:52)
	at org.ocpsoft.rewrite.cdi.CdiServiceEnricher.produce(CdiServiceEnricher.java:45)
	at org.ocpsoft.common.services.ServiceLoader.loadEnriched(ServiceLoader.java:297)
	at org.ocpsoft.common.services.ServiceLoader.loadClass(ServiceLoader.java:243)
	at org.ocpsoft.common.services.ServiceLoader.loadService(ServiceLoader.java:234)
	at org.ocpsoft.common.services.ServiceLoader.loadServiceFile(ServiceLoader.java:196)
	at org.ocpsoft.common.services.ServiceLoader.reload(ServiceLoader.java:145)
	at org.ocpsoft.common.services.ServiceLoader.iterator(ServiceLoader.java:394)
	at org.ocpsoft.common.util.Iterators.asList(Iterators.java:40)
	at org.ocpsoft.rewrite.servlet.RewriteFilter.init(RewriteFilter.java:87)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4590)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5233)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

However, I have in my context.xml the next configuration:

<Context allowCasualMultipartParsing="true">
	<Resource name="BeanManager" 
        auth="Container"
        type="javax.enterprise.inject.spi.BeanManager"
        factory="org.jboss.weld.resources.ManagerObjectFactory" />
</Context>

And in my web.xml:

<resource-env-ref>
		<resource-env-ref-name>BeanManager</resource-env-ref-name>
		<resource-env-ref-type>javax.enterprise.inject.spi.BeanManager</resource-env-ref-type>
	</resource-env-ref>

I tried adding this dependency too, but this new error persists:

<dependency>
		    <groupId>javax.enterprise</groupId>
		    <artifactId>cdi-api</artifactId>
		    <version>2.0</version>
		</dependency>