[Hibernate 3/ Tomcat 5.5] Problème de connexion à la base de données

Le
Bernard Koninckx
Bonjour à tous,

Voilà, je me lance dans le développement J2EE et plus précisément des
Servlet et JSP. Je souhaite assurer le mapping de mes données en utilisant
Hibernate. Si j'effectue un essai de connexion direct avec une JSP et JSTL
(sans passer par Hibernate) cela fonctionne parfaitement. Par contre une
fois que j'essaye avec une servlet et Hibernate tout casse et je comprends
pas pourquoi.

Je vous remercie d'avance pour les avis éclairés et l'aide que vous
m'apporterez.

Bernard

Voici, mon descripteur de Context :

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/CandidatureManager">
<Resource name="jdbc/JobDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="Bra1n01s"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/Job?autoReconnect=true"/>
</Context>
-
--
Voici mon fichier de config Hibernate :

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration//EN"

"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<hibernate-configuration>

<session-factory>
<!-- properties -->
<property
name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property
name="connection.datasource">java:comp/env/jdbc/JobDB</property>

<!-- mapping files -->
<mapping
resource="com/candidaturemanager/hibernate/I18nsectionpage.hbm.xml"/>

</session-factory>

</hibernate-configuration>
-
--
Mon fichier de mapping

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"

"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Thu Sep 01 12:57:17 CEST 2005 -->
<hibernate-mapping package="com.candidaturemanager.hibernate">

<class name="I18nsectionpage" table="i18nsectionpage">
<id name="id" column="id" type="java.lang.Integer">
<generator class="identity"/>
</id>

<property name="pageName" column="page_name" type="java.lang.String"
not-null="true" />
<property name="order" column="order" type="java.lang.Integer"
not-null="true" />
<property name="locale" column="locale" type="java.lang.String"
not-null="true" />
<property name="subject" column="subject" type="java.lang.String"
not-null="true" />
</class>
<sql-query name="i18nsection">
<return alias="section" class="I18nsectionpage"/>
Select order,locale, subject from I18nsectionpage where pageName=? and
locale like (? + '%');
</sql-query>

</hibernate-mapping>


-
-
La classe qui poserait problème:

package com.candidaturemanager.hibernate;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;

/**
* Configures and provides access to Hibernate sessions, tied to the
* current thread of execution. Follows the Thread Local Session
* pattern, see {@link http://hibernate.org/42.html}.
*/
public class CandidatureFactory {

/**
* Location of hibernate.cfg.xml file.
* NOTICE: Location should be on the classpath as Hibernate uses
* #resourceAsStream style lookup for its configuration file. That
* is place the config file in a Java package - the default location
* is the default Java package.<br><br>
* Examples: <br>
* <code>CONFIG_FILE_LOCATION = "/hibernate.conf.xml".
* CONFIG_FILE_LOCATION = "/com/foo/bar/myhiberstuff.conf.xml".</code>
*/
private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml";

/** Holds a single instance of Session */
private static final ThreadLocal threadLocal = new ThreadLocal();

/** The single instance of hibernate SessionFactory */
private static org.hibernate.SessionFactory sessionFactory;

static{
try{
sessionFactory = new Configuration().
configure(CONFIG_FILE_LOCATION).
buildSessionFactory();
} catch (Throwable ex){
}
}
/**
* Returns the ThreadLocal Session instance. Lazy initialize
* the <code>SessionFactory</code> if needed.
*
* @return Session
* @throws HibernateException
*/
public static Session currentSession() throws HibernateException {
Session session = (Session) threadLocal.get();

if (session == null) {
session = sessionFactory.openSession();
threadLocal.set(session);
}

return session;
}

/**
* Close the single hibernate session instance.
*
* @throws HibernateException
*/
public static void closeSession() throws HibernateException {
Session session = (Session) threadLocal.get();
threadLocal.set(null);

if (session != null) {
session.close();
}
}

/**
* Default constructor.
*/
private CandidatureFactory() {
}

}
-
--
Ma servlet

/*
* Created on 01-sept.-2005
*/
package com.candidaturemanager.strutsclass;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.candidaturemanager.hibernate.CandidatureFactory;
import com.candidaturemanager.hibernate.I18nsectionpage;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
* @author Pat et Ben
*/
public class test extends HttpServlet {

protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException {
Session session = CandidatureFactory.currentSession();
Transaction Tx = session.beginTransaction();
I18nsectionpage section = new I18nsectionpage();
section.setLocale("FR");
section.setOrder(new Integer(1));
section.setPageName("INDEX");
section.setSubject("Coucou");
session.save(section);
Tx.commit();

Tx = session.beginTransaction();
Query query = session.createQuery("select * from I18nsectionpage");
for (java.util.Iterator it = query.iterate(); it.hasNext();){
I18nsectionpage sect = (I18nsectionpage)it.next();
ServletOutputStream out = arg1.getOutputStream();
out.println(sect.getPageName());
}
Tx.commit();
CandidatureFactory.closeSession();
}


protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException {
doGet(arg0, arg1);
}
}
==
Et enfin la trace des erreurs renvoyées par Tomcat

NotifyUtil::java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
at sun.net.www.http.HttpClient.New(HttpClient.java:287)
at sun.net.www.http.HttpClient.New(HttpClient.java:299)
at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnecti
on.java:792)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.j
ava:744)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:6
69)
at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnectio
n.java:836)
at
org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUt
il.java:237)

02-sept.-2005 10:33:01 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.0.5
02-sept.-2005 10:33:02 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
02-sept.-2005 10:33:02 org.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
02-sept.-2005 10:33:02 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
02-sept.-2005 10:33:15 org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
02-sept.-2005 10:33:15 org.hibernate.cfg.Configuration
getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
02-sept.-2005 10:33:29 org.hibernate.cfg.Configuration addResource
INFO: Mapping resource:
com/candidaturemanager/hibernate/I18nsectionpage.hbm.xml
02-sept.-2005 10:33:39 org.hibernate.cfg.HbmBinder
bindRootPersistentClassCommonValues
INFO: Mapping class: com.candidaturemanager.hibernate.I18nsectionpage ->
i18nsectionpage
02-sept.-2005 10:33:42 org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
02-sept.-2005 10:33:42 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing extends queue
02-sept.-2005 10:33:42 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing collection mappings
02-sept.-2005 10:33:42 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing association property references
02-sept.-2005 10:33:42 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
02-sept.-2005 10:33:48 org.hibernate.util.NamingHelper getInitialContext
INFO: JNDI InitialContext
properties:{java.naming.provider.url=java:comp/env/jdbc/JobDB,
java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory}
02-sept.-2005 10:33:49 org.hibernate.util.NamingHelper getInitialContext
GRAVE: Could not obtain initial context
javax.naming.ConfigurationException: Invalid URL: java:comp/env/jdbc/JobDB
[Root exception is java.net.MalformedURLException: unknown protocol: java]
at com.sun.jndi.cosnaming.CNCtx.getStringifiedIor(CNCtx.java:415)
at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:198)
at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
at
com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
at
org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceCo
nnectionProvider.java:44)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(Con
nectionProviderFactory.java:80)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.j
ava:362)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at
com.candidaturemanager.hibernate.CandidatureFactory.currentSession(Candidatu
reFactory.java:49)
at com.candidaturemanager.strutsclass.test.doGet(test.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter
.java:362)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.MalformedURLException: unknown protocol: java
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at com.sun.jndi.cosnaming.CNCtx.getStringifiedIor(CNCtx.java:401)
35 more
02-sept.-2005 10:33:49 org.hibernate.connection.DatasourceConnectionProvider
configure
GRAVE: Could not find datasource: jdbc/JobDB
javax.naming.ConfigurationException: Invalid URL: java:comp/env/jdbc/JobDB
[Root exception is java.net.MalformedURLException: unknown protocol: java]
at com.sun.jndi.cosnaming.CNCtx.getStringifiedIor(CNCtx.java:415)
at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:198)
at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
at
com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
at
org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceCo
nnectionProvider.java:44)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(Con
nectionProviderFactory.java:80)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.j
ava:362)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at
com.candidaturemanager.hibernate.CandidatureFactory.currentSession(Candidatu
reFactory.java:49)
at com.candidaturemanager.strutsclass.test.doGet(test.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter
.java:362)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.MalformedURLException: unknown protocol: java
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at com.sun.jndi.cosnaming.CNCtx.getStringifiedIor(CNCtx.java:401)
35 more
%%%% Error Creating SessionFactory %%%%
org.hibernate.HibernateException: Could not find datasource
at
org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceCo
nnectionProvider.java:48)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(Con
nectionProviderFactory.java:80)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.j
ava:362)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at
com.candidaturemanager.hibernate.CandidatureFactory.currentSession(Candidatu
reFactory.java:49)
at com.candidaturemanager.strutsclass.test.doGet(test.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter
.java:362)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.naming.ConfigurationException: Invalid URL:
java:comp/env/jdbc/JobDB [Root exception is java.net.MalformedURLException:
unknown protocol: java]
at com.sun.jndi.cosnaming.CNCtx.getStringifiedIor(CNCtx.java:415)
at com.sun.jndi.cosnaming.CNCtx.initOrbAndRootContext(CNCtx.java:198)
at com.sun.jndi.cosnaming.CNCtx.<init>(CNCtx.java:69)
at
com.sun.jndi.cosnaming.CNCtxFactory.getInitialContext(CNCtxFactory.java:32)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
at
org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceCo
nnectionProvider.java:44)
26 more
Caused by: java.net.MalformedURLException: unknown protocol: java
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at com.sun.jndi.cosnaming.CNCtx.getStringifiedIor(CNCtx.java:401)
35 more
NotifyUtil::java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
at sun.net.www.http.HttpClient.New(HttpClient.java:287)
at sun.net.www.http.HttpClient.New(HttpClient.java:299)
at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnecti
on.java:792)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.j
ava:744)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:6
69)
at
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnectio
n.java:836)
at
org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUt
il.java:237)

02-sept.-2005 10:33:51 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: "Servlet.service()" pour la servlet test a généré une exception
java.lang.NullPointerException
at
com.candidaturemanager.hibernate.CandidatureFactory.currentSession(Candidatu
reFactory.java:56)
at com.candidaturemanager.strutsclass.test.doGet(test.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter
.java:362)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Thread.java:595)
  • Partager ce contenu :
Vos réponses
Trier par : date / pertinence
Lionel
Le #200891
Bernard Koninckx wrote:
Si j'effectue un essai de connexion direct avec
une JSP et JSTL (sans passer par Hibernate) cela fonctionne


En passant par la meme datasource ?
Le problème semble venir de là.

Bernard Koninckx
Le #200883
Merci,

J'ai suivi ton conseil. Mon hibernate config n'a pas été modifié sur mon
serveur TOMCAT. Grosse boulette de ma part.

Bernard

"Lionel" <SPAMcoollATfreePOINTfr> a écrit dans le message de
news:43181d37$0$32665$
Bernard Koninckx wrote:
Si j'effectue un essai de connexion direct avec
une JSP et JSTL (sans passer par Hibernate) cela fonctionne


En passant par la meme datasource ?
Le problème semble venir de là.





Poster une réponse
Anonyme