9 Replies Latest reply on Aug 25, 2009 8:50 AM by Peter Johnson

    Connecting to MySql in JBOSS5.1.0.GA

    Sasidhar Madhira Newbie

      Hi,

      I'm novice to JBOSS and this question has been asked a few times, but
      none of the responses that I've read have got me through.

      I'm using mysql5.1.3 with MySQL connectorj 5.1.6, I'm trying to integrate it with MDM and deploy on JBOSS. I looked into all the tutorials and tried modifying all the appropriate files.

      MySql-ds.xml File


      <local-tx-datasource>
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/mdm</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>
      root
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
      <!-- should only be used on drivers after 3.22.1 with "ping" support
      <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
      -->
      <!-- sql to call when connection is created
      <new-connection-sql>some arbitrary sql</new-connection-sql>
      -->
      <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
      <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
      -->

      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

      <type-mapping>mySQL</type-mapping>

      </local-tx-datasource>


      Log shows the following error.

      2009-08-18 16:00:48,671 WARN [org.jboss.ejb3.interceptors.aop.InterceptorsFactory] (http-127.0.0.1-8080-4) EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
      2009-08-18 16:00:48,750 WARN [org.jboss.ejb3.interceptors.aop.InterceptorsFactory] (http-127.0.0.1-8080-4) EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
      2009-08-18 16:00:48,953 WARN [org.jboss.ejb3.interceptors.aop.InterceptorsFactory] (http-127.0.0.1-8080-4) EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
      2009-08-18 16:00:49,015 WARN [org.jboss.ejb3.interceptors.aop.InterceptorsFactory] (http-127.0.0.1-8080-4) EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
      2009-08-18 16:00:49,203 SEVERE [com.sun.mdm.index.edm.presentation.handlers.LoginHandler] (http-127.0.0.1-8080-4) Tue Aug 18 16:00:49 IST 2009 - MDM-MI-LGH007: Error Loading Initialization Parameters. :MDM-MI-SRS505: Failed to instantiate CodeLookup manager: MDM-MI-MSC566: Failed to obtain a database connection: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: jdbc not bound]
      java.lang.Exception: MDM-MI-SRS505: Failed to instantiate CodeLookup manager: MDM-MI-MSC566: Failed to obtain a database connection: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: jdbc not bound]
      at com.sun.mdm.index.edm.services.security.Logon.initializeQWSControllerValidationDate(Logon.java:146)
      at com.sun.mdm.index.edm.presentation.handlers.LoginHandler.initializeApplication(LoginHandler.java:199)
      at org.apache.jsp.results_jsp._jspService(results_jsp.java:86)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
      at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
      at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
      at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at net.sf.yui4jsf.filter.YUI4JSFFilter.doFilter(YUI4JSFFilter.java:79)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:619)


      I'm sure MySql is up and running on the port 3306.

      When I delete hsql-ds.xml from jboss-5.1.0.GA\server\default\deploy directory and replace hsqldb-persistence-service.xml with mysql-persistence-service.xml in jboss-5.1.0.GA\server\default\deploy\messaging directory.

      I'm getting the dependency error while starting the server...

      2009-08-18 17:54:43,359 ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (main) Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

      DEPLOYMENTS MISSING DEPENDENCIES:
      Deployment "JBossTimerServiceFactory" is missing the following dependencies:
      Dependency "jboss.ejb:service=EJBTimerService" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.ejb:persistencePolicy=database,service=EJBTimerService" is missing the following dependencies:
      Dependency "jboss.jdbc:datasource=DefaultDS,service=metadata" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **")
      Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
      Deployment "jboss.ejb:service=EJBTimerService" is missing the following dependencies:
      Dependency "jboss.ejb:persistencePolicy=database,service=EJBTimerService" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=BatchReportGeneratorEJB,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=BatchReportGeneratorEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=BatchReportGeneratorEJB,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=BatchReportGeneratorEJB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=CodeLookupEJB,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=CodeLookupEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=CodeLookupEJB,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=CodeLookupEJB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=MasterControllerEJB,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=MasterControllerEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jndi:ejb/PersonPageData' **")
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=MasterControllerEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=MasterControllerEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jndi:ejb/PersonSequenceEJB' **")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=MasterControllerEJB,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=MasterControllerEJB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PageDataEJB,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PageDataEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PageDataEJB,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PageDataEJB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PersonEJB,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PersonEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PersonEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jndi:Person/MasterControllerEJB/local-com.sun.mdm.index.ejb.master.MasterControllerLocal' **")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PersonEJB,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PersonEJB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=ReportGeneratorEJB,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=ReportGeneratorEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=ReportGeneratorEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jndi:Person/MasterControllerEJB/local-com.sun.mdm.index.ejb.master.MasterControllerLocal' **")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=ReportGeneratorEJB,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=ReportGeneratorEJB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=SequenceEJB,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=SequenceEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=SequenceEJB,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=SequenceEJB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=UserCodeLookupEJB,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=UserCodeLookupEJB,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Deployment "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=UserCodeLookupEJB,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=UserCodeLookupEJB,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3" is missing the following dependencies:
      Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
      Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'jndi:SecureManagementView/remote-org.jboss.deployers.spi.management.ManagementView' **")
      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
      Deployment "jboss.jca:name=JmsXA,service=ConnectionFactoryBinding" is missing the following dependencies:
      Dependency "jboss.jca:name=JmsXA,service=TxCM" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.jca:name=JmsXA,service=ManagedConnectionFactory" is missing the following dependencies:
      Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.jca:name=JmsXA,service=ManagedConnectionPool" is missing the following dependencies:
      Dependency "jboss.jca:name=JmsXA,service=ManagedConnectionFactory" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.jca:name=JmsXA,service=TxCM" is missing the following dependencies:
      Dependency "jboss.jca:name=JmsXA,service=ManagedConnectionPool" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory" is missing the following dependencies:
      Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
      Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.messaging.connectionfactory:service=ClusteredConnectionFactory" is missing the following dependencies:
      Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
      Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.messaging.connectionfactory:service=ConnectionFactory" is missing the following dependencies:
      Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
      Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.messaging.destination:name=DLQ,service=Queue" is missing the following dependencies:
      Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
      Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.messaging.destination:name=ExpiryQueue,service=Queue" is missing the following dependencies:
      Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
      Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.messaging:service=JMSUserManager" is missing the following dependencies:
      Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
      Deployment "jboss.messaging:service=PersistenceManager" is missing the following dependencies:
      Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
      Deployment "jboss.messaging:service=PostOffice" is missing the following dependencies:
      Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
      Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")
      Deployment "jboss.messaging:service=ServerPeer" is missing the following dependencies:
      Dependency "jboss.messaging:service=JMSUserManager" (should be in state "Create", but is actually in state "Configured")
      Dependency "jboss.messaging:service=PersistenceManager" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss.mq:service=DestinationManager" is missing the following dependencies:
      Dependency "jboss.messaging:service=ServerPeer" (should be in state "Create", but is actually in state "Configured")
      Deployment "jboss:service=KeyGeneratorFactory,type=HiLo" is missing the following dependencies:
      Dependency "jboss.jca:name=DefaultDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **")

      DEPLOYMENTS IN ERROR:
      Deployment "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PageDataEJB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **, ** UNRESOLVED Demands 'jndi:SecureManagementView/remote-org.jboss.deployers.spi.management.ManagementView' **
      Deployment "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=CodeLookupEJB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=PersonEJB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jndi:Person/MasterControllerEJB/local-com.sun.mdm.index.ejb.master.MasterControllerLocal' **, ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=SequenceEJB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=ReportGeneratorEJB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jndi:Person/MasterControllerEJB/local-com.sun.mdm.index.ejb.master.MasterControllerLocal' **, ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=BatchReportGeneratorEJB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=UserCodeLookupEJB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "jboss.jdbc:datasource=DefaultDS,service=metadata" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jdbc:datasource=DefaultDS,service=metadata' **
      Deployment "jboss.jca:name=DefaultDS,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=DefaultDS,service=DataSourceBinding' **
      Deployment "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **
      Deployment "<UNKNOWN jboss.j2ee:ear=Person.ear,jar=Person-ejb.jar,name=MasterControllerEJB,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jndi:ejb/PersonSequenceEJB' **, ** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **, ** UNRESOLVED Demands 'jndi:ejb/PersonPageData' **

      2009-08-18 17:54:50,765 INFO [org.apache.coyote.http11.Http11Protocol] (main) Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      2009-08-18 17:54:50,828 INFO [org.apache.coyote.ajp.AjpProtocol] (main) Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      2009-08-18 17:54:50,875 INFO [org.jboss.bootstrap.microcontainer.ServerImpl] (main) JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 2m:13s:454ms

      Please help me out in fixing this issue....

      Your help is much appreciated.

      Thanks & Regards,
      Sasidhar

        • 1. Re: Connecting to MySql in JBOSS5.1.0.GA
          Peter Johnson Master

          Number one: you do not have to do anything to the files in the server/default/deploy/messaging directory. So put them back the way they were. (There is a way to replace HSQLDB with MySQL for messaging, but that is not what you are trying to do and it will just confuse things.)

          Your mysql-ds.xml file looks just fine.

          The issue is probably with your persistence.xml file. (I am guessing this because you did not mention anything about how your app is constructed and what it is using for database access: EJB3 entity beans? Hibernate? JDBC?)

          If you are using entity beans, please post the persistence.xml file. And when you do, enclose the XML text within 'code' tags. To do this, select the XML text and click the Code button above the editor window. And use the preview button to check the formatting before submitting.

          • 2. Re: Connecting to MySql in JBOSS5.1.0.GA
            Sasidhar Madhira Newbie

            Peter, Thanks for quick response.

            I'm using jdbc in my app to connect to the MySql database, and I didn't modify any thing in the mysql-persistence.xml file.

            My guess is that the app is referencing to hsqldb that is the reason it is giving Failed to obtain a database connection: javax.naming.NamingException Expection and when I tried deleting hsql-ds.xml from the deploy directory its giving dependency error as I said previously.


            • 3. Re: Connecting to MySql in JBOSS5.1.0.GA
              Peter Johnson Master

              Then your datasource lookup code is incorrect - please post it. If you have a resource-ref in your web.xml or jboss-web.xml file, post them also.

              By the way, just to be sure, you did restore everything to the way it was, right? That is, you now have the original set of file that came with JBoss AS plus your app and the *-ds.xml file.

              • 4. Re: Connecting to MySql in JBOSS5.1.0.GA
                Sasidhar Madhira Newbie

                Please find the datasource lookup code.

                Context jndiContext = new InitialContext();
                PageData pd = (PageData) jndiContext
                 .lookup("java:comp/env/jdbc/BBEDataSource");


                There is no resource-ref in our web.xml.

                This is code is working fine with oracle the issue is only when we are trying to connect to MySQL.



                • 5. Re: Connecting to MySql in JBOSS5.1.0.GA
                  Peter Johnson Master

                  There is the problem. When using an ENC name (begins with "java:comp/env") you must use resource-ref entries. Otherwise, JBoss AS will not know to map the name you used to the datasource JNDI name, which is "MySdlDS", based on the *-ds.xml file you posted.

                  See if this post helps: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232520#4232520

                  • 6. Re: Connecting to MySql in JBOSS5.1.0.GA
                    Sasidhar Madhira Newbie

                    Hi Peter,

                    I used resource-red entries in my web.xml and jboss-web.xml but still I'm getting the same error

                    server.log


                    2009-08-20 16:56:38,015 SEVERE [com.sun.mdm.index.edm.presentation.handlers.LoginHandler] (http-127.0.0.1-8080-1) Thu Aug 20 16:56:38 IST 2009 - MDM-MI-LGH007: Error Loading Initialization Parameters. :MDM-MI-SRS505: Failed to instantiate CodeLookup manager: MDM-MI-MSC566: Failed to obtain a database connection: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: jdbc not bound]
                    java.lang.Exception: MDM-MI-SRS505: Failed to instantiate CodeLookup manager: MDM-MI-MSC566: Failed to obtain a database connection: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: jdbc not bound]
                    at com.sun.mdm.index.edm.services.security.Logon.initializeQWSControllerValidationDate(Logon.java:146)
                    at com.sun.mdm.index.edm.presentation.handlers.LoginHandler.initializeApplication(LoginHandler.java:199)
                    at org.apache.jsp.results_jsp._jspService(results_jsp.java:86)
                    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
                    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
                    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
                    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)
                    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
                    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310)
                    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
                    at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:468)
                    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
                    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
                    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at net.sf.yui4jsf.filter.YUI4JSFFilter.doFilter(YUI4JSFFilter.java:79)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                    at java.lang.Thread.run(Thread.java:619)


                    web.xml

                    <resource-ref>
                     <res-ref-name>jdbc/TheDS</res-ref-name>
                     <res-type>javax.sql.DataSource</res-type>
                     <res-auth>Container</res-auth>
                     <res-sharing-scope>Shareable</res-sharing-scope>
                     </resource-ref>
                    


                    jboss-web.xml

                    <jboss-web>
                     <resource-ref>
                     <res-ref-name>jdbc/TheDS</res-ref-name>
                     <jndi-name>java:jdbc/MySqlDS</jndi-name>
                     </resource-ref>
                    </jboss-web>
                    


                    Regards,
                    Sasidhar

                    • 7. Re: Connecting to MySql in JBOSS5.1.0.GA
                      Peter Johnson Master

                      You used the resource-ref entries exactly as was in the post I referenced??? Why?

                      Go back and look at that post again, and this time note how the names used in the resource-ref entries correspond to the names used in *-ds.xml and by the lookup code. Then correct your resource-ref entries.

                      • 8. Re: Connecting to MySql in JBOSS5.1.0.GA
                        Sasidhar Madhira Newbie

                        Hi Peter,

                        Sorry for the late response, I was on vacation.

                        I'm still struggling with the same issue, just to recap...

                        My LookUp code

                        # Context jndiContext = new InitialContext();
                        # PageData pd = (PageData) jndiContext
                        # .lookup("java:comp/env/jdbc/BBEDataSource");


                        *-ds.xml
                        # <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                        # <datasources>
                        # <local-tx-datasource>
                        # <jndi-name>jdbc/PersonDataSource</jndi-name>
                        # <rar-name>jboss-local-jdbc.rar</rar-name>
                        # <use-java-context>true</use-java-context>
                        # <connection-definition>javax.sql.DataSource</connection-definition>
                        # <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
                        # <min-pool-size>0</min-pool-size>
                        # <max-pool-size>10</max-pool-size>
                        # <blocking-timeout-millis>30000</blocking-timeout-millis>
                        # <idle-timeout-minutes>30</idle-timeout-minutes>
                        # <prefill>false</prefill>
                        # <background-validation>false</background-validation>
                        # <background-validation-millis>0</background-validation-millis>
                        # <validate-on-match>true</validate-on-match>
                        # <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
                        # <isSameRM-override-value>false</isSameRM-override-value>
                        # <allocation-retry>0</allocation-retry>
                        # <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
                        # <application-managed-security xsi:type="securityMetaData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
                        # <metadata/>
                        # <local-transaction/>
                        # <user-name>root</user-name>
                        # <password>root</password>
                        # <prepared-statement-cache-size>0</prepared-statement-cache-size>
                        # <share-prepared-statements>false</share-prepared-statements>
                        # <set-tx-query-timeout>false</set-tx-query-timeout>
                        # <query-timeout>0</query-timeout>
                        # <use-try-lock>0</use-try-lock>
                        # <driver-class>com.mysql.jdbc.Driver</driver-class>
                        # <connection-url>jdbc:mysql://localhost:3306/mdm</connection-url>
                        # </local-tx-datasource>
                        # </datasources>


                        <resource-ref> entries in web.xml
                        # <resource-ref>
                        # <res-ref-name>jdbc/PersonDataSource</res-ref-name>
                        # <res-type>javax.sql.DataSource</res-type>
                        # <res-auth>Container</res-auth>
                        # <res-sharing-scope>Shareable</res-sharing-scope>
                        # </resource-ref>


                        JBOSS.xml
                        # <jboss-web>
                        # <resource-ref>
                        # <res-ref-name>jdbc/PersonDataSource</res-ref-name>
                        # <jndi-name>java:jdbc/PersonDataSource</jndi-name>
                        # </resource-ref>
                        # </jboss-web>


                        The error I'm getting is..
                        Error Loading Initialization Parameters. : MDM-MI-SRS505: Failed to instantiate CodeLookup manager: MDM-MI-MSC566: Failed to obtain a database connection: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: jdbc not bound]


                        Please help me out in debugging this issue...

                        Regards,
                        Sasidhar

                        • 9. Re: Connecting to MySql in JBOSS5.1.0.GA
                          Peter Johnson Master

                          The name you use in the lookup must be the same as the name used in the res-ref-name in both xml files, sans the java:comp/env/ prefix. (Go back and look at the example again.) Currently, your lookup code uses the name "java:comp/env/jdbc/BBEDataSource" while the xml files have a res-ref-name of jdbc/PersonDataSource.

                          Also, once the *-ds.xml file and your app are deployed, verify that the names are registered properly in JNDI by using JNDIView: http://www.jboss.org/community/wiki/DisplayTheJNDITreeWithTheJMXConsole