jlgranda

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: URL rewriting with PrettyFaces, URLMapping and pretty:link #22911

    jlgranda
    Participant

    Thank you Chistian. I will follow your advices.

    in reply to: URL rewriting with PrettyFaces, URLMapping and pretty:link #22909

    jlgranda
    Participant

    Hi everybody, I have similar problem. Rewrite no response por http://localhost:8080/glue.

    The provider

    public class AccessRewriteConfiguration extends HttpConfigurationProvider implements NonEnriching
    {
    @Override
    public Configuration getConfiguration(final ServletContext context)
    {
    return ConfigurationBuilder.begin()

    .addRule(Join.path("/").to("/pages/home.xhtml"))
    /*.addRule(Join.path("/projects/new").to("/pages/project/create.xhtml"))*/

    .addRule(Join.path("/signup").to("/pages/signup.xhtml"))
    .addRule(Join.path("/login").to("/pages/login.xhtml"))

    // 404 and Error
    .addRule(Join.path("/404").to("/pages/404.xhtml").perform(Response.setCode(404)))
    .addRule(Join.path("/error").to("/pages/error.xhtml"))

    // Authentication
    .defineRule()
    .when(Direction.isInbound().and(Path.matches("/logout")))
    .perform(Invoke.binding(El.retrievalMethod("authentication.logout"))
    .and(Redirect.temporary(context.getContextPath() + "/")))

    ;
    }

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

    }

    The pretty-config

    <pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.4.1
    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.4.1.xsd">

    <rewrite match=".*/" trailingSlash="remove"/>

    <!-- Content Pages -->
    <url-mapping id="home">
    <pattern value="/"></pattern>
    <view-id value="/pages/home.xhtml"></view-id>
    </url-mapping>

    <!--
    <url-mapping id="project-view">
    <pattern value="/p/#{projects.current.name}"></pattern>
    <view-id value="/pages/project/view.xhtml"></view-id>
    <action>#{projects.loadCurrent}</action>
    </url-mapping>

    <url-mapping id="project-create">
    <pattern value="/new-project"></pattern>
    <view-id value="/pages/project/create.xhtml"></view-id>
    </url-mapping>
    -->

    <!-- Begin Exception Mappings -->
    <url-mapping id="404">
    <pattern value="/404" />
    <view-id value="/pages/404.xhtml" />
    </url-mapping>
    <url-mapping id="error">
    <pattern value="/error" />
    <view-id value="/pages/error.xhtml" />
    </url-mapping>
    <!-- End Exception Mappings -->

    </pretty-config>

    I have request for home, login, signup, but / or 404 or error throw exception. I use Jboss AS 7.1.x and JSF4


    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;
    }
    }


    jlgranda
    Participant

    Hi Lincoln, How you request. I created a new thread http://ocpsoft.org/support/rewrite/jbweb000284-exception-starting-filter-ocpsoft-rewrite-filter. Please an advice.


    jlgranda
    Participant

    Ok Lincoln and Fabmars, I removed rewrite for now, while advance at other components. I will back to “rewrite” in few days. I think that rewrite is fabulous too, but now I have problems with seam-securiry and picketlink-idm :(.

    PD. sorry, if I did appear rude


    jlgranda
    Participant

    Tnahk you Lincoln, by the moment, I’m removed rewritte support in my project.


    jlgranda
    Participant

    Hi Lincon and fabmars, 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

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