Discussions

EJB programming & troubleshooting: JBOSS-mysql table creation problem

  1. JBOSS-mysql table creation problem (7 messages)

    I am trying to deploy a .jar file to jboss 3.2.1 and I recieve this error when the ejb is deployed: org.jboss.deployment.DeploymentException: Error while fixing table name;

    I have the mysql-ds.xml properly setup. However I got an error from mysql saying "Invalid authorizationn specification: access denied for user"

    So I checked the user setup for mysql and the user has full privalages to that table.

    I've seen a similar problem all over the net but can't find a response with a solution. Has anyone run into this problem?

    Thanks for your time.

    Threaded Messages (7)

  2. JBOSS-mysql table creation problem[ Go to top ]

    Check if you have set passworf in login-config.xml file in deploy/conf dir
  3. JBOSS-mysql table creation problem[ Go to top ]

    tomcat can use md5 for passwords, but jboss doesn't
    (to my knowledge)
    be sure your passwords are stored properly.

    can you post your login-config.xml ?
  4. JBOSS-mysql table creation problem[ Go to top ]

    Here's my login-config.xml:
    <?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.2 $
    -->

    <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 -->
        <!-- created security ream for mySQL, using HsqlDbRealm as a template -->
        <application-policy name = "MySqlRealm">
              <authentication>
                <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required>
                  <module-option name = "pricipal">jboss</module-option>
                  <module-option name = "userName">jboss</module-option>
                  <module-option name = "password">secret</module-option>
                  <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
                </login-module>
              </authentication>
        </application-policy>
        
        <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>

        <!-- A template configuration for the web-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 = "web-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>


    -------------------------------------------------------
    Here's the error that I'm getting now:
    -------------------------------------------------------
    Failed to load config: file:/alphadev/servers/jboss-3.2.2/server/default/conf/login-config.xml
    org.jboss.security.auth.login.ParseException: Encountered "<?xml" at line 1, column 1.
    Was expecting one of:
        <EOF>
        <IDENTIFIER> ...
        
            at org.jboss.security.auth.login.SunConfigParser.generateParseException(SunConfigParser.java:389)
            at org.jboss.security.auth.login.SunConfigParser.jj_consume_token(SunConfigParser.java:327)
    ...


    -----------------------------------------------
    Here's my mysql-ds.xml
    -----------------------------------------------
      <local-tx-datasource>
        <jndi-name>MySqlDS</jndi-name>
        <connection-url>jdbc:mysql://localhost/db</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <user-name>user</user-name>
        <password>pass</password>
        <security-domain>MySqlRealm</security-domain>
      </local-tx-datasource>


    I had to actually edit the jbosscmp-jdbc.xml file because eclipse-xdoclet did not generate it correctly. For some reason it skipped over the @jboss tags. If anyone has had any expierence with that i'd appreciate any insight.

    Thanks for your time.
  5. JBOSS-mysql table creation problem[ Go to top ]

    Check here and modify accordingly and then let me know if you get any other exception.Hope this helps.

     <!-- Security domains for testing new jca framework -->
     <!-- created security ream for mySQL, using HsqlDbRealm as a template -->
    <application-policy name = "MySqlDbRealm"> <!-- modified this from MySqlRealm -->
     <authentication>
       <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required>
       <module-option name = "pricipal">jboss</module-option> <!-- remove jboss as principal -->
                  <module-option name = "userName">jboss</module-option> <!-- user name and password should match with your mysql-ds.xml and its not matching -->
                  <module-option name = "password">secret</module-option>
                  <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
                </login-module>
              </authentication>
        </application-policy>

    Tim
  6. JBOSS-mysql table creation problem[ Go to top ]

    Well I've actually gotten a couple tables to be created (I ended up using a different mysql database server cause the first one had something wrong with it), however the only ones that do are the ones that have primary key class's. The beans that don't throw a SQLException saying I have an error in my SQL Syntax. Unforuantely it does not produce the SQL it is trying to use. Any ideas as to why JBoss would be giving me crap about this?

    Again, thanks for your time. I really appreciate it.
  7. JBOSS-mysql table creation problem[ Go to top ]

    Why would you not have a primary key?

    read this
    http://www.theserverside.com/discussion/thread.jsp?thread_id=4140

    HTH

    -jp
  8. JBOSS-mysql table creation problem[ Go to top ]

    No,I meant the beans that do not have primary key classes throw a SQLException. They use a java data type as a primary key (i.e. Integer).

    Sorry for the confussion