11 Replies Latest reply on Nov 11, 2013 1:22 AM by sharad7879

    Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1

    sharad7879

      Hi,

       

      I am trying to enable connection pooling for my application, It is working fine with oracle 10g database but when i am trying with microsoft sql server 2005 i am getting below mentioned exception. I am using sqljdbc4.jar to connect with ms sql server 2005.

       

      My JNP port is same for oracle and sql database 4447 .

       

       

       

      Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server server1234:4447 [Root exception is java.io.StreamCorruptedException: invalid stream header: 00000024]

          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:268)

          at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)

          ... 88 more

      Caused by: java.io.StreamCorruptedException: invalid stream header: 00000024

          at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)

          at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298)

          at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:255)

          ... 89 more


       

        • 1. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
          ctomc

          JBoss AS 6.1 or JBoss EAP 6.1?

          • 2. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
            sharad7879

            Its JBoss EAP 6.1, problem is only with MS SQL server 2005, Oracle 10g is working fine

            • 3. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
              ctomc

              remove old jboss jars from your deployment then.

               

              your probably have jars like jbossall-client.jar or jbossjnp.jar etc..

               

              also you can post list of your jars in lib directory of your deployment(s) so we can help you out removing what should not be there.

               

               

              --

              tomaz

              • 4. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
                ctomc

                also possible is that you might have legacy jndi.properties somewhere which might give you issues with lookup as they have wrong providers configured.

                • 5. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
                  sharad7879

                  I am using below mentioned properties in my property file for jndi look up, can you please suggest if something needs to be changed here.

                  XD== is my application id

                   

                  FNDI.XD.java.naming.factory.initial=org.jboss.as.naming.InitialContextFactory

                  FNDI.XD.java.naming.provider.url=jnp://10.11.34.208:4447

                  • 6. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
                    wdfink

                    The "jnp" protocoll is no longer available since EAP6/AS7.

                    If you are inside the server you can use "new InitialContext()" in a standalone application you are not able to use a datasource

                    • 7. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
                      sharad7879

                      Below is the list of jar files i have in my lib path

                       

                      activation.jar

                      antlr.jar

                      asm-attrs.jar

                      asm.jar

                      autonumber-plugin.jar

                      bcel.jar

                      bindingservice-plugin.jar

                      bsf.jar

                      bsh-deployer.jar

                      bsh.jar

                      cglib.jar

                      commons-codec-1.7.jar

                      commons-codec.jar

                      commons-collections.jar

                      commons-httpclient.jar

                      commons-logging.jar

                      dom4j.jar

                      ejb3-persistence.jar

                      el-api.jar

                      hibernate-annotations.jar

                      hibernate-commons-annotations.jar

                      hibernate-entitymanager.jar

                      hibernate-validator.jar

                      hibernate3.jar

                      hsqldb-plugin.jar

                      hsqldb.jar

                      javassist.jar

                      jaxen.jar

                      jboss-cache-jdk50.jar

                      jboss-common-jdbc-wrapper.jar

                      jboss-ejb-client.properties

                      jboss-ejb3x.jar

                      jboss-hibernate.jar

                      jboss-j2ee_.jar

                      jboss-jaxrpc.jar

                      jboss-jaxws.jar

                      jboss-jca.jar

                      jboss-jsr77.jar

                      jboss-jsr88.jar

                      jboss-management.jar

                      jboss-messaging-client.jar

                      jboss-messaging.jar

                      jboss-monitoring.jar

                      jboss-saaj.jar

                      jboss-serialization.jar

                      jboss-srp.jar

                      jboss-transaction.jar

                      jboss-vfs.jar

                      jboss.jar

                      jbossjta-integration.jar

                      jbossjta.jar

                      jbosssx.jar

                      jbossts-common.jar

                      jbossws-common.jar

                      jbossws-framework.jar

                      jbossws-jboss42.jar

                      jbossws-spi.jar

                      jmx-adaptor-plugin.jar

                      joesnmp.jar

                      jsp-api.jar

                      local_policy.jar

                      log4j-1.2.16.jar

                      log4j-snmp-appender.jar

                      log4j.jar

                      mail-plugin.jar

                      mail.jar

                      ojdbc14_g.jar

                      properties-plugin.jar

                      quartz-all.jar

                      scheduler-plugin-example.jar

                      scheduler-plugin.jar

                      servlet-api.jar

                      sqljdbc4.jar

                      US_export_policy.jar

                      xalan.jar

                      xerces.jar

                      xercesImpl.jar

                      xmlentitymgr.jar

                      • 8. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
                        sharad7879

                        Thanks Wolf-Dieter Fink, I changed my code and it is working fine now...

                        • 9. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
                          wdfink

                          Looks weird to me.

                          The jboss*.jar files seems to be from an old release and you should not use it.

                          If you use the provided connections you should remove the ojdbc14.jar, also xcerces, xalan, mail and ejb api's are provided by the container and you should avoid to include them.

                          This might have different bad effects.

                           

                          If you follow the EE specification with no extras you do not need such libraries to include

                          • 10. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
                            ctomc

                            sharad7879 wrote:

                             

                            Below is the list of jar files i have in my lib path

                             

                            activation.jar <-- remove part of jdk

                            antlr.jar <-- do you need to bundle hibernate 3? if not remove

                            asm-attrs.jar <-- same part of h3

                            asm.jar <-- remove

                            autonumber-plugin.jar <-- remove this is part of legacy as

                            bcel.jar <-- remove

                            bindingservice-plugin.jar <-- remove

                            bsf.jar <-- remove

                            bsh-deployer.jar <-- remove

                            bsh.jar <-- remove

                            cglib.jar <-- part of hibernate 3, if you don't need it remove

                            commons-codec-1.7.jar

                            commons-codec.jar <-- remove

                            commons-collections.jar

                            commons-httpclient.jar

                            commons-logging.jar <-- remove

                            dom4j.jar <-- part of hibernate 3, if you don't need it remove

                            ejb3-persistence.jar <-- part of hibernate 3, if you don't need it remove

                            el-api.jar <-- remove part of app server

                            hibernate-annotations.jar <-- part of hibernate 3, if you don't need it remove

                            hibernate-commons-annotations.jar <-- part of hibernate 3, if you don't need it remove

                            hibernate-entitymanager.jar <-- part of hibernate 3, if you don't need it remove

                            hibernate-validator.jar <-- part of hibernate 3, if you don't need it remove

                            hibernate3.jar <-- part of hibernate 3, if you don't need it remove

                            hsqldb-plugin.jar <-- remove

                            hsqldb.jar <-- remove

                            javassist.jar <-- part of hibernate 3, if you don't need it remove, it would we wise to remove

                            jaxen.jar <-- remove

                            jboss-cache-jdk50.jar <-- remove

                            jboss-common-jdbc-wrapper.jar <-- remove

                            jboss-ejb-client.properties <-- this is fishy

                            jboss-ejb3x.jar <-- absolutely remove

                            jboss-hibernate.jar <-- absolutely remove

                            jboss-j2ee_.jar <-- absolutely remove

                            jboss-jaxrpc.jar <-- absolutely remove

                            jboss-jaxws.jar<-- absolutely remove

                            jboss-jca.jar <-- absolutely remove

                            jboss-jsr77.jar <-- absolutely remove

                            jboss-jsr88.jar <-- absolutely remove

                            jboss-management.jar <-- absolutely remove

                            jboss-messaging-client.jar <-- absolutely remove

                            jboss-messaging.jar <-- absolutely remove

                            jboss-monitoring.jar <-- absolutely remove

                            jboss-saaj.jar <-- absolutely remove

                            jboss-serialization.jar <-- absolutely remove

                            jboss-srp.jar <-- absolutely remove

                            jboss-transaction.jar <-- absolutely remove

                            jboss-vfs.jar <-- absolutely remove

                            jboss.jar <-- absolutely remove

                            jbossjta-integration.jar <-- absolutely remove

                            jbossjta.jar <-- absolutely remove

                            jbosssx.jar <-- absolutely remove

                            jbossts-common.jar <-- absolutely remove

                            jbossws-common.jar <-- absolutely remove

                            jbossws-framework.jar<-- absolutely remove

                            jbossws-jboss42.jar <-- absolutely remove

                            jbossws-spi.jar <-- absolutely remove

                            jmx-adaptor-plugin.jar <-- absolutely remove

                            joesnmp.jar <-- absolutely remove

                            jsp-api.jar <-- absolutely remove

                            local_policy.jar <-- remove

                            log4j-1.2.16.jar <-- not needed

                            log4j-snmp-appender.jar <-- remove

                            log4j.jar <-- remove

                            mail-plugin.jar <-- remove

                            mail.jar <-- remove

                            ojdbc14_g.jar <-- this does not belong to deployment, remove

                            properties-plugin.jar <-- absolutely remove

                            quartz-all.jar <-- probably should be removed

                            scheduler-plugin-example.jar <-- absolutely remove

                            scheduler-plugin.jar <-- absolutely remove

                            servlet-api.jar <-- absolutely remove

                            sqljdbc4.jar <-- does not belong here, remove

                            US_export_policy.jar <-- belongs to jdk lib, remove

                            xalan.jar <-- remove

                            xerces.jar <-- remove

                            xercesImpl.jar <-- remove

                            xmlentitymgr.jar <-- remove

                            1 of 1 people found this helpful
                            • 11. Re: Issue while enabling connection pooling with MS sql server 2005 with Jboss 6.1
                              sharad7879

                              Thank you so much for your help, I removed the suggested jars for my class path.