This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Deploying EJB using MySql as a datasource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Deploying EJB using MySql as a datasource" Watch "Deploying EJB using MySql as a datasource" New topic
Author

Deploying EJB using MySql as a datasource

Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
JBoss is giving the following two errors when deploying an Entity Bean using MySql as the data source. I can send any additional configuration files you wish to see. I do have an application.xml file in the location where JBoss indicates the file is missing.
In reference to the first error, I did a search within the configuration files to find where JBoss might be requesting the "30.mysql-ds.xml" file and found no file calling for such a file. There is a "mysql-ds.xml" file in the location where JBoss says it is looking for the "30.mysql-ds.xml" file.
Here are the log file errors from JBoss. Thank you for any assistance. I have been working on this diligently for two grad school assignments but am stymied with the projects due next Monday. I've researched JBoss and MySql issues for a week now. Appreciate any direction.
Regards
Betty
JBoss jboss-3.2.1_tomcat-4.1.24
MySql 1.4
2:56:52,964 ERROR [MainDeployer] Could not make local copy for
file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/mysql-ds.xml
java.io.FileNotFoundException: C:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\deploy\server\default\deploy\mysql-ds.xml\30.mysql-ds.xml (The system cannot find the path specified)
2004-03-04 23:24:48,073 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@1ffaef8{ url=file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/MSCO676Lab3.ear/, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: exception in init of file:/C:/jboss-3.2.1_tomcat-4.1.24/server/default/deploy/MSCO676Lab3.ear/; - nested throwable: (org.jboss.deployment.DeploymentException: No META-INF/application.xml found)
Here is the mysql-ds.xml:
<datasources>
<local-tx-datasource>
<jndi-name>MySqlDS</jndi-name>
<connection-url>jdbc:mysql//localhost:3306/addressList</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name></user-name>
<password></password>
</local-tx-datasource>
</datasources>
Here is the application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>MSCO676Lab3</display-name>
<module id="myeclipse.1075431673085">
<web>
<web-uri>MSCO676Lab3Web.war</web-uri>
<context-root>/MSCO676Lab3Web</context-root>
</web>
</module>
<module id="myeclipse.1075431673846">
<ejb>MSCO676Lab3EJB.jar</ejb>
</module>
</application>

Here is my login-conf.xml also:
<?xml version='1.0'?>
<!DOCTYPE policy PUBLIC
"-//JBoss//DTD JBOSS Security Config 3.0//EN"
"http://www.jboss.org/j2ee/dtd/security_config.dtd">
<!-- The XML based JAAS login configuration read by the
org.jboss.security.auth.login.XMLLoginConfig mbean. Add
an application-policy element for each security domain.
The outline of the application-policy is:
<application-policy name="security-domain-name">
<authentication>
<login-module code="login.module1.class.name" flag="control_flag">
<module-option name = "option1-name">option1-value</module-option>
<module-option name = "option2-name">option2-value</module-option>
...
</login-module>
<login-module code="login.module2.class.name" flag="control_flag">
...
</login-module>
...
</authentication>
</application-policy>
$Revision: 1.6.2.1 $
-->
<policy>
<!-- Used by clients within the application server VM such as
mbeans and servlets that access EJBs.
-->
<application-policy name = "client-login">
<authentication>
<login-module code = "org.jboss.security.ClientLoginModule"
flag = "required">
</login-module>
</authentication>
</application-policy>
<!-- Security domain for JBossMQ -->
<application-policy name = "jbossmq">
<authentication>
<login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
flag = "required">
<module-option name = "unauthenticatedIdentity">guest</module-option>
<module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
</login-module>
</authentication>
</application-policy>
<!-- Security domains for testing new jca framework -->
<application-policy name = "HsqlDbRealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">sa</module-option>
<module-option name = "userName">sa</module-option>
<module-option name = "password"></module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
</login-module>
</authentication>
</application-policy>
<application-policy name = "FirebirdDBRealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">sysdba</module-option>
<module-option name = "userName">sysdba</module-option>
<module-option name = "password">masterkey</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=FirebirdDS</module-option>
</login-module>
</authentication>
</application-policy>
<application-policy name = "JmsXARealm">
<authentication>
<login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
flag = "required">
<module-option name = "principal">guest</module-option>
<module-option name = "userName">guest</module-option>
<module-option name = "password">guest</module-option>
<module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option>
</login-module>
</authentication>
</application-policy>
<!-- A template configuration for the jmx-console web application. This
defaults to the UsersRolesLoginModule the same as other and should be
changed to a stronger authentication mechanism as required.
-->
<application-policy name = "jmx-console">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required" />
</authentication>
</application-policy>
<!-- The default login configuration used by any security domain that
does not have a application-policy entry with a matching name
-->
<application-policy name = "other">
<!-- A simple server login module, which can be used when the number
of users is relatively small. It uses two properties files:
users.properties, which holds users (key) and their password (value).
roles.properties, which holds users (key) and a comma-separated list of their roles (value).
The unauthenticatedIdentity property defines the name of the principal that will be used when a null username and password are presented as is the case for an unuathenticated web client or MDB. If you want to allow such users to be authenticated add the property, e.g.,
unauthenticatedIdentity="nobody"
-->
<authentication>
<login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required" />
</authentication>
</application-policy>
</policy>
I read that I can use the getConnection(user,pswd) for login without defining a security domain in the login-config.xml, but that if I did define one, it would take precedence. As you can see, I have not done so.
Thanks to anyone who can read through all this and assist.
[ March 05, 2004: Message edited by: Betty Schwartz ]
[ March 05, 2004: Message edited by: Betty Schwartz ]
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Moving to the JBoss forum...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Deploying EJB using MySql as a datasource
 
Similar Threads
javax.jms.JMSSecurityException: User null is NOT authenticated
Error connecting to Oracle database during Jboss startup
Deploying EJB using MySql as a datasource
webspehere security setting
error on jboss start up