connection pool for ms sql
Hi all:
I'm tring to create a connection pool from Sun PE 8.2 to ms sql. I installed the ms sql 2000 drivers and put mssqlserver.jar, msutil.jar, msbase.jar under my domain lib folder. I put ${com.sun.aas.installRoot}/domains/domain1/lib/mssqlserver.jar
${com.sun.aas.installRoot}/domains/domain1/lib/msbase.jar
${com.sun.aas.installRoot}/domains/domain1/lib/msutil.jar in the classpath suffix. Restart the server. Basically, I followed all the steps in one of the related topic listed in this forum. In my connection pool, i put the class name as com.microsoft.jdbc.sqlserver.SQLServerDriver, this is per Microsoft document. However, i got this error message when i tried to ping the pool
Operation 'pingConnectionPool' failed in 'resources' Config Mbean.
anyone have any ideas what's going on would be very much appreciated. Thank you very much in advance.
Danny
# 1
> Hi all:
> I'm tring to create a connection pool from Sun PE 8.2
> to ms sql. I installed the ms sql 2000 drivers and
> put mssqlserver.jar, msutil.jar, msbase.jar under my
> domain lib folder. I put
> ${com.sun.aas.installRoot}/domains/domain1/lib/mssqlse
> rver.jar
> ${com.sun.aas.installRoot}/domains/domain1/lib/msbase.
> jar
> ${com.sun.aas.installRoot}/domains/domain1/lib/msutil.
> jar in the classpath suffix. Restart the server.
> Basically, I followed all the steps in one of the
> related topic listed in this forum. In my connection
> pool, i put the class name as
> com.microsoft.jdbc.sqlserver.SQLServerDriver, this is
> per Microsoft document. However, i got this error
> message when i tried to ping the pool
>
> Operation 'pingConnectionPool' failed in 'resources'
> Config Mbean.
>
> anyone have any ideas what's going on would be very
> much appreciated. Thank you very much in advance.
>
> Danny
Danny,
I agree. This is rather frustrating. Can you see what gets printed in the server.log during the ping operation?
Thanks,
Kedar
# 2
Hi Danny,
The class name you have specified for Datasource classname is
"com.microsoft.jdbc.sqlserver.SQLServerDriver"
It has to be "com.sun.sql.jdbcx.sqlserver.SQLServerDataSource"
Please refer Application Server's Developer guide for more details.
http://docs.sun.com/app/docs/doc/819-2556/6n4rap8sl?a=view#beana
In case you are still facing the problem, please post the server.log message that you get during ping-jdbc-connection-pool
Thanks,
-Jagadish
Message was edited by:
Jagadish.Prasath
# 3
thank you very much for your response. When I changed the class name then I got Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Class name is wrong or classpath is not set for : com.sun.sql.jdbcx.sqlserver.SQLServerDataSource
I already included those jar file in the classpath. Below is the server.log
[#|2006-06-06T11:13:12.479-0700|SEVERE|sun-appserver-pe8.2|javax.enterprise.res ource.resourceadapter|_ThreadID=12;|RAR5099 : Wrong class name or classpath for Datasource Object : {0}
java.lang.ClassNotFoundException: com.sun.sql.jdbcx.sqlserver.SQLServerDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at com.sun.gjc.common.DataSourceObjectBuilder.getDataSourceObject(DataSourceObject Builder.java:198)
at com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSource ObjectBuilder.java:65)
at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedCon nectionFactory.java:70)
at com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl.getUnpool edConnection(ConnectorConnectionPoolAdminServiceImpl.java:1190)
at com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl.testConne ctionPool(ConnectorConnectionPoolAdminServiceImpl.java:507)
at com.sun.enterprise.connectors.ConnectorRuntime.testConnectionPool(ConnectorRunt ime.java:504)
at com.sun.enterprise.admin.mbeans.ResourcesMBean.pingConnectionPool(ResourcesMBea n.java:1920)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:305 )
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:360 )
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213 )
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServer Interceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterce ptor.java:272)
at com.sun.enterprise.tools.admingui.util.MBeanUtil.invoke(MBeanUtil.java:148)
at com.sun.enterprise.tools.admingui.util.MBeanUtil.invoke(MBeanUtil.java:46)
at com.sun.enterprise.tools.admingui.handlers.CommonHandlers.invokeMBean(CommonHan dlers.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.invokeHandler(D escriptorViewHelper.java:863)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.invokeHandlers( DescriptorViewHelper.java:800)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.dispatchEvent(D escriptorViewHelper.java:775)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.execute(Descrip torViewHelper.java:291)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewBeanBase.execute(Descr iptorViewBeanBase.java:192)
at com.iplanet.jato.view.RequestHandlingViewBase.handleRequest(RequestHandlingView Base.java:308)
at com.iplanet.jato.view.ViewBeanBase.dispatchInvocation(ViewBeanBase.java:802)
at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewBeanBase.ja va:740)
at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewBeanBase.ja va:760)
at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandler(ViewBeanBase.java:571)
at com.iplanet.jato.ApplicationServletBase.dispatchRequest(ApplicationServletBase. java:957)
at com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.j ava:615)
at com.sun.enterprise.tools.guiframework.view.BaseServlet.processRequest(BaseServl et.java:186)
at com.iplanet.jato.ApplicationServletBase.doPost(ApplicationServletBase.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
# 4
Thanks for your response, Kedar. I got this in the server.log. Please let me know your input in this. Thanks again, Danny.
[#|2006-06-06T11:21:32.568-0700|SEVERE|sun-appserver-pe8.2|javax.enterprise.res ource.resourceadapter|_ThreadID=15;|RAR5111 : Error casting to javax.sql.Datasource :{0}
java.lang.ClassCastException
at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedCon nectionFactory.java:70)
at com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl.getUnpool edConnection(ConnectorConnectionPoolAdminServiceImpl.java:1190)
at com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl.testConne ctionPool(ConnectorConnectionPoolAdminServiceImpl.java:507)
at com.sun.enterprise.connectors.ConnectorRuntime.testConnectionPool(ConnectorRunt ime.java:504)
at com.sun.enterprise.admin.mbeans.ResourcesMBean.pingConnectionPool(ResourcesMBea n.java:1920)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:305 )
at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:360 )
at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213 )
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServer Interceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
at $Proxy1.invoke(Unknown Source)
at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterce ptor.java:272)
at com.sun.enterprise.tools.admingui.util.MBeanUtil.invoke(MBeanUtil.java:148)
at com.sun.enterprise.tools.admingui.util.MBeanUtil.invoke(MBeanUtil.java:46)
at com.sun.enterprise.tools.admingui.handlers.CommonHandlers.invokeMBean(CommonHan dlers.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.invokeHandler(D escriptorViewHelper.java:863)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.invokeHandlers( DescriptorViewHelper.java:800)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.dispatchEvent(D escriptorViewHelper.java:775)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewHelper.execute(Descrip torViewHelper.java:291)
at com.sun.enterprise.tools.guiframework.view.DescriptorViewBeanBase.execute(Descr iptorViewBeanBase.java:192)
at com.iplanet.jato.view.RequestHandlingViewBase.handleRequest(RequestHandlingView Base.java:308)
at com.iplanet.jato.view.ViewBeanBase.dispatchInvocation(ViewBeanBase.java:802)
at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewBeanBase.ja va:740)
at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandlerInternal(ViewBeanBase.ja va:760)
at com.iplanet.jato.view.ViewBeanBase.invokeRequestHandler(ViewBeanBase.java:571)
at com.iplanet.jato.ApplicationServletBase.dispatchRequest(ApplicationServletBase. java:957)
at com.iplanet.jato.ApplicationServletBase.processRequest(ApplicationServletBase.j ava:615)
at com.sun.enterprise.tools.guiframework.view.BaseServlet.processRequest(BaseServl et.java:186)
at com.iplanet.jato.ApplicationServletBase.doPost(ApplicationServletBase.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil terChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterCha in.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.ja va:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain .java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextVal ve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:13 2)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask. java:604)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.ja va:475)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask .java:371)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
|#]
# 5
Google says com.microsoft.sqlserver.jdbc.SQLServerDataSource is the class name. Try that...In general, if I have driver jar files, I will go and see the contents of the jar files and look for the class that ends with DataSource.... Mostly that works.
binod at 2007-7-6 19:57:05 >

# 6
Hi Danny,
These are the datasource names for the following jars
mssqlserver.jar (from Microsoft) - com.microsoft.jdbcx.sqlserver.SQLServerDataSource
smsqlserver.jar (from Sun Microsystems) -
com.sun.sql.jdbcx.sqlserver.SQLServerDataSource
http://docs.sun.com/app/docs/doc/819-2556/6n4rap8sl?a=view#beana
sqljdbc.jar (from Microsoft for SQLServer 2005 ) -
com.microsoft.sqlserver.jdbc.SQLServerDataSource
http://msdn2.microsoft.com/en-us/library/ms378729.aspx
Please check your jar file and use it accordingly.
Thanks,
-Jagadish
# 7
Hi, everybody
This problem very simple:
1. Go to microsoft website : download SQL Server 2000 Driver for JDBC Service Pack 3 (setup.exe)
2.Install file setup. It 'll create 3 files jar.
3. set classpath to these file (i copy this file paste to c:/sun/appserver/lib- same folder j2ee.jar)
4. Restart server
5. Check and fun.
url:
http://www.microsoft.com/downloads/details.aspx?familyid=07287B11-0502-461A-B13 8-2AA54BFDC03A&displaylang=en
All Best,
# 8
Just sharing my working config
OS: Windows XP
Appserver : Sun Java System Application Server Enterprise Edition 8.1
DataBase: MS SQL Server 2005
Driver: MSSQL Server 2005 JDBC Driver (sqljdbc.jar)
Place sqljdbc.jar in <Install_Home>\ApplicationServer\lib\jdbcdrivers and restart Application Server
Pool Name : <MyPool>
DataSource Classname : com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource
Resource Type : javax.sql.ConnectionPoolDataSource
Pool Setting : <Default Values>
Connection Validation: <Default Values>
Transaction Isolation: <Default Values>
Properties (All Others Unchecked except following three)
User: <My DB Login Name>
Password <My DB Login Password>
URL: jdbc:sqlserver://localhost;databaseName=<My DB Name>;
Click on Ping worked sucessfully
# 9
HI.... I am a newbie....
I am Facing error while making connection pool for MSSQL
I am using sqljdbc.jar in <install>/domains/domain1/lib/ext dir & for that Datasource Classname: com.microsoft.sqlserver.jdbc.SQLServerDriver
The above settings i m sure. & i had set all properties(serverName,user,pass....)
I am getting
Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: com.microsoft.sqlserver.jdbc.SQLServerDriver
I had set class suffix : ${com.sun.aas.installRoot}/domains/domain1/lib/ext/sqljdbc.jar
please help me & mail me:: shubhadeep.sengupta@gmail.com
Message was edited by:
Shubhadeep
# 10
HI.... I am a newbie....
I am Facing error while making connection pool for MSSQL in SUN Web App Server 8.2
I have installed MSSQL 2005
I am using sqljdbc.jar in <install>/domains/domain1/lib/ext dir & for that Datasource Classname: com.microsoft.sqlserver.jdbc.SQLServerDriver
The above settings i m sure. & i had set all properties(serverName,user,pass....)
I am getting
Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: com.microsoft.sqlserver.jdbc.SQLServerDriver
I had set class suffix : ${com.sun.aas.installRoot}/domains/domain1/lib/ext/sqljdbc.jar
please help me & mail me:: shubhadeep.sengupta@gmail.com
Message was edited by:
Shubhadeep
# 11
K.. I pinged it ..Thanks 4 help.. Jagdish
# 12
K..I had pinged it.. thanks 4 ur kind info
# 13
I have sucussfully pinged my connection pool and jdbc resources. (sun web app 8.2 / SQL 2000)
But when i am executing my ejb its not inserting my record . I checked My log files of server its giving error:
[#|2007-05-10T12:14:55.027+0530|WARNING|sun-appserver-pe8.2|javax.enterprise.sy stem.tools.verifier|_ThreadID=14;|setting attribute: enabled to: true|#]
can u help me!