Simples Assim

Improvement to Infinispan 6.0.2

leave a comment »

There should be a Tomcat manager in the distribution.

https://issues.jboss.org/browse/ISPN-465 (vote for it!)

About these ads

Written by Fernando Ribeiro

October 12, 2014 at 1:48 am

Posted in Software

Tagged with , ,

How to Create a Manager for Tomcat

leave a comment »

import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleState;
import org.apache.catalina.session.ManagerBase;

public final class SampleManager extends ManagerBase {

  @Override
  public void load() {
  }

  @Override
  protected void startInternal() throws LifecycleException {
    super.startInternal();

    setState(LifecycleState.STARTING);
  }

  @Override
  protected void stopInternal() throws LifecycleException {
    setState(LifecycleState.STOPPING);

    super.stopInternal();
  }

  @Override
  public void unload() {
  }

}

A sample is available here.

Written by Fernando Ribeiro

October 12, 2014 at 1:41 am

Posted in Software

Tagged with , ,

How to Setup Custom Persistence in Tomcat

leave a comment »

1) Change the manager in the <Tomcat Install Dir>/conf/context.xml file to the PersistentManager:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
  <Manager className="org.apache.catalina.session.PersistentManager" />
</Context>

2) Add a store to the manager:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
  <Manager className="org.apache.catalina.session.PersistentManager">
    <Store className="br.eti.fernandoribeiro.sample.tomcat.SampleStore" />
  </Manager>
</Context>

3) Start Tomcat.

You can find more details here.

Written by Fernando Ribeiro

October 2, 2014 at 8:27 pm

Posted in Technology

Tagged with , ,

How to Create a Store for Tomcat

leave a comment »

import org.apache.catalina.Session;
import org.apache.catalina.session.StoreBase;

public final class SampleStore extends StoreBase {

  @Override
  public void clear() {
  }

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

  @Override
  public String[] keys() {
    return new String[] {};
  }

  @Override
  public Session load(final String id) {
    return null;
  }

  @Override
  public void remove(final String id) {
  }

  @Override
  public void save(final Session session) {
  }

}

A sample is available here.

Written by Fernando Ribeiro

October 2, 2014 at 8:26 pm

Posted in Software

Tagged with , ,

How to Setup Load Balancing in Tomcat with mod_proxy_balancer

leave a comment »

1) Create the <Apache Install Dir>/conf.d/mod_proxy_balancer.conf file:

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule status_module modules/mod_status.so

<Location /balancer-manager>
  SetHandler balancer-manager
</Location>

<Proxy balancer://sample-balancer>
  BalancerMember ajp://node1:8009
  BalancerMember ajp://node2:8009
  ProxySet scolonpathdelim=On
  ProxySet stickysession=JSESSIONID
</Proxy>

ProxyPass /sample balancer://sample-balancer

2) Change the <Tomcat Install Dir>/conf/server.xml file in each node:

<?xml version="1.0" encoding="UTF-8"?>
<Server>
  ...
  <Service>
    ...
    <Engine jvmRoute="node1">
      ...
    </Engine>
  </Service>
</Server>

3) Start Apache.

4) Start Tomcat.

Written by Fernando Ribeiro

September 16, 2014 at 8:35 am

How to Setup a Tomcat Cluster

leave a comment »

Dynamic Discovery

1) Change the <Tomcat Install Dir>/conf/server.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<Server>
  ...
  <Service>
    ...
    <Engine>
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      ...
    </Engine>
  </Service>
</Server>

2) Start Tomcat.

Static Discovery

1) Change the <Tomcat Install Dir>/conf/server.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<Server>
  ...
  <Service>
    ...
    <Engine>
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelStartOptions="3">
        <Channel className="org.apache.catalina.tribes.group.GroupChannel">
          <Interceptor className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor">
            <Member className="org.apache.catalina.tribes.membership.StaticMember" port="4000" host="host1" uniqueId="{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}" />
            <Member className="org.apache.catalina.tribes.membership.StaticMember" port="4000" host="host2" uniqueId="{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2}" />
          </Interceptor>
        </Channel>
      </Cluster>
      ...
    </Engine>
  </Service>
</Server>

2) Start Tomcat.

You can find more details here.

Written by Fernando Ribeiro

September 16, 2014 at 8:13 am

Posted in Technology

Tagged with , ,

Bug in Renjin 0.7.0-RC7

leave a comment »

I can’t access Java static fields.

https://github.com/bedatadriven/renjin/issues/69

Written by Fernando Ribeiro

September 1, 2014 at 3:01 pm

Posted in Software

Tagged with ,

Follow

Get every new post delivered to your Inbox.

Join 1,230 other followers