Intermittent error: Failed to bind value

Splash Forums Rewrite Users Intermittent error: Failed to bind value

This topic contains 14 replies, has 4 voices, and was last updated by  Lincoln Baxter III 4 years, 5 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #18826

    Hello,

    after I uploaded my webapp in a server, I’m getting the following error, the strange thing is that it doesn’t happen every time so it’s difficult to debug:

    org.ocpsoft.rewrite.exception.RewriteException: Failed to bind value [[Ljava.lang.String;@764e045e] to binding [null]
    org.ocpsoft.rewrite.bind.Bindings.enqueuePreOperationSubmissions(Bindings.java:97)
    org.ocpsoft.rewrite.bind.Bindings.enqueueSubmission(Bindings.java:49)
    org.ocpsoft.rewrite.servlet.config.Path.evaluateHttp(Path.java:115)
    org.ocpsoft.rewrite.servlet.config.HttpCondition.evaluate(HttpCondition.java:41)
    org.ocpsoft.rewrite.config.And.evaluate(And.java:55)
    org.ocpsoft.rewrite.servlet.config.rule.Join.evaluate(Join.java:107)
    org.ocpsoft.rewrite.config.And.evaluate(And.java:55)
    org.ocpsoft.rewrite.config.RuleBuilder.evaluate(RuleBuilder.java:101)
    org.ocpsoft.rewrite.config.And.evaluate(And.java:55)
    org.ocpsoft.rewrite.config.RuleBuilder.evaluate(RuleBuilder.java:101)
    org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteHttp(DefaultHttpRewriteProvider.java:62)
    org.ocpsoft.rewrite.servlet.http.HttpRewriteProvider.rewrite(HttpRewriteProvider.java:44)
    org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:221)
    org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:177)
    uk.co.novaware.core.rewrite.RewriteFilter.doFilter(RewriteFilter.java:68)
    org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
    org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
    uk.co.novaware.core.cdi.scope.ConversationFilter.doFilter(ConversationFilter.java:36)

    Root cause:
    java.lang.NullPointerException

    Do you have any idea on how to reproduce, debug and solve this?

    Thanks,

    Dem

    #23122

    It’s possible that we’ve fixed this in the 2.0 code, but without seeing the full stack trace with your NullPointerException, I can’t say for sure.

    Could you please post the full trace?

    Thanks,

    Lincoln

    #23123

    Hello,

    there isn’t a lot more in the full stack trace:

    SEVERE: Servlet.service() for servlet [default] in context with path [] threw exception
    org.ocpsoft.rewrite.exception.RewriteException: Failed to bind value [[Ljava.lang.String;@646dee9f] to binding [null]
    at org.ocpsoft.rewrite.bind.Bindings.enqueuePreOperationSubmissions(Bindings.java:97)
    at org.ocpsoft.rewrite.bind.Bindings.enqueueSubmission(Bindings.java:49)
    at org.ocpsoft.rewrite.servlet.config.Path.evaluateHttp(Path.java:115)
    at org.ocpsoft.rewrite.servlet.config.HttpCondition.evaluate(HttpCondition.java:41)
    at org.ocpsoft.rewrite.config.And.evaluate(And.java:55)
    at org.ocpsoft.rewrite.servlet.config.rule.Join.evaluate(Join.java:107)
    at org.ocpsoft.rewrite.config.And.evaluate(And.java:55)
    at org.ocpsoft.rewrite.config.RuleBuilder.evaluate(RuleBuilder.java:101)
    at org.ocpsoft.rewrite.config.And.evaluate(And.java:55)
    at org.ocpsoft.rewrite.config.RuleBuilder.evaluate(RuleBuilder.java:101)
    at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteHttp(DefaultHttpRewriteProvider.java:62)
    at org.ocpsoft.rewrite.servlet.http.HttpRewriteProvider.rewrite(HttpRewriteProvider.java:44)
    at org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:221)
    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:177)
    at uk.co.novaware.core.rewrite.RewriteFilter.doFilter(RewriteFilter.java:68)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at uk.co.novaware.core.cdi.scope.ConversationFilter.doFilter(ConversationFilter.java:36)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.NullPointerException
    at org.ocpsoft.rewrite.bind.Bindings.enqueuePreOperationSubmissions(Bindings.java:86)
    ... 37 more

    Please let me know if you need more information from me, thanks a lot…

    Dem

    #23124

    You you perhaps give 2.0.0-SNAPSHOT a try? The snapshots are available in this Maven repository:

    https://oss.sonatype.org/content/repositories/snapshots/

    #23125

    Hello, OK I will try it, what’s the status of the 2.0? can it be used in production? is there some known problem I have to be aware of?

    Thanks,

    Dem

    #23126

    Sorry for my late reply.

    I think we will release a release candidate version very soon based on the current 2.0.0-SNAPSHOT code. So yes, I think it is very stable.

    #23127

    Any news on this one? Does 2.0-SNAPSHOT fix this issue?

    #23128

    usyfemowo
    Participant

    Hi everybody. I try to change to 2.0-SNAPHOST. I have problems at compilation time

    Where is equivalente class for private ParameterizedPattern resource = new ParameterizedPattern(“/pages/{page}.xhtml”);

    Please an advice.

    #23129

    Could you post your code, and what you are trying to do?

    Hint: RegexParameterizedPatternBuilder.class

    Thanks!

    ~Lincoln

    #23130

    You probably don’t need to be using ParameterizedPattern though, I’m guessing, unless you are doing something very custom.

    #23131

    usyfemowo
    Participant

    Hi Lincoln, I building a new project using some code of your pmsocial, sorry. I hope that will be permitted.

    I get intermiten error when logout. Based in this conversation, I try to migrate 2.0.SNAPSHOT then the class rewrite.Resource.java use ParameterizedPattern.

    Really, I don’t understand the function of this class, but the project not run without this.

    #23132

    usyfemowo
    Participant

    Hi Lincoln, I building a new project using some code of your pmsocial, sorry. I hope that will be permitted.

    I get intermiten error when logout. Based in this conversation, I try to migrate 2.0.SNAPSHOT then the class rewrite.Resource.java use ParameterizedPattern.

    Really, I don’t understand the function of this class, but the project not run without this.

    #23133

    Well, I did tell you the class to use instead, but please show me the class you are attempting to compile. I can’t help you unless I know what you are trying to do.

    #23134

    usyfemowo
    Participant

    Hi Lincoln, this is Resource.java

    /**

    * @author Lincoln Baxter, III

    */

    public class Resource extends HttpCondition {

    // TODO move to rewrite proper

    // TODO move to rewrite proper

    private static final Logger log = Logger.getLogger(Resource.class);

    private ParameterizedPattern resource = new ParameterizedPattern(“/pages/{page}.xhtml”);

    private Resource(final String resource)

    {

    this.resource = new ParameterizedPattern(resource);

    for (RegexCapture parameter : this.resource.getParameters().values()) {

    where(parameter.getName()).bindsTo(Evaluation.property(parameter.getName()));

    }

    }

    @Override

    public boolean evaluateHttp(final HttpServletRewrite event, final EvaluationContext context)

    {

    String file = resource.build(event, context);

    try {

    return event.getRequest().getServletContext().getResource(file) != null;

    }

    catch (MalformedURLException e) {

    log.debug(“Invalid file format [{}]”, file);

    }

    return false;

    }

    public static Resource exists(final String resource)

    {

    return new Resource(resource);

    }

    public PathParameter where(String param)

    {

    return parameters.where(param, new PathParameter(null, this.resource.getParameter(param)));

    }

    public PathParameter where(String param, Binding binding)

    {

    return where(param).bindsTo(binding);

    }

    private final ParameterStore<PathParameter> parameters = new ParameterStore<PathParameter>();

    }

    #23135

    Try the Resource class from Rewrite itself ;) this is built in now.

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

You must be logged in to reply to this topic.

Comments are closed.