I have just started working on a RIA using Flex. have installed the Flex with an integrated JRun option. My application connects to SQLServer 2005 using FDS. I have completed a simple page that gets the data from database table displays in a GRID. However, I ran into a problem when running the application - I am getting an java.sql.SQLException: No suitable driver (see the exception trace below):
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.csx.itis.sync.ConnectionHelper.getConnection(ConnectionHelper.jav
a:103)
at com.csx.itis.sync.DeviceSyncDAO.findDevices(DeviceSyncDAO.java:77)
at com.csx.itis.sync.DeviceAssembler.fill(DeviceAssembler.java:35)
at flex.data.adapters.JavaAdapter.invokeFillOperation(JavaAdapter.java:7
48)
at flex.data.adapters.JavaAdapter.invoke(JavaAdapter.java:198)
at flex.messaging.services.MessageService.serviceMessage(MessageService.
java:138)
at flex.data.DataService.serviceMessage(DataService.java:336)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java
:548)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndp
oint.java:302)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(Abst
ractRTMPServer.java:682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTM
PConnection.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Unknown Source)
[Flex] [ERROR] Exception executing assembler operation. incomingMessage: Flex M
essage (flex.data.messages.DataMessage)
operation = fill
id = null
clientId = C8C85371-721E-99D2-42B5-6233D617B48F
correlationId =
destination = itis.sync
messageId = 6C134A7C-91BE-D80A-D764-6241E83DEEDE
timestamp = 1156994689101
timeToLive = 0
body =
[
]
hdr(DSEndpoint) = my-rtmp
hdr(pageSize) = 1
hdr(DSRemoteCredentials) =
exception: com.csx.itis.sync.DAOException: java.sql.SQLException: No suitabl
e driver
at com.csx.itis.sync.DeviceSyncDAO.findDevices(DeviceSyncDAO.java:122)
at com.csx.itis.sync.DeviceAssembler.fill(DeviceAssembler.java:35)
at flex.data.adapters.JavaAdapter.invokeFillOperation(JavaAdapter.java:7
48)
at flex.data.adapters.JavaAdapter.invoke(JavaAdapter.java:198)
at flex.messaging.services.MessageService.serviceMessage(MessageService.
java:138)
at flex.data.DataService.serviceMessage(DataService.java:336)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java
:548)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndp
oint.java:302)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(Abst
ractRTMPServer.java:682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTM
PConnection.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.csx.itis.sync.ConnectionHelper.getConnection(ConnectionHelper.jav
a:103)
at com.csx.itis.sync.DeviceSyncDAO.findDevices(DeviceSyncDAO.java:77)
... 12 more
[Flex] [ERROR] Exception when invoking service: data-service
with message: Flex Message (flex.data.messages.DataMessage)
operation = fill
id = null
clientId = C8C85371-721E-99D2-42B5-6233D617B48F
correlationId =
destination = itis.sync
messageId = 6C134A7C-91BE-D80A-D764-6241E83DEEDE
timestamp = 1156994689101
timeToLive = 0
body =
[
]
hdr(DSEndpoint) = my-rtmp
hdr(pageSize) = 1
hdr(DSRemoteCredentials) =
exception: flex.data.adapters.AdapterException: Unable to invoke a fill operation on destination 'itis.sync' due to the following error: class com.csx.itis.sync.DAOException:java.sql.SQLException: No suitable driver.
Don't know if this is a JRun configuration issue or Flex does not support SQLServer 2005. I have installed the JDBC driver for the SQLServer 2005 on my PC and copied the sqljdbc.jar to the C:\Program Files\Adobe\fds2\jrun4\servers\default\flex\WEB-INF\lib directory. Appreciate any help with this issue.
FDS does support SQL server 2005: check out the C:\fds2_final\jrun4\servers\lib directory and you will see an mssqlserver.jar, which contains the SQLServerDrives.class.
Try removing the jar you copied previously, restart the server and see if the driver is a match now.
I am using the Microsoft JDBC driver with FDS2. My application is not in the flex directory, so I find it necessary to place the jar in both the flex lib directory and the application lib directory.