I'm using community edition version 6 for a club project. I added a MySql database and it worked locally in testing. When I created a war file and deployed it, the database wouldn't work. When I checked the logs it said that it couldn't find the jdbc driver:
java.lang.ClassNotFoundException: org.mariadb.jdbc.Driver
I uploaded the mariadb jar file and it started working on the server. Somehow it wasn't deployed. Did I forget something in a setup, or oversight in the program.
Thanks,
Gary
java.lang.ClassNotFoundException: org.mariadb.jdbc.Driver
I uploaded the mariadb jar file and it started working on the server. Somehow it wasn't deployed. Did I forget something in a setup, or oversight in the program.
Thanks,
Gary
RE: Driver not included in WAR
I don't think drivers are packaged for the runtime by default because you may wish to use the latest and most suitable driver versions for the target environment, which may differ from the development versions.
You can see what's typically included by looking at the following directory:
<install_location>\design\blueprints\xstudio\pxp\XDE_services\Services\deploy_service\Exposed_Business_Service\jars
If you want to include the drivers by default during publication then you can place them in this location and the publication process should pick them up, but please note this directory will not be preserved during upgrades.
Kind Regards
Abdul
RE: Driver not included in WAR
RE: Driver not included in WAR
A bit annoying to have to upload my db driver after every war deployment (and sometimes stop and start tomcat). Is there a location I can put it in the project repository that it will be picked up in the war file creation and deployed, and run correctly?
RE: Driver not included in WAR
The directory Abdul mentioned contains all the jars that will be included for every app you publish to a WAR.
You could add any new jars to this directory and they will then be included for every publication, but as you mention you often want to include a jar just for a particular project.
You can easily do this by placing it in a WEB-INF/lib directory within the webapp folder for the project in the repository. You can do this manually, but the easiest way within the studio is to temporarily add a Java Method action to a controller rule, and then click the 'Add .jar or .class File' link. This will set up the required lib directory for you, and you can then just upload the database driver JAR that you want to use using the popup dialog.
Once uploaded you can remove the temporary Java Method action that was added.
With the jar file in this location it will automatically be included every time you publish the project so shouldn+?+?+?t require any other work on your server other than uploading the new WAR.
The jar will also be included if you export your project to keep a backup or migrate it to a new machine/installation.
I hope this helps.
Regards,
Gerard