Hi all,

My apologies, my Tomcat server version is Apache Tomcat 8.0.29 Server.
The JDK is 1.8

Hope to get some advice what went wrong in regards to the No connection 
specified with project.

Tks & rgds,
Karen
--------------------------------------------
On Fri, 9/22/17, Konstantin Kolinko <knst.koli...@gmail.com> wrote:

 Subject: Re: Help needed - JPA probem - No connection specified with project
 To: "Tomcat Users List" <users@tomcat.apache.org>, "Karen Goh" 
<karenwo...@yahoo.com>
 Date: Friday, September 22, 2017, 10:00 PM
 
 2017-09-22 13:35 GMT+03:00 Karen
 Goh <karenwo...@yahoo.com.invalid>:
 > Hi expert,
 >
 > I have been trying very hard to nail the
 above problem including asking various forums like
 CodeRanch, dream in code etc but to no avail.
 >
 > As such, I am hoping
 to get help from the Apache Tomcat user support.
 >
 > Tools and setting :
 Eclipse Mars, Tomcat 1.8, MySQL, OS : Windows 7, Maven, Java
 JPA with Hibernate framework 5.1.0
 
 There is no such version as "Tomcat
 1.8". I assume that you meant some
 version of Tomcat 8.0.x.
 
 
 > The MySQL setting is
 confirmed correct, as I have managed to insert the data via
 single JDBC connection.
 >
 > Project summary : J2ee servlet with JSP,
 Java JPA in Hibernate framework. (Hibernate is for pure
 insertion of data - many to many relationship)
 >
 > My purpose is to get
 the JNDI datasource working but till now I can't just
 get it work.
 >
 >
 Here's my context.xml :
 >
 > <?xml version="1.0"
 encoding="UTF-8"?>
 >
 <Context path="/Hi5S" docBase="Hi5S"
 crossContext="true" reloadable="true"
 antiResourceLocking="true"
 debug="1">
 >
 <ResourceLink global="jdbc/hi5"
 name="jdbc/hi5"
 type="javax.sql.DataSource"/>
 > <Resource>
 >   
  name="jdbc/hi5"
 >    
 auth="Container"
 >    
 type="javax.sql.DataSource"
 > 
    maxTotal="8"
 >    
 maxActive="100"
 >    
 maxIdle="30"
 >    
 maxWait="-1"
 >    
 username="root"
 >    
 singleton="true"
 >    
 override="true"
 >    
 factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
 >     password="password"
 >      
 alternateUsernameAllowed="true"
 >    
 driverClassName="com.mysql.jdbc.Driver"
 >    
 url="jdbc:mysql://localhost:3306/hi5" />
 >   </Resource>
 >   </Context>
 
 The META-INF/context.xml file of a web
 application must have only one
 of
 <Resource, ResourceLink> elements with the same value
 of "name"
 attribute.
 
 
 If you have a
 ResourceLink in context.xml, it means that your Resource
 element must go into GlobalNamingResources
 element of conf/server.xml
 file.
 http://tomcat.apache.org/tomcat-8.5-doc/config/globalresources.html
 
 
 BTW, you
 should not modify conf/context.xml file. It is the
 defaults
 file shared by all web
 applications. (Modifying it is a common
 configuration mistake).
 
 
 Best regards,
 Konstantin Kolinko
 
 ---------------------------------------------------------------------
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to