Simples Assim

Bug in Tomcat 8.0.12

with one comment

There are several errors in the documentation of the JDBC-based store.

https://issues.apache.org/bugzilla/show_bug.cgi?id=57147 (vote for it!)

About these ads

Written by Fernando Ribeiro

October 26, 2014 at 6:32 pm

Posted in Software

Tagged with ,

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!)

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.session.ManagerBase;

public final class SampleManager extends ManagerBase {

  @Override
  public void load() {
  }

  @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 JDBC Persistence in Tomcat

leave a comment »

1) Create the database.

2) Create the table:

CREATE TABLE tomcat$sessions (
  id VARCHAR(100) NOT NULL PRIMARY KEY,
  app VARCHAR(255),
  data MEDIUMBLOB,
  lastaccess BIGINT NOT NULL,
  maxinactive INT NOT NULL,
  valid CHAR(1) NOT NULL,
  KEY kapp(app)
);

3) Change the <Tomcat Install Dir>/conf/context.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<Context>
  <Manager className="org.apache.catalina.session.PersistentManager">
    <Store className="org.apache.catalina.session.JDBCStore" driverName="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/sample_db" connectionName="username" connectionPassword="password" />
  </Manager>
</Context>

4) Start Tomcat.

You can find more details here.

Written by Fernando Ribeiro

October 2, 2014 at 8:29 pm

Posted in Technology

Tagged with , , ,

How to Setup File System Persistence in Tomcat

leave a comment »

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

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

2) Start Tomcat.

You can find more details here.

Written by Fernando Ribeiro

October 2, 2014 at 8:28 pm

Posted in Technology

Tagged with , ,

How to Setup Custom Persistence in Tomcat

leave a comment »

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

<?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>

2) 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 , ,

Follow

Get every new post delivered to your Inbox.

Join 1,229 other followers