cancel
Showing results for 
Search instead for 
Did you mean: 

J2EE Sun Appserver 9.1 JDBC Connection Pool with SAPDB 7.7

0 Kudos

I cant create a jdbc connection pool with sapdbc.jar. com.sap.dbtech.jdbc.DriverSapDB cannot be cast to javax.sql.DataSource is th error message. From my point of view it's look like that the driver class dosen't implement javax.sql.Datasource.

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hi Gerald,

please post the exact version of JDBC driver you're using and the full error message.

regards,

Lars

0 Kudos

Hi Lars,

thanks for answer. i use:

package com.sap.dbtech.jdbc, MaxDB JDBC Driver, SAP AG, 7.6.05 Build 006-000-008-153 (Make-Version: 7.7.04 Build 021-123-186-883)

glassfish version: Sun Java System Application Server 9.1_02 (build b04-fcs)

i will create a connectionpool with the following properties:

name: jdbc_sapdb_localhost_HSPRDEVPool

datasourceClassname.com.sap.dbtech.jdbc.DriverSapDB

ResourceType:com.sap.dbtech.jdbc.DriverSapDB / i changes also to com.sap.dbtech.jdbc.DriverSapDB

as addition properties i insert:

databaseName : HSPRDEV

username : test

passwd: test123

driverClassName:com.sap.dbtech.jdbc.DriverSapDB

url:jdbc:sapdb://localhost/HSPRDEV

i saved the entries and type ping test, then a red error windows write: com.sap.dbtech.jdbc.DriverSapDB cannot be cast to javax.sql.DataSource

in serverlog i see:

-schnipp--


here is the server log:

java.lang.RuntimeException: javax.resource.ResourceException: com.sap.dbtech.jdbc.DriverSapDB cannot be cast to javax.sql.DataSource

at com.sun.enterprise.tools.admingui.util.JMXUtil.invoke(JMXUtil.java:124)

at com.sun.enterprise.tools.admingui.util.JMXUtil.invoke(JMXUtil.java:75)

at com.sun.enterprise.tools.admingui.handlers.JdbcHandlers.pingJdbcConnectionPool(JdbcHandlers.java:530)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:421)

at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:343)

at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:317)

at com.sun.jsftemplating.layout.event.CommandActionListener.invokeCommandHandlers(CommandActionListener.java:133)

at com.sun.jsftemplating.layout.event.CommandActionListener.processAction(CommandActionListener.java:81)

at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)

at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:746)

at javax.faces.component.UICommand.broadcast(UICommand.java:368)

at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)

at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:80)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)

at com.sun.enterprise.tools.admingui.servlet.DelayedInitFacesServlet.service(DelayedInitFacesServlet.java:89)

at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)

at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)

at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)

at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)

at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)

at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)

at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)

at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)

at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)

at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)

at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)

at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)

-


schnapp----

rohith_deraje
Advisor
Advisor
0 Kudos

Hi Gerald,

In the "Server Resources>>sun-resources.xml", change the the datasource-classname to "com.sap.dbtech.jdbcext.DataSourceSapDB" and driverClass" value="com.sap.dbtech.jdbc.DriverSapDB". Please use the below pattern for reference. Hope this works.

<resources>

<jdbc-resource enabled="true" jndi-name="jdbc/dissertation" object-type="user" pool-name="jdbc_sapdb_midb_dbaPool"/>

<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.sap.dbtech.jdbcext.DataSourceSapDB" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="32" max-wait-time-in-millis="60000" name="jdbc_sapdb_midb_dbaPool" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.DataSource" statement-timeout-in-seconds="-1" steady-pool-size="8" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="false">

<property name="User" value="dba"/>

<property name="Password" value="dba"/>

<property name="URL" value="jdbc:sapdb:midb"/>

<property name="driverClass" value="com.sap.dbtech.jdbc.DriverSapDB"/>

</jdbc-connection-pool>

</resources>

Regards

Rohith

0 Kudos

Hi Rohith,

thanks, i changed to a newer jdbc driver, package com.sap.dbtech.jdbc, MaxDB JDBC Driver, MySQL MaxDB, 7.6.0 Build 030-000-005-567 and it works.

best regards from Berlin

Gerald

0 Kudos

i see the driver is older from build, but it works.

Answers (0)