4 Replies Latest reply on Aug 29, 2006 11:51 AM by Peter Johnson

    Problem with mySQL datasource

    ianbeer Newbie

      Hi i have deployed a datasource for mySQL

      <datasources>
       <local-tx-datasource>
       <jndi-name>mySQLDs</jndi-name>
       <connection-url>jdbc:mysql://localhost:3306/myDB</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>user</user-name>
       <password>pass</password>
       </local-tx-datasource>
      </datasources>


      every thing ok there. then i have checked that the name is bound by logging into console and checking in java:namespace

      java: Namespace
       +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
       +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
       +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
       +- comp (class: javax.naming.Context)
       +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
       +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
       +- jaas (class: javax.naming.Context)
       | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
       | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
       | +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
       +- timedCacheFactory (class: javax.naming.Context)
      Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
       +- mySQLDs (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
       +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
       +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
       +- Mail (class: javax.mail.Session)
       +- comp.ejb3 (class: javax.naming.Context)
       | NonContext: null
       +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
       +- TransactionManager (class: org.jboss.tm.TxManager)


      then am using code
      String jndiName="java:mySQLDs";

      ds=(DataSource)new InitialContext().lookup(jndiName);


      to look up said datasource and am receiving

      2006-08-28 13:07:28,765 INFO [com.zoodate.controllers.LoginController] jndi name java:mySQLDs
      2006-08-28 13:07:28,765 ERROR [STDERR] javax.naming.NameNotFoundException: mySQLDs not bound
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      2006-08-28 13:07:28,765 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      2006-08-28 13:07:28,765 ERROR [STDERR] at com.zoodate.controllers.LoginController.login(LoginController.java:30)
      2006-08-28 13:07:28,765 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2006-08-28 13:07:28,765 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2006-08-28 13:07:28,765 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2006-08-28 13:07:28,765 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
      2006-08-28 13:07:28,765 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:106)
      2006-08-28 13:07:28,765 ERROR [STDERR] at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
      2006-08-28 13:07:28,765 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
      2006-08-28 13:07:28,765 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      2006-08-28 13:07:28,765 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      2006-08-28 13:07:28,781 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      2006-08-28 13:07:28,781 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)


      Does anyone have any idea what is causing this rather bizarre problem as i am stumped on this one and it is important