Ola amigos,
To tentando montar uma aplicação com JSF 2.1 + Hibernate e Spring Security, pelo que vi no tópico vocês ja conseguiram isso. Estou seguindo o livro da novatec Programação pra WEB. O livro monta um DataSource JNDI para o Spring Security e Hiberante acessarem o Mysql fiz e já refiz os passos e sempre apresenta a seguinte mensagem de erro pelo netbeans 7.1.1:
INFO: Server startup in 11919 ms
10/06/2012 15:09:31 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/Financeiro] 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.
10/06/2012 15:09:32 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/Financeiro]
10/06/2012 15:09:32 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor Financeiro.xml from /Users/cleber/.netbeans/7.1.1/apache-tomcat-7.0.22.0_base/conf/Catalina/localhost
Meu context.xml onde cria o datasource:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/Financeiro"
reloadable="true">
<Resource auth="Container"
driverClassName="com.mysql.jdbc.Driver"
maxActive="100"
maxIdle="30"
maxWait="10000"
name="jdbc/FinanceiroDB"
password="adm"
type="javax.sql.DataSource"
url="jdbc:mysql://localhost:3306/financeiro?autoReconnect=true"
username="root"/>
</Context>
O meu applicationContext.xml:
[code]<?xml version="1.0" encoding="UTF-8"?>
<bean id="financeiroDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/FinanceiroDB</value>
</property>
</bean>
[/code]
O meu applicationConext-security.xml
[code]<?xml version="1.0" encoding="UTF-8"?>
<b:beans xmlns=“http://www.springframework.org/schema/security”
xmlns:b=“http://www.springframework.org/schema/beans”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd”>
<intercept-url pattern="/admin/**" access="ROLE_ADMINISTRADOR" />
<intercept-url pattern="/restrito/**" access="ROLE_USUARIO" />
<form-login login-page="/publico/login.jsf"
always-use-default-target="true" default-target-url="/restrito/principal.jsf"
authentication-failure-url="/publico/login.jsf?login_error=1" />
<logout/>
<remember-me />
</http>
<authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="financeiroDataSource"
authorities-by-username-query="SELECT login, permissao FROM usuario WHERE login = ?"
users-by-username-query="SELECT login, senha, ativo FROM usuario WHERE login = ?" />
</authentication-provider>
</authentication-manager>
</b:beans>[/code]
Meu web.xml:
[code]
contextConfigLocation
/WEB-INF/applicationContext.xml
/WEB-INF/applicationContext-security.xml
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<resource-ref>
<description>DataSource FinaceiroDB</description>
<res-ref-name>jdbc/FinanceiroDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>[/code]
Amigos agradeço qualquer ajuda ou dica pois já tem varios dias que quebro cabeça com esse código.
forte abraço.