• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

could not connect to mysql

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
i am a newer with jboss, mysql and use eclipse , i did the following steps to make jboss to connect mysql to run my servlet :
1.create mysql data base [db.name]
2.copy mm.mysql-2.0.14-bin.jar to [jboss.dir]/server/default/lib
3. server/default/conf/standardjbosscmp-jdbc.xml, replace the Hyper SQL with these 2:
<datasource>java:/MySqlDS</datasource>
<datasource-mapping>mySQL</datasource-mapping>
4. server/default/conf/standardjaws.xml, replace the Hyper SQL with these 2:
<datasource>java:/MySqlDS</datasource>
<type-mapping>mySQL</type-mapping>
5. copy docs/examples/jca/mysql-service.xml into /server/default/deploy
6. update mysql-service.xml with your MySql login/password, and use the following:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<server>
<!-- ==================================================================== -->
<!-- New ConnectionManager setup for mysql using 2.0.11 driver -->
<!-- Build jmx-api (build/build.sh all) and view for config documentation -->
<!-- ==================================================================== -->
<mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=MySqlDS">

<!-- Include a login module configuration named MySqlDbRealm.
Update your login-conf.xml, here is an example for a
ConfiguredIdentityLoginModule:
<application-policy name = "MySqlDbRealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
<module-option name = "principal">yourprincipal</module-option>
<module-option name = "userName">yourusername</module-option>
<module-option name = "password">yourpassword</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
</login-module>
</authentication>
</application-policy>
NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
module-option name = "managedConnectionFactoryName"
must match the object name of the ConnectionManager you are configuring here.
-->
<!--uncomment out this line if you are using the MySqlDbRealm above
<attribute name="SecurityDomainJndiName">MySqlDbRealm</attribute>
-->
<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
<mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=MySqlDS">
<attribute name="JndiName">MySqlDS</attribute>
<attribute name="ManagedConnectionFactoryProperties">
<properties>
<config-property name="ConnectionUrl" type="java.lang.String">jdbc:mysql://localhost:3306/partdb</config-property>
<config-property name="DriverClass" type="java.lang.String">org.gjt.mm.mysql.Driver</config-property>
<!--set these only if you want only default logins, not through JAAS -->
<config-property name="userName" type="java.lang.String">test</config-property>
<config-property name="password" type="java.lang.String">test</config-property>
</properties>
</attribute>
<!--Below here are advanced properties -->
<!--hack-->
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper</depends>
</mbean>
</depends>
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
<mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=MySqlDS">
<attribute name="MinSize">0</attribute>
<attribute name="MaxSize">50</attribute>
<attribute name="BlockingTimeoutMillis">5000</attribute>
<attribute name="IdleTimeoutMinutes">15</attribute>
<!--criteria indicates if Subject (from security domain) or app supplied
parameters (such as from getConnection(user, pw)) are used to distinguish
connections in the pool. Choices are
ByContainerAndApplication (use both),
ByContainer (use Subject),
ByApplication (use app supplied params only),
ByNothing (all connections are equivalent, usually if adapter supports
reauthentication)-->
<attribute name="Criteria">ByContainer</attribute>
</mbean>
</depends>
<depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
<depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
<attribute name="TransactionManager">java:/TransactionManager</attribute>
<!--make the rar deploy! hack till better deployment-->
<depends>jboss.jca:service=RARDeployer</depends>
</mbean>

</server>
7. when restart jboss i got the following errors
09:16:47,800 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean ope
ration 'checkIncompleteDeployments()'
Cause: Incomplete Deployment listing:
Packages waiting for a deployer:
<none>
Incompletely deployed packages:
<none>
MBeans waiting for classes:
<none>
MBeans waiting for other MBeans:
[ObjectName: jboss.jca:service=LocalTxCM,name=MySqlDS
state: FAILED
I Depend On: jboss.jca:service=LocalTxDS,name=MySqlDS
jboss.jca:service=LocalTxPool,name=MySqlDS
jboss.jca:service=CachedConnectionManager
jboss.security:service=JaasSecurityManager
jboss.jca:service=RARDeployer
Depends On Me: java.lang.IllegalArgumentException: The class 'class org.jboss.r
esource.adapter.jdbc.local.LocalManagedConnectionFactory' has no setter for conf
ig property 'ConnectionUrl']
09:16:47,810 INFO [URLDeploymentScanner] Started
09:16:47,810 INFO [MainDeployer] Deployed package: file:/E:/jboss-3.0.4/server/
default/conf/jboss-service.xml
09:16:47,830 INFO [Server] JBoss (MX MicroKernel) [3.0.4 Date:200211021607] Sta
rted in 1m:0s:146ms

pls tell me what is the problem and how to connect correctly to mysql through jboss to run my servlet
with regards
 
sabr sabars
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks i have solved it connectionUrl must be ConnectionURL
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic