4 Replies Latest reply on Aug 5, 2013 12:57 AM by connect.deepak

    ORACLE THIN in JBOSS is pointing to some alien db

    connect.deepak

      Hi All,

       

      Recently, I am going through an issue related to jboss configuration and deployment. Hope you all guys will help me out to resolve the issue.

       

      Please find following stack trace.

       

      20:37:36,312 ERROR [STDERR] java.sql.SQLException: invalid schema name: sched in statement [Select count(*) as cnt from sched.User_Master  where User_Id = 1]

      20:37:36,328 ERROR [STDERR]     at org.hsqldb.jdbc.Util.throwError(Unknown Source)

      20:37:36,328 ERROR [STDERR]     at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)

      20:37:36,328 ERROR [STDERR]     at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)

      20:37:36,328 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:516)

      20:37:36,328 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:504)

      20:37:36,328 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:260)

      20:37:36,328 ERROR [STDERR]     at com.ssn.bean.ejb.UserBean.checkRecord(UserBean.java:224)

      20:37:36,328 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      20:37:36,328 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      20:37:36,328 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      20:37:36,328 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

      20:37:36,328 ERROR [STDERR]     at org.jboss.invocation.Invocation.performCall(Invocation.java:386)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:233)

      20:37:36,328 ERROR [STDERR]     at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:100)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:84)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.Container.invoke(Container.java:1092)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:436)

      20:37:36,328 ERROR [STDERR]     at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103)

       

       

      I have two j2ee applications and have been deployed in same server and pointed to same database.

       

      One application is working fine and another application is not working and throwing above error. Both applications are using same datasource.

       

      I am astonished that why and how org.hsqldb.jdbc.jdbcConnection.prepareStatement comes into the picture while I am using Oracle thin.

       

      Your help will be appreciated.

       

      Regards Deepak

        • 1. Re: ORACLE THIN in JBOSS is pointing to some alien db
          wdfink

          Hello Deepak,

          welcome to the forum.

           

          For me it sounds like there is a missconfiguration.

          Could you share a bit more details about the application (i.e. relevant part of DD), the JBoss/datasource  configuration and the JBoss version?

          • 2. Re: ORACLE THIN in JBOSS is pointing to some alien db
            connect.deepak

            Hi Wolf-Dieter Fink,

             

            Thanks for the reply.

             

            Please find following information.

             

            --------------

            web.xml

            ---------------

             

            <resource-ref>

              <res-ref-name>jdbc/testJNDI</res-ref-name>

              <res-type>javax.sql.DataSource</res-type>

              <res-auth>Container</res-auth>

              <res-sharing-scope>Shareable</res-sharing-scope>

            </resource-ref>

            <resource-ref>

              <res-ref-name>jdbc/testDestJNDI</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

            ---------------------

             

            <security-domain flushOnSessionInvalidation="true">java:/jaas/OracleDbRealm</security-domain>

              <resource-ref>

                <res-ref-name>jdbc/testJNDI</res-ref-name>

                <jndi-name>java:/jdbc/testJNDI</jndi-name>

              </resource-ref>

              <resource-ref>

                <res-ref-name>jdbc/testDestJNDI</res-ref-name>

                <jndi-name>java:/jdbc/testDestJNDI</jndi-name>

              </resource-ref>

             

            --------------------

            oracle-ds.xml

            ----------------------

             

            <local-tx-datasource>

                    <jndi-name>testJNDI</jndi-name>

             

                      <connection-url>jdbc:oracle:thin:@//192.168.1.50:1521/testDB</connection-url>

                   

                    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

                    <user-name>sched</user-name>

                    <password>sched</password>

                    <min-pool-size>5</min-pool-size>

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

                    <blocking-timeout-millis>50000</blocking-timeout-millis>

                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

                    <security-domain>testOracle</security-domain>

                    <metadata>

                        <type-mapping>Oracle9i</type-mapping>

                    </metadata>

                </local-tx-datasource>

               

            <local-tx-datasource>

                    <jndi-name>testDestJNDI</jndi-name>

             

                      <connection-url>jdbc:oracle:thin:@//192.168.1.50:1521/testDB</connection-url>

                    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

                    <user-name>sched</user-name>

                    <password>sched</password>

                    <min-pool-size>5</min-pool-size>

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

                    <blocking-timeout-millis>50000</blocking-timeout-millis>

                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

                    <security-domain>testDestOracle</security-domain>

                    <metadata>

                        <type-mapping>Oracle9i</type-mapping>

                    </metadata>

                </local-tx-datasource>

             

            -----------------------

            login-config.xml

            ------------------------

             

             

            <application-policy name = "testOracle">

                   <authentication>

                      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"

                         flag = "required">

                         <module-option name = "principal">sched</module-option>

                         <module-option name = "userName">sched</module-option>

                         <module-option name = "password">sched</module-option>

                         <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=testJNDI</module-option>

                      </login-module>

                   </authentication>

                </application-policy>

             

             

                 <application-policy name = "testDestOracle">

                   <authentication>

                      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"

                         flag = "required">

                         <module-option name = "principal">sched</module-option>

                         <module-option name = "userName">sched</module-option>

                         <module-option name = "password">sched</module-option>

                         <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=testDestJNDI</module-option>

                      </login-module>

                   </authentication>

                </application-policy>

             

             

             

             

            I am using JBOSS 5.1.2 GA and Oracle 11g.

             

            Above configuration is same for 2 different j2ee applications. The issue is one is running fine and another is throwing exception as I said earlier.

             

            Regards Deepak

            • 3. Re: ORACLE THIN in JBOSS is pointing to some alien db
              wdfink

              I'm not sure what's going wrong here.

              What if you test the properties with each connection seperate if that works and then a test togehter?

              Also I notice that both connections use the same DB behind, maybe that is confusing to the pool.

              Did you have a hsqldb configuration in your environment, if yes is it possible to drop that?

              • 4. Re: ORACLE THIN in JBOSS is pointing to some alien db
                connect.deepak

                Hi Wolf-Dieter Fink,

                 

                I have followed you suggestion and removed the one which is not problematic. Still another application throws same error.

                I thought something is missing in application itself. That is why I have verified both applications, but I do not find any differences in both applications.

                 

                Regards Deepak