How to give Worklight Server access to MySQL (SQL adapter)

我只是一个虾纸丫 提交于 2019-12-25 05:27:27

问题


I'm migrating a worklight app from 5.0.3 to 5.0.6.

I tried to add

mysql-connector-java-5.1.22-bin.jar** to worklight.war

file but I get the following error:

Procedure invocation error. Runtime: java.lang.ClassNotFoundException: Class com.mysql.jdbc.Driver not found in Worklight platform or project /worklight

Any workaround?


回答1:


Why to the .war file? Add more information to your question: are you running Worklight in Eclipse or on an application Server (Tomcat/Liberty/WAS)?

If you are using the Worklight Developer Edition (essentially plug-in download for Eclipse):

  • You need to place mysql-connector-java-5.1.22-bin.jar to the \lib folder of your project... located at: yourProject\server\lib.
  • Make sure to also update the datasource definitions in the adapter XML:
<dataSourceDefinition>
    <driverClass>com.mysql.jdbc.Driver</driverClass>
    <url>jdbc:mysql://localhost:3306/mydb</url>
    <user>myUsername</user>
    <password>myPassword</password> 
</dataSourceDefinition>

If you are using Worklight by deploying it to an Application Server (Tomcat/Libery/WAS), the above actions will also update the .war file, located in yourProject\bin, which you will need to redeploy to your application server.



来源:https://stackoverflow.com/questions/16337591/how-to-give-worklight-server-access-to-mysql-sql-adapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!