Galera, tenho o seguinte problema, eu tenho uma classe matéria com os seguintes atributos:
private Long id;
private String nome;
private int quantidade;
//getter and setters
bem como no banco de dados, que tem os mesmos campos…
tenho um form de adição de matérias assim:
<form method="post" action="adicionaMateria">
Nome da Matéria:<br />
<input type="text" name="materia.nome"/><br />
Quantidade:<br />
<input type="text" name="materia.quantidade"/><br />
<input type="submit" value="Adicionar" />
</form>
Uso Struts 2, a Action “adicionaMateria” só chama o DAO passando uma matéria
public void adicionaMateria(Materia materia) {
try {
PreparedStatement stm = connection
.prepareStatement("insert into materias(nome,quantidade) values(?,?)");
stm.setString(1, materia.getNome());
stm.setInt(2, materia.getQuantidade());
stm.execute();
stm.close();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
To pegando um erro aqui estranho, no console do eclipse da o seguinte:
GRAVE: The web application [/coisas-da-bruna] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
15/02/2011 17:29:54 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/coisas-da-bruna] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
15/02/2011 17:29:54 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/coisas-da-bruna] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@165ab39]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1cc5d23]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
15/02/2011 17:29:55 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
alguma idéia do que pode ser?