[JBoss Seam] - Seam and MySQL - Apparently wrong driver class specified?
by strickla
Hi everyone,
I'm trying to create a new Seam project and use MySQL instead of HSQL.
When I attempt to start up the JBoss AS I get the following exception during initialization:
10:45:03,312 INFO [DatasourceConnectionProvider] Using datasource: java:/mmogwi
| dgetsDatasource
| 10:45:03,328 WARN [JBossManagedConnectionPool] Throwable while attempting to ge
| t a new connection: null
| org.jboss.resource.JBossResourceException: Could not create connection; - nested
| throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver
| class specified for URL: class: com.mysql.jdbc.Driver, url: jdbc:mysql://localho
| st:3306/mmogwidgets)
| at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c
| reateManagedConnection(LocalManagedConnectionFactory.java:179)
| at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.cr
| eateConnectionEventListener(InternalManagedConnectionPool.java:577)
| at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.ge
| tConnection(InternalManagedConnectionPool.java:262)
| at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BaseP
| ool.getConnection(JBossManagedConnectionPool.java:500)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManage
| dConnection(BaseConnectionManager2.java:341)
| at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedCo
| nnection(TxConnectionManager.java:315)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
| onnection(BaseConnectionManager2.java:396)
| at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio
I used mysql Connector/J driver as the library to provide my driver class during seam setup script. It's name is "mysql-connector-java-5.0.6-bin.jar". I modified the build.xml to include that lib in the war when it is deployed. I also changed the dialect in the -ds.xml file so that it uses MySQLDialect.
Here is my data source xml file:
<local-tx-datasource>
| <jndi-name>mmogwidgetsDatasource</jndi-name>
| <connection-url>jdbc:mysql://localhost:3306/mmogwidgets</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>xxx</user-name>
| <password>xxx</password>
| <!--
| <exception-sorter-class-name>
| org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
| </exception-sorter-class-name>
| <metadata>
| <type-mapping>mySQL</type-mapping>
| </metadata>
| -->
| </local-tx-datasource>
and here is my persistence xml file:
<persistence-unit name="mmogwidgets" transaction-type="JTA">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/mmogwidgetsDatasource</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
| <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
| </properties>
| </persistence-unit>
Anyone know what's going wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060874#4060874
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060874
18Â years, 9Â months
[Clustering/JBoss] - Refresh values in HAJNDI object
by comincho
I have an application working in a cluster environment (two nodes) with JBoss 4.0.4.
This app haves a shared object (a bean) in HAJNDI that works as follow:
The master node sets some values (monitoring values) in this bean and as HAJNDI works, this object will be gathered by the other replicated application in cluster. If I want to refresh monitor values from master node, I can do it (I mean, all values are set to zero and the other replicated app in cluster can see refreshed values)
But, JBoss is working in a rare way if I do this from the other node or I don't understand very well how HAJNDI works.
Because, if this process (set all values to zero) is made in the other node, I can see refreshed values in this node only and I can't see refreshed values from the master node.
The question is...why ONLY from the master node I can refresh bean values in HAJNDI? Why not from the other node in cluster?
I have a object (a bean called "transactionInfoBean") published in a HAJNDI tree with this code:
...
p.load(new FileInputStream(new File(path + "/hajndi.properties")));
...
try {
lookup.bind("cluster/beans/" + "transactionInfoBean", transactionInfoBean);
} catch (NameAlreadyBoundException e) {
lookup.rebind("cluster/beans/" + "transactionInfoBean", transactionInfoBean);
}
...
perform some works...
// obtains the remote bean and invokes its refreshStoreCounters() method.
transactionInfoBean = (TransactionInfoBean) lookup.get("cluster/beans/transactionInfoBean");
transactionInfoBean.refreshStoresCounters(localStoreMonitors);
lookup.rebind("cluster/beans/transactionInfoBean", transactionInfoBean);
hajndi.properties file content
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jnp.interfaces
java.naming.provider.url=localhost:1100
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060870#4060870
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060870
18Â years, 9Â months