-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: i was not able to add a record to my database
PostPosted: Tue Jan 11, 2005 4:57 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
Hibernate version: 2.1.7

Full stack trace of any exception that occurs:

Name and version of the database you are using:mysql v4

could anyone please take a look at my problem on where did i go wrong
im using jboss+hibernate+mysql+jsp
i was able to set mysql with jboss, and here is the print screen of what it occur after running jsp http://www.geocities.com/h_a_n_d_man/error.bmp

tnkx


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 11, 2005 5:32 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Thats not good enough.
Read the rules of the forum. Post your complete stack trace in the space provided along with the other documents requested


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 12:06 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
tnkx for replying me
here is the complete list of things that i've done so far
1. i copy mysql-ds.xml to deploy folder then i also set the datasource in standardjbosscmp-jdbc.xml under conf folder. lastly i copied mysql-jdbc2-service.xml to jms folder under deploy

2. i created a folder dev.war inside i hav meta-inf and web-inf. under web-inf i have lib, classes, and src folders. i placed the hibernate.properties under web-inf

#hibernate.properties
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/phonebook
hibernate.connection.username=
hibernate.connection.password=

under src i have the following java files addPerson.java and Person.java
here are the codes for each
Person.java
package conn;
public class Person{
private String id;
private String name;
private String address;
private String tel;

public String getId() {
return id;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
public String getTel() {
return tel;
}
public void setId(String str) {
id = str;
}
public void setName(String str) {
name = str;
}
public void setAddress(String str) {
address = str;
}
public void setTel(String str) {
tel = str;
}
public String toString() {
return "[Person] " + name + "(" + id + ") address=" + address + " telephone#=" + tel;
}
}

addPerson.java
package conn;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.Transaction;
import net.sf.hibernate.cfg.Configuration;
import conn.*;

public class addPerson {
public addPerson() {
Person p = new Person();
p.setName("shou-jen");
p.setAddress("unit 810 princeville cond. s.laurel st. mandaluyong m.m.");
p.setTel("531-5299");
try {
Configuration cfg = new Configuration().addClass(conn.Person.class);
SessionFactory sf = cfg.buildSessionFactory();

Session s = sf.openSession();

Transaction t = s.beginTransaction();
s.save(p);
t.commit();
s.close();
} catch(Exception e) {}
}
/* public static void main(String[] args) {
addPerson a = new addPerson();
}*/
}

under classes\conn i have the 2 class file that i have compiled successful in my jcreator, then i also place my Person.hbm.xml file

Person.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="conn.Person" table="person">
<!-- A 32 hex character is our surrogate key. It's automatically
generated by Hibernate with the UUID pattern. -->
<id name="id" type="string" unsaved-value="null">
<column name="id" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex"/>
</id>

<property name="name">
<column name="name" sql-type="char(50)" not-null="true"/>
</property>

<property name="address">
<column name="address" sql-type="char(255)" not-null="true"/>
</property>

<property name="tel">
<column name="tel" sql-type="char(15)" not-null="true"/>
</property>
</class>
</hibernate-mapping>

3. i placed a jsp file under dev folder
y.jsp
<%@ page import="conn.*" %>
<%
addPerson a = new addPerson();
%>

4. now i run jboss\bin\run

then i got these messages http://www.geocities.com/h_a_n_d_man/error.bmp and my database does not reflect ...

note: there were no any error when i run jboss

tnkx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 5:19 am 
Newbie

Joined: Tue Jan 11, 2005 9:51 am
Posts: 10
hello

from the first view - I should say that I do not understand why you are deploying MySQL datasource (mysql-ds.xml) and not using it??

I am not sure will this help or not, but I suggest to check that your mysql-ds.xml at least looks the same as this one:

Code:
<?xml version="1.0" encoding="UTF-8"?>

<datasources>
   <local-tx-datasource>
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>userjboss</user-name>
      <password>zzz</password>
      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
   </local-tx-datasource>
</datasources>


please, note, that jbossdb is name of database, userjboss and zzz are login and password to access this database.
MySqlDS will be the name of datasource.

here is part of hibernate.cfg.xml which uses it:

Code:
...
<hibernate-configuration>
   <session-factory name="java:/hibernate/HibernateFactory">
      <property name="show_sql">true</property>
      <property name="connection.datasource">java:/MySqlDS</property>
      <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
      <property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</property>
      <property name="transaction.factory.class">org.hibernate.transaction.JTATransactionFactory</property>
...
   </session-factory>
</hibernate-configuration>



please note, that instead of org.hibernate.transaction.JTATransactionFactory you probably will better use net.sf.hibernate.transaction.JDBCTransactionFactory because first one -- delegates to JTA, and should be used with CMT, and last one -- delegates to direct JDBC transactions.



to crown it all, I hope you will not find it difficult to change above given hibernate.cfg.xml into yours hibernate.properties.

also, I can suggest you to take a look of your JBoss log file, where you will be able to see if any problems happened.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 5:28 am 
Newbie

Joined: Tue Jan 11, 2005 9:51 am
Posts: 10
oops!

sorry, I didn't take a look of yours http://www.geocities.com/h_a_n_d_man/error.bmp file from the very beginning, but now I see where is the problem.

I guess you saw the following message:
Code:
...
16:25:37,059  INFO   [Environment] hibernate.properties not found
...


that means that Hibernate can't locate your configuration file.

at this step it would be better if you'll explain how you deploy your WAR or EAR, and where are you keeping hibernate.properties and all Hibernate-related runtime JARs.

also, even now I can suggest you to use hibernate.cfg.xml, and load it this way:

Code:
...
SessionFactory sessF = new Configuration().configure("/path/to/hibernate.cfg.xml").buildSessionFactory();
...


many developers find it to be more intuitive and natural than all other variants of keeping Hibernate configuration.
of course, it's only up to you. :-)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 5:48 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
thnkx so much for your reply

this is how i organized my file though im not sure if this is the right way...
i have a folder named dev.war
then under that folder i have 2 subfolder which is META-INF and WEB-INF. then under WEB-INF i have 2 folders which is the classes and lib folder.
then under classes folder i have conn folder which is the place where i store my .class files and my Person.hbm.xml file
my hibernate.properties is placed under WEB-INF folder
so.. basically thats it...

in a graphical way..
META-INF
WEB-INF
-----classes
----------conn
-----------------Person.class
-----------------addPerson.class
-----------------Person.hbm.xml
-----lib
----------all the lib in hibernate and jar file of mysql
-----hibernate.properties
-----jboss-web.xml (with nothng in it)

can you share to me how you structured your files toward the goal of using jboss + hibernate + mysql?

tnkx


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 5:58 am 
Newbie

Joined: Tue Jan 11, 2005 9:51 am
Posts: 10
I am not sure where Hibernate is actually looking for hibernate.properties -- but from what I can just remember may be you need to put it at the root of your WAR's CLASSPATH, what means right into your /WEB-INF/classes directory.


try this way and tell me if this helps.


in future, I still can only suggest to use hibernate.cfg.xml. at least we will be able to directly specify its full path.


it also will be good if you will show your systems CLASSPATH environment variable. in some case I've notice that if it contains Hibernate jar's, there could be problem for container with locating place of Hibernate configuration files.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 8:23 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
i did not set any classpath...
how do you set classpath? what i did was copy all the libraries to the jboss lib folder and web-inf\lib folder

about that hibernate.cfg.xml, where will i place it?
im no longer using hibernate.properties since you've said many developers are having problems in it. so i have changed it to hibernate.cfg.xml and adding that sessionfactory line into my code.

did i miss anything or the way that i was doing were wrong...
coz i've read other websites and forum what they did was to war it
but what i did just change d folder name (the folder where i placed everything) into dev.war.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 8:45 am 
Newbie

Joined: Tue Jan 11, 2005 9:51 am
Posts: 10
classpath -- there are different classpaths. classpath of your war is where container will look for all classes in your war
your system classpath - could be used (loaded) by many applications

you need to put hibernate.cfg.xml into META-INF/ and set path to it into ...new Coniguration().configure(....)...

I didn't say that many developer's have problems with hibernate.properties, I just mentioned that many my friends prefer using hibernate.cfg.xml

you didn't tell me -- is everything works now or not?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 8:46 am 
Newbie

Joined: Tue Jan 11, 2005 9:51 am
Posts: 10
solen wrote:
what i did was copy all the libraries to the jboss lib folder and web-inf\lib folder


you DO NOT NEED to put hibernate/mysql jar's everywhere!
just put them into your WAR's web-inf/lib folder.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 10:54 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
so far... same message have occur....
no progress yet....
im getting crazy ...
my jboss is version 3.2.6 and i dont think it is jboss problem

i also use the same java files and jsp in tomcat
it got compiled and did not reflect in the database...

i thnk i will have to do a thorough check out on what am i missing...

could you give me a copy of thier work or samples? any may do
if that is alright with you...

tnkx again


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 12, 2005 12:56 pm 
Newbie

Joined: Tue Jan 11, 2005 9:51 am
Posts: 10
solen wrote:
so far... same message have occur....
no progress yet....
im getting crazy ...


I do not understand that.
what exactly do you mean?
if you are using hibernate.cfg.xml, why do you care about this message?
can I see your logs?
and can I see what you have in your CLASSPATH system environment variable?

(type in command line:
echo %CLASSPATH%
and show me, please).

solen wrote:
i also use the same java files and jsp in tomcat
it got compiled and did not reflect in the database...


show me logs of Jboss and/or Tomcat.
I prefer Jboss's logs.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 2:55 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
im sorry for the late reply
i had no internet for the past 12 hrs...

this is my classpath after typing echo %classpath% in command prompt

c:\j2sdk1.4.2\lib\tools.jar;c:\j2sdk1.4.2\jre\lib\rt.jar;C:\Sun\AppServer\lib\j2ee.jar;test.jar;C:\dev\omega\WEB-INF\lib\struts.jar;C:\Hibernate v2.1.7c\hibernate2.jar

dude i have changed my addPerson.java into
package conn;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.Transaction;
import net.sf.hibernate.cfg.Configuration;
import conn.*;

public class addPerson {
public addPerson() {
Person p = new Person();
p.setName("shou-jen");
p.setAddress("unit 810 princeville cond. s.laurel st. mandaluyong m.m.");
p.setTel("531-5299");
try {
Configuration cfg = new Configuration().addClass(conn.Person.class);
SessionFactory sf = cfg.buildSessionFactory();

Session s = sf.openSession();

Transaction t = s.beginTransaction();
s.save(p);
t.commit();
s.close();
} catch(Exception e) {}
}
/* public static void main(String[] args) {
addPerson a = new addPerson();
}*/
}

and i have removed hibernate.properties and replace it to hibernate.cfg.xml. i placed it under META-INF
so now my dev.war folder looks like this
dev.war
------META-INF
------------hibernate.cfg.xml
------WEB-INF
------------classes
------------------conn
------------------------Person.class
------------------------addPerson.class
------------------------Person.hbm.xml
------------lib
------------------------all hibernate library

this is the content of my server.log
...
2005-01-13 14:49:04,739 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 150000
2005-01-13 14:49:57,826 INFO [net.sf.hibernate.cfg.Environment] Hibernate 2.1.5
2005-01-13 14:49:58,046 INFO [net.sf.hibernate.cfg.Environment] hibernate.properties not found
2005-01-13 14:49:58,086 INFO [net.sf.hibernate.cfg.Environment] using CGLIB reflection optimizer
2005-01-13 14:49:58,156 INFO [net.sf.hibernate.cfg.Configuration] configuring from resource: /conn/hibernate.cfg.xml
2005-01-13 14:49:58,156 INFO [net.sf.hibernate.cfg.Configuration] Configuration resource: /conn/hibernate.cfg.xml
2005-01-13 14:49:58,447 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under net/sf/hibernate/
2005-01-13 14:49:58,477 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath
2005-01-13 14:49:58,517 DEBUG [net.sf.hibernate.cfg.Configuration] show_sql=true
2005-01-13 14:49:58,517 DEBUG [net.sf.hibernate.cfg.Configuration] connection.datasource=java:/MySqlDS
2005-01-13 14:49:58,517 DEBUG [net.sf.hibernate.cfg.Configuration] dialect=net.sf.hibernate.dialect.MySQLDialect
2005-01-13 14:49:58,517 DEBUG [net.sf.hibernate.cfg.Configuration] transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup
2005-01-13 14:49:58,517 DEBUG [net.sf.hibernate.cfg.Configuration] transaction.factory.class=net.sf.hibernate.transaction.JDBCTransactionFactory
2005-01-13 14:49:58,517 DEBUG [net.sf.hibernate.cfg.Configuration] java:/hibernate/HibernateFactory<-org.dom4j.tree.DefaultAttribute@a193fe [Attribute: name resource value "conn/Person.hbm.xml"]
2005-01-13 14:49:58,517 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: conn/Person.hbm.xml
2005-01-13 14:49:58,557 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
2005-01-13 14:49:58,557 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
2005-01-13 14:49:59,518 INFO [net.sf.hibernate.cfg.Binder] Mapping class: conn.Person -> person
2005-01-13 14:50:00,039 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: id -> id, type: string
2005-01-13 14:50:00,159 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: name -> name, type: string
2005-01-13 14:50:00,159 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: address -> address, type: string
2005-01-13 14:50:00,159 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: tel -> tel, type: string
2005-01-13 14:50:00,159 INFO [net.sf.hibernate.cfg.Configuration] Configured SessionFactory: java:/hibernate/HibernateFactory
2005-01-13 14:50:00,159 DEBUG [net.sf.hibernate.cfg.Configuration] properties: {show_sql=true, java.vendor=Sun Microsystems Inc., catalina.base=C:\jboss-3.2.6\server\default, connection.datasource=java:/MySqlDS, catalina.useNaming=false, os.name=Windows 2000, sun.boot.class.path=c:\j2sdk1.4.2\jre\lib\rt.jar;c:\j2sdk1.4.2\jre\lib\i18n.jar;c:\j2sdk1.4.2\jre\lib\sunrsasign.jar;c:\j2sdk1.4.2\jre\lib\jsse.jar;c:\j2sdk1.4.2\jre\lib\jce.jar;c:\j2sdk1.4.2\jre\lib\charsets.jar;c:\j2sdk1.4.2\jre\classes, sun.java2d.fontpath=, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.4.2-b28, user.name=shou-jen, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, jboss.bind.address=0.0.0.0, hibernate.session_factory_name=java:/hibernate/HibernateFactory, jboss.home.dir=C:\jboss-3.2.6, user.language=en, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, sun.boot.library.path=c:\j2sdk1.4.2\jre\bin, dialect=net.sf.hibernate.dialect.MySQLDialect, jboss.home.url=file:/C:/jboss-3.2.6/, java.version=1.4.2, version=2.4.1, user.timezone=GMT+08:00, jboss.server.home.dir=C:\jboss-3.2.6\server\default, sun.arch.data.model=32, java.endorsed.dirs=c:\j2sdk1.4.2\jre\lib\endorsed, jboss.server.home.url=file:/C:/jboss-3.2.6/server/default/, sun.cpu.isalist=pentium i486 i386, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., file.separator=\, java.specification.name=Java Platform API Specification, hibernate.cglib.use_reflection_optimizer=true, java.class.version=48.0, jboss.server.config.url=file:/C:/jboss-3.2.6/server/default/conf/, user.country=US, java.home=c:\j2sdk1.4.2\jre, java.vm.info=mixed mode, jboss.lib.url=file:/C:/jboss-3.2.6/lib/, os.version=5.0, hibernate.connection.datasource=java:/MySqlDS, path.separator=;, java.vm.version=1.4.2-b28, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, user.variant=, vendor-url=http://xml.apache.org/xalan-j, java.protocol.handler.pkgs=org.jboss.net.protocol, java.awt.printerjob=sun.awt.windows.WPrinterJob, vendor=Apache Software Foundation, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup, jboss.server.temp.dir=C:\jboss-3.2.6\server\default\tmp, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces, user.home=C:\Documents and Settings\shou-jen, java.rmi.server.RMIClassLoaderSpi=org.jboss.system.JBossRMIClassLoader, java.specification.vendor=Sun Microsystems Inc., org.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl, java.library.path=c:\j2sdk1.4.2\bin;.;C:\WINNT\system32;C:\WINNT;d:\client\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\apache-ant-1.5.4\bin;c:\jikes-1.21\bin;c:\j2sdk1.4.2\bin;c:\mysql\bin;C:\Hibernate v2.1.7c\lib;C:\Sun\AppServer\bin, java.vendor.url=http://java.sun.com/, program.name=run.bat, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, common.loader=${catalina.home}/common/classes,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=c:\j2sdk1.4.2\lib\tools.jar;C:\jboss-3.2.6\bin\\run.jar, jbossmx.loader.repository.class=org.jboss.mx.loading.UnifiedLoaderRepository3, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, catalina.home=C:\jboss-3.2.6\server\default, sun.cpu.endian=little, sun.os.patch.level=Service Pack 4, jboss.server.lib.url=file:/C:/jboss-3.2.6/server/default/lib/, java.rmi.server.codebase=http://phil:8083/, java.io.tmpdir=C:\DOCUME~1\shou-jen\LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, jboss.server.data.dir=C:\jboss-3.2.6\server\default\data, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=c:\j2sdk1.4.2\jre\lib\ext, user.dir=C:\jboss-3.2.6\bin, transaction.factory.class=net.sf.hibernate.transaction.JDBCTransactionFactory, hibernate.transaction.factory.class=net.sf.hibernate.transaction.JDBCTransactionFactory, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, jboss.server.base.dir=C:\jboss-3.2.6\server, jboss.server.base.url=file:/C:/jboss-3.2.6/server/, javax.management.builder.initial=org.jboss.mx.server.MBeanServerBuilderImpl, file.encoding=Cp1252, catalina.ext.dirs=C:\jboss-3.2.6\server\default\lib, hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup, java.specification.version=1.4, jboss.server.name=default, hibernate.show_sql=true}
2005-01-13 14:50:00,169 INFO [net.sf.hibernate.cfg.Configuration] processing one-to-many association mappings
2005-01-13 14:50:00,169 INFO [net.sf.hibernate.cfg.Configuration] processing one-to-one association property references
2005-01-13 14:50:00,169 INFO [net.sf.hibernate.cfg.Configuration] processing foreign key constraints
2005-01-13 14:50:00,650 INFO [net.sf.hibernate.dialect.Dialect] Using dialect: net.sf.hibernate.dialect.MySQLDialect
2005-01-13 14:50:00,700 INFO [net.sf.hibernate.cfg.SettingsFactory] Use outer join fetching: false
2005-01-13 14:50:00,790 INFO [net.sf.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
2005-01-13 14:50:01,040 INFO [net.sf.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:/MySqlDS
2005-01-13 14:50:01,190 INFO [net.sf.hibernate.transaction.TransactionManagerLookupFactory] instantiating TransactionManagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
2005-01-13 14:50:01,291 INFO [net.sf.hibernate.transaction.TransactionManagerLookupFactory] instantiated TransactionManagerLookup
2005-01-13 14:50:01,291 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] internalRegisterPool: registering pool with interval 900000 old interval: 150000
2005-01-13 14:50:01,291 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=x, password=--hidden--}
2005-01-13 14:50:01,291 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Checking driver for URL: jdbc:mysql://localhost/phonebook
2005-01-13 14:50:01,291 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver not yet registered for url: jdbc:mysql://localhost/phonebook
2005-01-13 14:50:01,331 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver already registered for url: jdbc:mysql://localhost/phonebook
2005-01-13 14:50:04,746 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
2005-01-13 14:50:04,746 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
2005-01-13 14:50:04,746 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
2005-01-13 14:50:04,625 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:168)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:508)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:444)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:298)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at conn.addPerson.<init>(addPerson.java:17)
at org.apache.jsp.y_jsp._jspService(y_jsp.java:46)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:158)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:652)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
at com.mysql.jdbc.Connection.<init>(Connection.java:486)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:326)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:158)
... 51 more
2005-01-13 14:50:04,866 WARN [net.sf.hibernate.cfg.SettingsFactory] Could not obtain connection metadata
org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)))
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at conn.addPerson.<init>(addPerson.java:17)
at org.apache.jsp.y_jsp._jspService(y_jsp.java:46)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:158)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:168)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:508)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:444)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:298)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
... 43 more
Caused by: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:652)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
at com.mysql.jdbc.Connection.<init>(Connection.java:486)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:326)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:158)
... 51 more
2005-01-13 14:50:04,906 INFO [net.sf.hibernate.cfg.SettingsFactory] Use scrollable result sets: false
2005-01-13 14:50:04,906 INFO [net.sf.hibernate.cfg.SettingsFactory] Use JDBC3 getGeneratedKeys(): false
2005-01-13 14:50:04,906 INFO [net.sf.hibernate.cfg.SettingsFactory] Optimize cache for minimal puts: false
2005-01-13 14:50:04,906 INFO [net.sf.hibernate.cfg.SettingsFactory] echoing all SQL to stdout
2005-01-13 14:50:04,906 INFO [net.sf.hibernate.cfg.SettingsFactory] Query language substitutions: {}
2005-01-13 14:50:04,906 INFO [net.sf.hibernate.cfg.SettingsFactory] cache provider: net.sf.ehcache.hibernate.Provider
2005-01-13 14:50:04,946 INFO [net.sf.hibernate.cfg.Configuration] instantiating and configuring caches
2005-01-13 14:50:06,769 INFO [net.sf.hibernate.impl.SessionFactoryImpl] building session factory
2005-01-13 14:50:06,779 DEBUG [net.sf.hibernate.impl.SessionFactoryImpl] instantiating session factory with properties: {show_sql=true, java.vendor=Sun Microsystems Inc., catalina.base=C:\jboss-3.2.6\server\default, connection.datasource=java:/MySqlDS, catalina.useNaming=false, os.name=Windows 2000, sun.boot.class.path=c:\j2sdk1.4.2\jre\lib\rt.jar;c:\j2sdk1.4.2\jre\lib\i18n.jar;c:\j2sdk1.4.2\jre\lib\sunrsasign.jar;c:\j2sdk1.4.2\jre\lib\jsse.jar;c:\j2sdk1.4.2\jre\lib\jce.jar;c:\j2sdk1.4.2\jre\lib\charsets.jar;c:\j2sdk1.4.2\jre\classes, sun.java2d.fontpath=, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.4.2-b28, user.name=shou-jen, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, jboss.bind.address=0.0.0.0, hibernate.session_factory_name=java:/hibernate/HibernateFactory, jboss.home.dir=C:\jboss-3.2.6, user.language=en, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, sun.boot.library.path=c:\j2sdk1.4.2\jre\bin, dialect=net.sf.hibernate.dialect.MySQLDialect, jboss.home.url=file:/C:/jboss-3.2.6/, java.version=1.4.2, version=2.4.1, user.timezone=GMT+08:00, jboss.server.home.dir=C:\jboss-3.2.6\server\default, sun.arch.data.model=32, java.endorsed.dirs=c:\j2sdk1.4.2\jre\lib\endorsed, jboss.server.home.url=file:/C:/jboss-3.2.6/server/default/, sun.cpu.isalist=pentium i486 i386, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., file.separator=\, java.specification.name=Java Platform API Specification, hibernate.cglib.use_reflection_optimizer=true, java.class.version=48.0, jboss.server.config.url=file:/C:/jboss-3.2.6/server/default/conf/, user.country=US, java.home=c:\j2sdk1.4.2\jre, java.vm.info=mixed mode, jboss.lib.url=file:/C:/jboss-3.2.6/lib/, os.version=5.0, hibernate.connection.datasource=java:/MySqlDS, path.separator=;, java.vm.version=1.4.2-b28, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, user.variant=, vendor-url=http://xml.apache.org/xalan-j, java.protocol.handler.pkgs=org.jboss.net.protocol, java.awt.printerjob=sun.awt.windows.WPrinterJob, vendor=Apache Software Foundation, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup, jboss.server.temp.dir=C:\jboss-3.2.6\server\default\tmp, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces, user.home=C:\Documents and Settings\shou-jen, java.rmi.server.RMIClassLoaderSpi=org.jboss.system.JBossRMIClassLoader, java.specification.vendor=Sun Microsystems Inc., org.xml.sax.driver=org.apache.crimson.parser.XMLReaderImpl, java.library.path=c:\j2sdk1.4.2\bin;.;C:\WINNT\system32;C:\WINNT;d:\client\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\apache-ant-1.5.4\bin;c:\jikes-1.21\bin;c:\j2sdk1.4.2\bin;c:\mysql\bin;C:\Hibernate v2.1.7c\lib;C:\Sun\AppServer\bin, java.vendor.url=http://java.sun.com/, program.name=run.bat, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, common.loader=${catalina.home}/common/classes,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=c:\j2sdk1.4.2\lib\tools.jar;C:\jboss-3.2.6\bin\\run.jar, jbossmx.loader.repository.class=org.jboss.mx.loading.UnifiedLoaderRepository3, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, catalina.home=C:\jboss-3.2.6\server\default, sun.cpu.endian=little, sun.os.patch.level=Service Pack 4, jboss.server.lib.url=file:/C:/jboss-3.2.6/server/default/lib/, java.rmi.server.codebase=http://phil:8083/, java.io.tmpdir=C:\DOCUME~1\shou-jen\LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, jboss.server.data.dir=C:\jboss-3.2.6\server\default\data, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=c:\j2sdk1.4.2\jre\lib\ext, user.dir=C:\jboss-3.2.6\bin, transaction.factory.class=net.sf.hibernate.transaction.JDBCTransactionFactory, hibernate.transaction.factory.class=net.sf.hibernate.transaction.JDBCTransactionFactory, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, jboss.server.base.dir=C:\jboss-3.2.6\server, jboss.server.base.url=file:/C:/jboss-3.2.6/server/, javax.management.builder.initial=org.jboss.mx.server.MBeanServerBuilderImpl, file.encoding=Cp1252, catalina.ext.dirs=C:\jboss-3.2.6\server\default\lib, hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JBossTransactionManagerLookup, java.specification.version=1.4, jboss.server.name=default, hibernate.show_sql=true}
2005-01-13 14:50:08,441 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] initializing class SessionFactoryObjectFactory
2005-01-13 14:50:08,461 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] registered: 40288157016ad60201016ad60e550000 (java:/hibernate/HibernateFactory)
2005-01-13 14:50:08,461 INFO [net.sf.hibernate.impl.SessionFactoryObjectFactory] Factory name: java:/hibernate/HibernateFactory
2005-01-13 14:50:08,461 INFO [net.sf.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
2005-01-13 14:50:08,471 DEBUG [net.sf.hibernate.util.NamingHelper] binding: java:/hibernate/HibernateFactory
2005-01-13 14:50:08,471 DEBUG [net.sf.hibernate.impl.SessionFactoryImpl] Returning a Reference to the SessionFactory
2005-01-13 14:50:08,471 DEBUG [net.sf.hibernate.util.NamingHelper] lookup: java:
2005-01-13 14:50:08,471 DEBUG [net.sf.hibernate.util.NamingHelper] Found subcontext: java:
2005-01-13 14:50:08,471 DEBUG [net.sf.hibernate.util.NamingHelper] lookup: hibernate
2005-01-13 14:50:08,471 INFO [net.sf.hibernate.util.NamingHelper] Creating subcontext: hibernate
2005-01-13 14:50:08,471 DEBUG [net.sf.hibernate.util.NamingHelper] binding: HibernateFactory
2005-01-13 14:50:08,471 DEBUG [net.sf.hibernate.impl.SessionFactoryImpl] Returning a Reference to the SessionFactory
2005-01-13 14:50:08,471 DEBUG [net.sf.hibernate.util.NamingHelper] Bound name: java:/hibernate/HibernateFactory
2005-01-13 14:50:08,471 INFO [net.sf.hibernate.impl.SessionFactoryObjectFactory] Bound factory to JNDI name: java:/hibernate/HibernateFactory
2005-01-13 14:50:08,511 WARN [net.sf.hibernate.impl.SessionFactoryObjectFactory] InitialContext did not implement EventContext
2005-01-13 14:50:08,511 DEBUG [net.sf.hibernate.impl.SessionFactoryImpl] instantiated session factory
2005-01-13 14:50:08,511 DEBUG [net.sf.hibernate.impl.SessionFactoryImpl] obtaining JTA TransactionManager
2005-01-13 14:50:08,511 INFO [net.sf.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
2005-01-13 14:50:08,801 DEBUG [net.sf.hibernate.impl.SessionImpl] opened session
2005-01-13 14:50:08,801 DEBUG [net.sf.hibernate.transaction.JDBCTransaction] begin
2005-01-13 14:50:08,811 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=x, password=--hidden--}
2005-01-13 14:50:08,841 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:168)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:508)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:444)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:298)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3302)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3282)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2227)
at conn.addPerson.<init>(addPerson.java:21)
at org.apache.jsp.y_jsp._jspService(y_jsp.java:46)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:158)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:652)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
at com.mysql.jdbc.Connection.<init>(Connection.java:486)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:326)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:158)
... 54 more
2005-01-13 14:50:09,162 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] SQL Exception
org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)))
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3302)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3282)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2227)
at conn.addPerson.<init>(addPerson.java:21)
at org.apache.jsp.y_jsp._jspService(y_jsp.java:46)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:158)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:168)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:508)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:444)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:298)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
... 46 more
Caused by: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:652)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
at com.mysql.jdbc.Connection.<init>(Connection.java:486)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:326)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:158)
... 54 more
2005-01-13 14:50:09,172 WARN [net.sf.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null
2005-01-13 14:50:09,172 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)))
2005-01-13 14:50:09,192 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] Cannot open connection
org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)))
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3302)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3282)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2227)
at conn.addPerson.<init>(addPerson.java:21)
at org.apache.jsp.y_jsp._jspService(y_jsp.java:46)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:158)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:168)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:508)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:444)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:298)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
... 46 more
Caused by: java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:652)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
at com.mysql.jdbc.Connection.<init>(Connection.java:486)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:326)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:158)
... 54 more
2005-01-13 14:50:41,448 DEBUG [net.sf.hibernate.impl.SessionImpl] running Session.finalize()


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 3:05 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
sorry for the mistype, my hibernate.hbm.xml is not in META-INF instead i put it under classes/conn/

that is why i have SessionFactory sf = new Configuration().configure("/conn/hibernate.cfg.xml").buildSessionFactory();


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 13, 2005 4:26 am 
Newbie

Joined: Tue Jan 11, 2005 9:51 am
Posts: 10
okay, it doesn't matter.

solen you definately need to pay more attention to log files.
please, read them carefully once again. there is really nothing more than just few tiny bugs, which you just do not want to see.


examine logs, and you will be able to find out that Hibernate sucessfully found your configuration file, he also took all configuration rules, but he wasn't able to use your Managed Connection Pool. why? explanation is on the top - because your data source wasn't properly installed. again "why?"?

take a look below or just take a look of your logs

Code:
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Invalid authorization specification: Access denied for user: 'x@localhost' (Using password: YES))


I do not know how you configured your MySQL server, but you see that it doesn't allow your user with password to connect to specified database.

find out yourself why.

enjoy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.