JBWEB000284: Exception starting filter OCPsoft Rewrite Filter

Splash Forums Rewrite Users JBWEB000284: Exception starting filter OCPsoft Rewrite Filter

Tagged: , ,

This topic contains 3 replies, has 3 voices, and was last updated by  Christian Kaltepoth 4 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18864

    jlgranda
    Participant

    Hi everyone. I try to start project with rewrite on AS7, when try to run get

    JBWEB000284: Exception starting filter OCPsoft Rewrite Filter: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped

    please advice

    #23142

    Hi Jlgranda!

    Without seeing your configuration provider (could you post it if possible?) I can only guess at the exact cause, but its probably one of a few things.

    1) You have injected a ViewScoped bean into your configurationprovider and are trying to access it directly in either the configuration or priority methods.

    Rewrite checks access to potentially problematic scopes at server boot time. You need to wrap all accesses to non-threadsafe beans in a:

    new HttpCondition() {} or new HttpOperation() {}

    2) one of the beans you inject is indirectly accessing such a bean.

    In the future. Please post the full stack trace and as much of your configuration as permitted.

    Thanks,

    Lincoln

    #23143

    jlgranda
    Participant

    Ok Lincoln. This is complete trace:

    ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/glue]] (MSC service thread 1-2) JBWEB000284: Exception starting filter OCPsoft Rewrite Filter: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped
    at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:590) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:71) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79) [weld-core-1.1.10.Final.jar:2012-10-12 10:00]
    at org.eqaula.glue.model.profile.Profile$Proxy$_$$_WeldClientProxy.isPersistent(Profile$Proxy$_$$_WeldClientProxy.java) [classes:]
    at org.eqaula.glue.rewrite.AuthenticationStatusInterceptor.getConfiguration(AuthenticationStatusInterceptor.java:63) [classes:]
    at org.eqaula.glue.rewrite.AuthenticationStatusInterceptor.getConfiguration(AuthenticationStatusInterceptor.java:53) [classes:]
    at org.ocpsoft.rewrite.config.ConfigurationLoader.build(ConfigurationLoader.java:127) [rewrite-servlet-1.1.0.Final.jar:1.1.0.Final]
    at org.ocpsoft.rewrite.config.ConfigurationLoader.loadConfiguration(ConfigurationLoader.java:68) [rewrite-servlet-1.1.0.Final.jar:1.1.0.Final]
    at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.init(DefaultHttpRewriteProvider.java:46) [rewrite-servlet-1.1.0.Final.jar:1.1.0.Final]
    at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.init(DefaultHttpRewriteProvider.java:33) [rewrite-servlet-1.1.0.Final.jar:1.1.0.Final]
    at org.ocpsoft.rewrite.servlet.RewriteFilter.init(RewriteFilter.java:127) [rewrite-servlet-1.1.0.Final.jar:1.1.0.Final]
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:416) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3224) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3783) [jbossweb-7.2.0.Alpha2.jar:7.2.0.Alpha2]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:102) [jboss-as-web-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

    09:31:25,604 INFO [solder-servlet] (MSC service thread 1-2) Catch Integration for Servlets enabled
    09:31:25,604 ERROR [org.apache.catalina.core] (MSC service thread 1-2) JBWEB001103: Error detected during context /glue start, will stop it
    09:31:25,607 INFO [com.ocpsoft.pretty.PrettyFilter] (MSC service thread 1-2) PrettyFilter shutting down...
    09:31:25,632 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host./glue: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./glue: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:107)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

    The configurator provider is the same configurator provider in socialpm. When call account.setEntityManager(em); throw exception and deploy stop.

    public class AccountVerificationInterceptor extends HttpConfigurationProvider
    {
    @Inject
    private Account account;

    @PersistenceContext
    private EntityManager em;

    @Override
    public Configuration getConfiguration(final ServletContext context)
    {
    ConfigurationBuilder config = ConfigurationBuilder.begin();
    account.setEntityManager(em); //
    > Throw EXCEPTION
    Profile current = account.getLoggedIn();
    if (current.isPersistent() && !current.isUsernameConfirmed())
    {
    return config.defineRule()
    .when(DispatchType.isRequest()
    .and(Direction.isInbound())
    .and(GlueResources.excluded()))
    .perform(Forward.to("/account/confirm"))

    .addRule(Join.path("/account/confirm").to("/pages/accountConfirm.xhtml"));
    }
    return config;
    }

    @Override
    public int priority()
    {
    return 0;
    }
    }

    #23144

    Your ConfigurationProvider is evaluated during application startup. So there is no active request and therefore working with request/view scoped beans won’t work. As Lincoln already wrote, you have to wrap you authentication check into a HttpCondition so it gets executed during the rule evaluation.

    See Exhibit 2 and Exhibit 3 from this page:

    http://ocpsoft.org/rewrite/examples/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Comments are closed.