Announcement Announcement Module
Collapse
No announcement yet.
Authentication Exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Authentication Exception

    Hello,

    I am getting the exception below when starting up my webapp which uses spring and jdo.
    I am assuming the JdoDaoSupport is trying to get the JdoDialect and thus needs to try to connect to the database. The strange thing is that I am defining a jdo.properties file which is passed to the LocalPersistenceManagerFactoryBean on startup.
    The bean works fine and I can use it to access my data through DAOs that extend JdoDaoSupport, but I still would like to understand the source for this exception.

    Thanks in advance,
    Adam.




    org.springframework.jdbc.support.MetaDataAccessExc eption: Error while getting co
    nnection; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionEx
    ception: Could not get JDBC connection; nested exception is java.sql.SQLExceptio
    n: Invalid authorization specification, message from server: "Access denied for
    user: 'nobody@localhost' (Using password: NO)"
    org.springframework.jdbc.CannotGetJdbcConnectionEx ception: Could not get JDBC co
    nnection; nested exception is java.sql.SQLException: Invalid authorization speci
    fication, message from server: "Access denied for user: 'nobody@localhost' (Usi
    ng password: NO)"
    java.sql.SQLException: Invalid authorization specification, message from server
    : "Access denied for user: 'nobody@localhost' (Using password: NO)"
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:1825)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:1752)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:83 3)
    at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:1734)
    at com.mysql.jdbc.Connection.<init>(Connection.java:5 62)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java
    :361)
    at java.sql.DriverManager.getConnection(DriverManager .java:512)
    at java.sql.DriverManager.getConnection(DriverManager .java:193)
    at xjdo.l.f.getConnection(f.java:10)
    at org.springframework.jdbc.datasource.DataSourceUtil s.doGetConnection(D
    ataSourceUtils.java:173)
    at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(Dat
    aSourceUtils.java:152)
    at org.springframework.jdbc.datasource.DataSourceUtil s.getConnection(Dat
    aSourceUtils.java:128)
    at org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(Jd
    bcUtils.java:93)
    at org.springframework.jdbc.support.SQLErrorCodesFact ory.getErrorCodes(S
    QLErrorCodesFactory.java:209)
    at org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.s
    etDataSource(SQLErrorCodeSQLExceptionTranslator.ja va:115)
    at org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.<
    init>(SQLErrorCodeSQLExceptionTranslator.java:96)
    at org.springframework.orm.jdo.PersistenceManagerFact oryUtils.newJdbcExc
    eptionTranslator(PersistenceManagerFactoryUtils.ja va:75)
    at org.springframework.orm.jdo.DefaultJdoDialect.getJ dbcExceptionTransla
    tor(DefaultJdoDialect.java:125)
    at org.springframework.orm.jdo.DefaultJdoDialect.afte rPropertiesSet(Defa
    ultJdoDialect.java:140)
    at org.springframework.orm.jdo.DefaultJdoDialect.<ini t>(DefaultJdoDialec
    t.java:82)
    at org.springframework.orm.jdo.JdoAccessor.getJdoDial ect(JdoAccessor.jav
    a:93)
    at org.springframework.orm.jdo.JdoAccessor.afterPrope rtiesSet(JdoAccesso
    r.java:131)
    at org.springframework.orm.jdo.JdoTemplate.<init>(Jdo Template.java:95)
    at org.springframework.orm.jdo.support.JdoDaoSupport. createJdoTemplate(J
    doDaoSupport.java:86)
    at org.springframework.orm.jdo.support.JdoDaoSupport. setPersistenceManag
    erFactory(JdoDaoSupport.java:73)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrappe
    rImpl.java:684)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrappe
    rImpl.java:588)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrappe
    rImpl.java:720)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapp
    erImpl.java:747)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues(BeanWrapp
    erImpl.java:736)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.applyPropertyValues(AbstractAutowireCapabl eBeanFactory.java:840)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.populateBean(AbstractAutowireCapableBeanFa ctory.java:662)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFact ory.java:270)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFact ory.java:205)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean
    (AbstractBeanFactory.java:204)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean
    (AbstractBeanFactory.java:136)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.
    preInstantiateSingletons(DefaultListableBeanFactor y.java:236)
    at org.springframework.context.support.AbstractApplic ationContext.refres
    h(AbstractApplicationContext.java:284)
    at org.springframework.web.context.support.XmlWebAppl icationContext.refr
    esh(XmlWebApplicationContext.java:131)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationCon
    text(ContextLoader.java:156)
    at org.springframework.web.context.ContextLoader.init WebApplicationConte
    xt(ContextLoader.java:97)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitiali
    zed(ContextLoaderListener.java:48)
    at trekwatch.web.listener.StartupListener.contextInit ialized(StartupList
    ener.java:31)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContex
    t.java:3827)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4
    343)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase
    .java:823)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:80
    7)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)

    at org.apache.catalina.core.StandardHostDeployer.addC hild(StandardHostDe
    ployer.java:903)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.commons.beanutils.MethodUtils.invokeMet hod(MethodUtils.jav
    a:216)
    at org.apache.commons.digester.SetNextRule.end(SetNex tRule.java:256)
    at org.apache.commons.digester.Rule.end(Rule.java:276 )
    at org.apache.commons.digester.Digester.endElement(Di gester.java:1058)
    at org.apache.catalina.util.CatalinaDigester.endEleme nt(CatalinaDigester
    .java:76)
    at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source
    )
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(
    Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContent
    Dispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Un
    known Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digeste r.java:1567)
    at org.apache.catalina.core.StandardHostDeployer.inst all(StandardHostDep
    loyer.java:488)
    at org.apache.catalina.core.StandardHost.install(Stan dardHost.java:863)
    at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.j
    ava:483)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:427
    )
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:983)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java
    :349)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(Lifecycl
    eSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1091)

    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:789)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1083)

    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:478
    )
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:4
    80)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:231
    3)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:287)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:425)

  • #2
    The default JDODialet is trying to initialize a SQLExceptionTranslator.

    It tries to do this by calling the JDO PersistenceManagerFactory.getConnectionFactory() method, and if that's a DataSource, then using that datasource to get a connection and get MetaData, etc.

    The long and the short of it is that the DataSource returned by your PersistenceManagerFactory for the getConnectionFactory() method in your JDO implementation is not a good datasource, in terms of being usable. You need to either figure out why, or alternately override the default JDODialect.

    Comment


    • #3
      Thanks a lot for the reply.
      I'll take this up with my JDO provider.

      Cheers.

      Comment

      Working...
      X