[jboss-user] [JBoss Seam] - NetBeans, Seam, Hibernate, JBoss problem using MySQL

sandman202 do-not-reply at jboss.com
Tue Mar 6 23:45:27 EST 2007


Yesterday I downloaded the seam-1.2.0.PATCH1. I then ran the seam setup to define my information, then ran the seam new-project. JBoss is defined to use MySQL. 

The first problem I noticed is that Seam setup did not modify the jboss-beans.xml file. It was still defined to use hsqldb, not MySQL as I would of expected.

Then, I created a user entity class. Also, added to the import-dev.sql a couple of records to import. When I started JBoss, I received the following error:

2007-03-06 22:07:59,843 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: (com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown database 'portfolio2')
	at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
	at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:565)
	at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:250)
	at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:491)
	at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
	at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301)
	at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
	at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
	at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
	at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1933)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1216)
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691)
	at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
	at org.jboss.seam.core.EntityManagerFactory.startup(EntityManagerFactory.java:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)



If I manually create my portfolio2 database, I didn't receive the error. The  user database table is created, however, none of the records get imported.

Does anyone have an answer to these 2 questions? Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025664#4025664

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025664



More information about the jboss-user mailing list