0

我在网站上使用 J2EP(其 1.0 稳定版本)作为反向代理服务器。首先我安装了 Apache Tomcat 来部署项目,然后我做了反向代理的配置。另外,服务器不支持“isRewriting = true”,所以我不得不使用“RoundRobinCluster”。

例如; 如果我用这样的表达方式,

"<server className="net.sf.j2ep.servers.BaseServer" 
    domainName="www.nytimes.com"
    path="/test">  
    <rule className="net.sf.j2ep.rules.AcceptEverythingRule" /> 
</server>"

并转到:http://localhost:8080/test

没有页面出现,这导致我使用“RoundRobinCluster”,即;

<server className="net.sf.j2ep.servers.RoundRobinCluster">
    <server
        domainName="www.nytimes.com"
        path="/test"
    />
      <rule className="net.sf.j2ep.rules.AcceptEverythingRule" /> 
</server>   

并转到:http://localhost:8080/test

这次我面对这样的错误;

java.lang.NullPointerException

net.sf.j2ep.ServerChain.evaluate(ServerChain.java:104) net.sf.j2ep.RewriteFilter.doFilter(RewriteFilter.java:75)

我没想到稳定版本会出现这样的错误。或者我可能错过了一些东西,任何帮助都会很好。

谢谢

4

1 回答 1

0

Sorry I haven't met with j2ep earlier. To find out what happened I looked to SVN on sourceforge.org.

Problem code here is:

102     while (itr.hasNext() && !currentMatches) {
103     currentContainer = (ServerContainer) itr.next();
104     currentMatches = currentContainer.getRule().matches(request);
105     }

.

It seems to you have some Rule which wasn't created, may be it had been declared in wrong way. Try to refine rule declaration (check spelling, attributes, etc.) or try to find other errors in log.

于 2013-03-22T09:42:39.817 回答