5 Replies Latest reply on Oct 31, 2008 9:48 AM by vitechinc2008

    JNDI/JDBC Error

    vitechinc2008

      Hi.

      I am new with JBOSS. Just wanted to know why does JBOSS append JNDI name with java. (java:jdbc/V3CRMDS)? My application is depened on JNDI name. Is that how JBOSS work, or can i change that?


      [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/V3CRMDS' to JNDI name 'java:jdbc/V3CRMDS'


      I am getting the following error after deployment after deploying the war file:

      Thank you for your help.
      SA

      2008-10-29 12:40:49,594 INFO [STDOUT] 12:40:49,584 ERROR ContextLoader:203 - Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pmf' defined in class path resource [v3coreconfig/hibernate-spring-con
      text.xml]: Cannot resolve reference to bean 'V3DataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.Bea
      nCreationException: Error creating bean with name 'V3DataSource' defined in class path resource [config/datasource-spring-context.xml]: Invocation of init met
      hod failed; nested exception is javax.naming.NameNotFoundException: jdbc not bound
      Caused by:
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'V3DataSource' defined in class path resource [config/datasource-spring
      -context.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: jdbc not bound
      Caused by:
      javax.naming.NameNotFoundException: jdbc not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)

        • 1. Re: JNDI/JDBC Error
          jaikiran

          Set the use-java-context element to false in your -ds.xml file. See this for details http://www.jboss.org/community/docs/DOC-9349

          • 2. Re: JNDI/JDBC Error
            vitechinc2008

            Thanks.....That helped a lot.

            Now I am getting the following errror: Thank you for your help. I appreciate it.


            3372036854775807
            2008-10-29 13:06:46,547 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] internalRegisterPool: about to notify thread: old next: 1225300456547, new ne
            xt: 1225300456547
            2008-10-29 13:06:46,561 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
            2008-10-29 13:06:46,561 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
            2008-10-29 13:06:46,561 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
            2008-10-29 13:06:46,558 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
            org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong drive
            r class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:oracle:thin:@172.24.40.132:1521:SAGWEBDV)
            at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:190)
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:619)
            at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:264)
            at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:575)
            at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:347)
            at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:330)
            at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:402)
            at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
            at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
            at org.springframework.orm.hibernate.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:77)
            at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
            at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1156)
            at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:790)
            at org.springframework.orm.hibernate.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:540)
            at org.springframework.orm.hibernate.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:474)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
            at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
            at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)

            • 3. Re: JNDI/JDBC Error
              jaikiran

              1) Is the connection URL correct?
              2) You have to place the oracle JDBC driver jar in %JBOSS_HOME%/server/< serverName>/lib folder. Did you do that?

              • 4. Re: JNDI/JDBC Error
                vitechinc2008

                Thanks

                I forgot to all the Oracle JDBC drive that fixed that problem. Now I am getting following error:

                java.lang.OutOfMemoryError: PermGen space

                Where do I increase PermGen space?

                Thanks

                • 5. Re: JNDI/JDBC Error
                  vitechinc2008

                  Issue resolved just had to increase PermGen size !!