1 2 Previous Next 19 Replies Latest reply: Aug 21, 2013 9:33 PM by James Freitas RSS

    Jboss and mysql connector

    lukas lukasz Newbie

      hello

      im newbie but i work with jboss4.0.2GA and i havent any problem with configure mysql

      but in jboss7 i have got problem with integrate jboss with mysql

      i read article: http://community.jboss.org/wiki/DataSourceConfigurationInAS7
      and i try add mysql as module but i have got error :

      New missing/unsatisfied dependencies:

            service jboss.jdbc-driver.mysql (missing)

      here is my standalone.xml:

      <code><datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="MySqlDS">

                    <connection-url>jdbc:mysql://localhost:3306/myapp</connection-url>

                   <driver>mysql</driver>

                    <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

                    <pool>

                  <min-pool-size>10</min-pool-size>

                  <max-pool-size>100</max-pool-size>

                  <prefill>true</prefill>

                    </pool>

                    <security>

                  <user-name>root</user-name>

                  <password>1234</password>

                    </security>

                    <statement>

                  <prepared-statement-cache-size>32</prepared-statement-cache-size>

                    </statement>

                  </datasource>

                      <drivers>

                          <driver name="mysql" module="com.mysql">

                              <xa-datasource-class>

                                  com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

                              </xa-datasource-class>

                          </driver>

      and i create module in com/mysql/main and copy jar in this location mysql-connector-java-5.0.8-bin
      and my module.xml:

      <module xmlns="urn:jboss:module:1.0" name="com.mysql">

        <resources>

          <resource-root path="mysql-connector-java-5.0.8-bin.jar"/>

        </resources>

        <dependencies>

          <module name="javax.api"/>

        </dependencies>

      </module>

       

      What i do wrong that i have got this error msg???

      its problem with configuration or jar ??

       

      Article is very simple but i havent got idea what is wrong with my configuration

       

      I dont understand how can i modify the jar:

      The most straightforward solution is to simply modify the JAR and add the missing file.  You can do this from your command shell by:

      1. Change to, or create, an empty temporary directory.
      2. Create a "META-INF" subdirectory.
      3. Create a "META-INF/services" subdirectory.
      4. Create a "META-INF/services/java.sql.Driver" file which contains one line - the fully-qualified class name of the JDBC driver.
      5. Use the "jar" command-line tool to update the JAR like this:

       

      So i create folder META-INF/services/ and create file java.sql.Driver and write in this documen one line:

      com.mysql.jdbc.Driver

       

      but its not working ???

       

      Im newbie so

      plz help

        • 1. Re: Jboss and mysql connector
          sgilda Newbie

          You do not need to modify your MySQL JAR. Instead, you can specify the driver class within the driver element in the standalone.xml file as follows:

              <driver name="mysql-connector-java-5.0.8-bin.jar" module="com.mysql">

                        <driver-class>com.mysql.jdbc.Driver</driver-class>

              </driver>

           

          Did you add the module.xml and JAR to the JBOSS_HOME/modules path in the following structure?

             $AS7_HOME/modules/com/mysql/main/

                         module.xml

                         mysql-connector-java-5.0.8-bin.jar

           

          Check out "Update the DataSource Configuration" here:

          https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7

          • 2. Re: Jboss and mysql connector
            lukas lukasz Newbie

            MY module.xml

            <module xmlns="urn:jboss:module:1.0" name="com.mysql">

              <resources>

                <resource-root path="mysql-connector-java-5.0.8-bin.jar"/>

              </resources>

              <dependencies>

                <module name="javax.api"/>

              </dependencies>

            </module>

            My standalone.xml

            <datasource jndi-name="java:/photoalbumDS" pool-name="MySqlDS" enabled="true" jta="true" use-java-context="true" use-ccm="true">

                                <connection-url>

                                    jdbc:mysql://localhost:3306/photoalbumDS

                                </connection-url>

                                <driver-class>

                                    com.mysql.jdbc.Driver

                                </driver-class>

                                <driver>

                                    mysql

                                </driver>

                                <transaction-isolation>

                                    TRANSACTION_READ_COMMITTED

                                </transaction-isolation>

                                <pool>

                                    <min-pool-size>

                                        100

                                    </min-pool-size>

                                    <max-pool-size>

                                        200

                                    </max-pool-size>

                                    <prefill>

                                        true

                                    </prefill>

                                    <use-strict-min>

                                        false

                                    </use-strict-min>

                                    <flush-strategy>

                                        FailingConnectionOnly

                                    </flush-strategy>

                                </pool>

                                <security>

                                    <user-name>

                                        root

                                    </user-name>

                                    <password>

                                        1234

                                    </password>

                                </security>

                                <statement>

                                    <prepared-statement-cache-size>

                                        32

                                    </prepared-statement-cache-size>

                                </statement>

                            </datasource>

                            <drivers>

                                <driver name="mysql" module="com.mysql">

                                    <driver-class>

                                        com.mysql.jdbc.Driver

                                    </driver-class>

                                    <xa-datasource-class>

                                        com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

                                    </xa-datasource-class>

                                </driver>

            and i have add path:

            AS7_HOME="/usr/local/jboss7/modules/com/mysql/main/mysql-connector-java-5.0.8-bin.jar"

            But i have got the same problem ??


            so i dont know what i missed ??     Is there anybody who successfull connected mysql with jboss ????

            • 3. Re: Jboss and mysql connector
              David Beaumont Newbie

              Hi Lukas,

               

              I found it difficult too, so made a blog post about it: https://zorq.net/b/2011/07/12/adding-a-mysql-datasource-to-jboss-as-7/

               

              Hope that helps,

              Dave

              • 4. Re: Jboss and mysql connector
                lukas lukasz Newbie

                Its not help :/

                i do everything but i have got this error too :

                 

                New missing/unsatisfied dependencies:

                      service jboss.jdbc-driver.mysql (missing)

                 

                 

                 

                But if i close Jboss7 ctrl+c i have got:

                 

                New missing/unsatisfied dependencies:

                      service jboss.jdbc-driver.mysql (missing)

                 

                23:16:41,809 ERROR [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.Final "Lightning" started (with errors) in 2047ms - Started 93 of 151 services (3 services failed or missing dependencies, 55 services are passive or on-demand)

                ^C23:16:43,666 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-7) Stopping Coyote HTTP/1.1 on http--127.0.0.1-8080

                23:16:43,686 INFO  [org.jboss.as.logging] Restored bootstrap log handlers

                23:16:43,688 INFO  [org.jboss.as.jmx.JMXConnectorService] JMX remote connector stopped

                23:16:43,701 INFO  [org.jboss.as.connector.subsystems.datasources] Unbound data source [java:/mydb]

                23:16:43,701 INFO  [com.arjuna.ats.jbossatx] ARJUNA32018: Destroying TransactionManagerService

                23:16:43,702 INFO  [com.arjuna.ats.jbossatx] ARJUNA32014: Stopping transaction recovery manager

                23:16:43,704 INFO  [org.jboss.as.controller] Service status report

                   Newly corrected services:

                      service jboss.jdbc-driver.mysql (no longer required)

                 

                23:16:43,704 INFO  [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" stopped in 2ms

                So wtf ??

                • 5. Re: Jboss and mysql connector
                  David Beaumont Newbie

                  The 'corrected services' message happens when the datasource isn't working and you shut the server down. The first error message you get happens in just about any circumstance where the datasource isn't set up right, which makes it a nightmare to sort out.

                   

                  If you made the configuration files identical to mine, did you remember to change the versions of the mysql jar? Did you remember to copy it to the modules/com/mysql/main directory?

                  • 6. Re: Jboss and mysql connector
                    lukas lukasz Newbie

                    i try example project : so i define table in mysql :

                    create table Member(

                        id bigint NOT NULL auto_increment,

                        name varchar(25) NOT NULL DEFAULT "",

                        email varchar(125) NOT NULL DEFAULT "",

                        phone_number varchar(12) NOT NULL DEFAULT "",

                     

                        PRIMARY KEY (id)

                     

                    )ENGINE=InnoDB CHARACTER SET utf8;

                    and in persistance.xml:

                    <persistence-unit name="primary">

                          <!-- If you are running in a production environment, add a managed

                             data source, the example data source is just for proofs of concept! -->

                          <jta-data-source>java:/mydb</jta-data-source>

                     

                       </persistence-unit>

                    and my standalone.xml:

                    <datasource jndi-name="java:/mydb" pool-name="my_pool" enabled="true" jta="true" use-java-context="true" use-ccm="true">

                                        <connection-url>

                                            jdbc:mysql://localhost:3306/photoalbum

                                        </connection-url>

                                        <driver>

                                            mysql

                                        </driver>

                                        <security>

                                            <user-name>

                                                root

                                            </user-name>

                                            <password>

                                              1234

                                            </password>

                                        </security>

                                        <statement>

                                            <prepared-statement-cache-size>

                                                100

                                            </prepared-statement-cache-size>

                                            <share-prepared-statements/>

                                        </statement>

                                    </datasource>

                                    <drivers>

                                        <driver name="mysql" module="com.mysql"/>

                                        <driver name="h2" module="com.h2database.h2">

                                            <xa-datasource-class>

                                                org.h2.jdbcx.JdbcDataSource

                                            </xa-datasource-class>

                    but if i try mvn jboss-as:deploy i have got error:

                    [ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.0.0.Final:deploy (default-cli) on project pa-web: Could not execute goal deploy on pa-web.war. Reason: Deployment failed and was rolled back. -> [Help 1]

                    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.0.0.Final:deploy (default-cli) on project pa-web: Could not execute goal deploy on pa-web.war. Reason: Deployment failed and was rolled back.

                        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)

                        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

                        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

                        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)

                        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)

                        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)

                        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)

                        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)

                        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

                        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

                        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

                        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

                        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                        at java.lang.reflect.Method.invoke(Method.java:616)

                        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)

                        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)

                        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)

                        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

                    Caused by: org.apache.maven.plugin.MojoExecutionException: Could not execute goal deploy on pa-web.war. Reason: Deployment failed and was rolled back.

                        at org.jboss.as.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:290)

                        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)

                        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)

                        ... 19 more

                    Caused by: org.apache.maven.plugin.MojoExecutionException: Deployment failed and was rolled back.

                        at org.jboss.as.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:276)

                        ... 21 more

                    [ERROR]

                    • 7. Re: Jboss and mysql connector
                      lukas lukasz Newbie

                      Yes i create folder $JBOSS_HOME/modules/com/mysql/main

                      did you remember to change the versions of the mysql jar?

                      yes i remember to change jar and config in modules.xml:

                      and i have got 2 files in modules/com/mysql/main:  modules.xml and mysql-connector-java-5.1.17-bin.jar

                      (I downloaded mysql - connector from :  http://dev.mysql.com/downloads/connector/j/.)

                       

                      i do everything as you: https://zorq.net/b/2011/07/12/adding-a-mysql-datasource-to-jboss-as-7

                       

                      only different is in standalone:

                      user: root

                      password : 1234
                      and database: photoalbum (jdbc:mysql://localhost:3306/photoalbum)

                       

                       

                      and when check mysql version (in console mysql --version) i have got:

                      mysql  Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (i686) using readline 6.1

                       

                      and when i check in mysql : show databases i have got photoalbum :

                       

                      so i think its not problem with mysql byt its problem with config:

                      i attach files:

                       

                      I havent got any idea what is wrong with my config i try 10 or more different config and everything fails ....

                      • 8. Re: Jboss and mysql connector
                        Stefano Maestri Expert

                        I've tried exaclty your configuration unzipping the file and using your standalone.xml and it's working fine here.

                        Maybe the problem is in directory structure, even if it seems correct from your screen shot.

                        My sugestion is to delete everything and start with a fresch configuration.

                         

                        Maybe useful to have a look also to my blog post http://www.javalinux.it/wordpress/2011/07/14/how-to-create-an-manage-datasources-in-as7/

                         

                        regards

                        S.

                        • 9. Re: Jboss and mysql connector
                          lukas lukasz Newbie

                          THX strange its working fine in jbossas7

                          Web Profile Only (Java EE6 Certified) i replace jbossas7 wersion Everything (NOT Java EE6 Certified)

                           

                          and its working thx

                          • 10. Re: Jboss and mysql connector
                            lukas lukasz Newbie

                            I try to test default aplication but i have got error in jboss7 :

                            so i create in mysql table Member:

                            create table Member(

                                id bigint NOT NULL auto_increment,

                                name varchar(25) NOT NULL DEFAULT "",

                                email varchar(125) NOT NULL DEFAULT "",

                                phone_number varchar(12) NOT NULL DEFAULT "",

                             

                                PRIMARY KEY (id)

                             

                            )ENGINE=InnoDB CHARACTER SET utf8;

                            20:49:04,220 ERROR [org.hibernate.id.enhanced.TableStructure] (http--127.0.0.1-8080-1) could not read a hi value: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'photoalbum.hibernate_sequence' doesn't exist

                                at sun.reflect.GeneratedConstructorAccessor18.newInstance(Unknown Source) [:1.6.0_20]

                                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [:1.6.0_20]

                                at java.lang.reflect.Constructor.newInstance(Constructor.java:532) [:1.6.0_20]

                                at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)

                                at com.mysql.jdbc.Util.getInstance(Util.java:386)

                                at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)

                                at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)

                                at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)

                                at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)

                                at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)

                                at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)

                                at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)

                                at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2281)

                                at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:103)

                                at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)

                                at org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:133) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:119) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.jdbc.WorkExecutor.executeReturningWork(WorkExecutor.java:72) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.jdbc.AbstractReturningWork.accept(AbstractReturningWork.java:51) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.engine.transaction.internal.jta.JtaIsolationDelegate.doTheWork(JtaIsolationDelegate.java:160) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.engine.transaction.internal.jta.JtaIsolationDelegate.doTheWorkInNewTransaction(JtaIsolationDelegate.java:128) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.engine.transaction.internal.jta.JtaIsolationDelegate.delegateWork(JtaIsolationDelegate.java:92) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.id.enhanced.TableStructure$1.getNextValue(TableStructure.java:118) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.id.enhanced.OptimizerFactory$NoopOptimizer.generate(OptimizerFactory.java:195) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:343) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:78) [hibernate-entitymanager-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:178) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:134) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:64) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:819) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:795) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:799) [hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:845) [hibernate-entitymanager-4.0.0.Beta1.jar:4.0.0.Beta1]

                                at org.jboss.as.jpa.container.AbstractEntityManager.persist(AbstractEntityManager.java:576) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]

                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_20]

                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_20]

                                at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_20]

                                at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:57) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weldx.persistence.EntityManager$1106540350$Proxy$_$$_Weld$Proxy$.persist(EntityManager$1106540350$Proxy$_$$_Weld$Proxy$.java) [weld-core-1.1.2.AS7.jar:]

                                at photoalbum_web.pa_web.controller.MemberRegistration.register(MemberRegistration.java:46) [classes:]

                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]

                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_20]

                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_20]

                                at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_20]

                                at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)

                                at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:114) [jboss-as-weld-7.0.0.Final.jar:7.0.0.Final]

                                at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:122) [jboss-as-weld-7.0.0.Final.jar:7.0.0.Final]

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.as.ejb3.component.stateful.StatefulSessionSynchronizationInterceptor.processInvocation(StatefulSessionSynchronizationInterceptor.java:132)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                                at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.as.jpa.interceptor.SFSBInvocationInterceptor.processInvocation(SFSBInvocationInterceptor.java:58) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.as.ejb3.component.stateful.StatefulComponentInstanceInterceptor.processInvocation(StatefulComponentInstanceInterceptor.java:61)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)

                                at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:271)

                                at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:377)

                                at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:233)

                                at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:47)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                                at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)

                                at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

                                at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                                at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)

                                at photoalbum_web.pa_web.controller.MemberRegistration$$$view1.register(Unknown Source) [classes:]

                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]

                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_20]

                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_20]

                                at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_20]

                                at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:125) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:62) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at photoalbum_web.pa_web.controller.MemberRegistration$Proxy$_$$_Weld$Proxy$.register(MemberRegistration$Proxy$_$$_Weld$Proxy$.java) [classes:]

                                at photoalbum_web.pa_web.controller.MemberRegistration$Proxy$_$$_WeldClientProxy.register(MemberRegistration$Proxy$_$$_WeldClientProxy.java) [classes:]

                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_20]

                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [:1.6.0_20]

                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_20]

                                at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_20]

                                at org.apache.el.parser.AstValue.invoke(AstValue.java:196) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]

                                at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

                                at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]

                                at javax.faces.component.UICommand.broadcast(UICommand.java:315) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

                                at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

                                at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

                                at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]

                                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]

                                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.0.4-b09-jbossorg-4.jar:2.0.4-b09-jbossorg-4]

                                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312) [jboss-jsf-api_2.0_spec-1.0.0.Final.jar:1.0.0.Final]

                                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [weld-core-1.1.2.AS7.jar:2011-07-06 12:26]

                                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]

                                at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

                                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]

                                at java.lang.Thread.run(Thread.java:636) [:1.6.0_20

                            • 11. Re: Jboss and mysql connector
                              lukas lukasz Newbie

                              i fix the problem

                               

                              @Id

                              @GeneratorValue(strategy=GenerationType.IDENTITY)
                              private Long id;

                              • 12. Re: Jboss and mysql connector
                                asb_i Newbie

                                We have this same problem. Two separate cases where two different people installed JBoss AS 7 "7.0.2.Final Arc Web Profile Only" on two different Windows computers following steps described here: https://zorq.net/b/2011/07/12/adding-a-mysql-datasource-to-jboss-as-7/

                                 

                                Both get the error: "New missing/unsatisfied dependencies: service jboss.jdbc-driver.mysql (missing)"

                                 

                                Also, I installed the same JBoss version on CentOS Linux and the MySQL connection works flawlessly.


                                I noticed that JBoss does not generate the "mysql-connector-java-5.1.18-bin.jar.index" file into the "modules/com/mysql/main" directory on Windows. On Linux it does. I even tried to copy the file from Linux to Windows but the error persists.

                                • 13. Re: Jboss and mysql connector
                                  H Dam Newbie

                                  I have the same problem, but on my Windows, mysql-connector-java-5.1.18-bin.jar.index is generated, but on Mac OS it doesn't. Please help me. Thanks

                                  • 14. Re: Jboss and mysql connector
                                    JONES GOLD I Newbie

                                          I also got same problem

                                     

                                    Just check the name of  the mysql connector jar file inside modules/com/mysql/main and resource-root path of module.xml which inside modules/com/mysql/main both should match.

                                    Just restart the server and check whether any index file is inside modules/com/mysql/main(Suppose your mysql connector jar name is mysql-connector-java-5.1.22-bin.jar after restart there will be mysql-connector-java-5.1.22-bin.jar.index.

                                     

                                    Ex.my sql connector name is mysql-connector-java-5.1.22-bin.jar

                                     

                                    and this is my module.xml

                                     

                                    <?xml version="1.0" encoding="UTF-8"?>

                                     

                                     

                                    <!--

                                      ~ JBoss, Home of Professional Open Source.

                                      ~ Copyright 2010, Red Hat, Inc., and individual contributors

                                      ~ as indicated by the @author tags. See the copyright.txt file in the

                                      ~ distribution for a full listing of individual contributors.

                                      ~

                                      ~ This is free software; you can redistribute it and/or modify it

                                      ~ under the terms of the GNU Lesser General Public License as

                                      ~ published by the Free Software Foundation; either version 2.1 of

                                      ~ the License, or (at your option) any later version.

                                      ~

                                      ~ This software is distributed in the hope that it will be useful,

                                      ~ but WITHOUT ANY WARRANTY; without even the implied warranty of

                                      ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

                                      ~ Lesser General Public License for more details.

                                      ~

                                      ~ You should have received a copy of the GNU Lesser General Public

                                      ~ License along with this software; if not, write to the Free

                                      ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA

                                      ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.

                                      -->

                                     

                                     

                                    <module xmlns="urn:jboss:module:1.1" name="com.mysql">

                                     

                                     

                                        <resources>

                                           <resource-root path="mysql-connector-java-5.1.22-bin.jar"/>

                                            <!-- Insert resources here -->

                                        </resources>

                                        <dependencies>

                                            <module name="javax.api"/>

                                            <module name="javax.transaction.api"/>

                                            <module name="javax.servlet.api" optional="true"/>

                                                        <module name="javax.validation.api"/>

                                        </dependencies>

                                    </module>

                                    1 2 Previous Next