Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi Team,
I have installed TWRX 8.4.1 with H2 persistence provider, but is not able to start the WebApp on tomcat.The following error is displayed:
Not able to get connection from the underlying database.
I suppose starting from Thingworx 8.4+, a username & password is required in the platform-settings.json file for H2 persistence provider also.Below is the related content of my platform-settings.json file:
"PersistenceProviderPackageConfigs":{ "H2PersistenceProviderPackage":{ "ConnectionInformation":{ "password":"twadmin", "username":"twadmin" } } }
Please help regarding what is the default username & password for H2 provider.
If possible can you attach complete application log and platform-settings.json ?
I believe you have downloaded and placed the H2 specific war in webapps .
Thanks ,
Mukul Narang
Mukul,
Thanks for the prompt reply, the application log & settings file is attached for your reference. Also, as informed earlier i think the issue is with the new setting of username & password required for H2 provider for TWRX 8.4+ versions as i am able to run TWRX Postgres 8.4.1 without any issues on the same machine.
Below is the platfomr-settings.json file:
{ "PlatformSettingsConfig":{ "AdministratorUserSettings":{ "InitialPassword":"<initial-password>" }, "ContentTypeSettings": { "supportedMediaEntityContentTypes" : ["image/svg+xml","image/png","image/gif","image/bmp","image/jpeg","application/pdf","image/vnd.microsoft.icon"] } }, "ExtensionPackageImportPolicy":{ "importEnabled":"true", "allowJarResources":"true", "allowJavascriptResources":"true", "allowCSSResources":"true", "allowJSONResources":"true", "allowWebAppResources":"true", "allowEntities":"true", "allowExtensibleEntities":"true" }, "PersistenceProviderPackageConfigs":{ "H2PersistenceProviderPackage":{ "ConnectionInformation":{ "password":"twadmin", "username":"twadmin" } } }, "LicensingConnectionSettings":{ "username":"<ptc-username>", "password":"<ptc-password>" } }
I don't think there is actually a problem with H2 DB username/pass .One thing i noticed is the structure of your json file ,Extension package import policy comes under platform settings config only ,but you have put it outside config block .I am attaching my working json for 8.4 H2 only ,kindly see this for reference and make changes in your json .
The attached file is in .txt as it does not allow to attach json .
Thanks ,
Mukul Narang
Hi Mukul,
Changed my platform-settings.json as per your suggestion, but gwtting the same error as before:
ERROR: java.sql.SQLException: Connections could not be acquired from the underlying database!
ERROR: Wrong username or password.
Java: 8u202
Tomcat: 9.0.14
My platform-settings.json file:
{ "PlatformSettingsConfig":{ "ExtensionPackageImportPolicy":{ "importEnabled":"true", "allowJarResources":"true", "allowJavascriptResources":"true", "allowCSSResources":"true", "allowJSONResources":"true", "allowWebAppResources":"true", "allowEntities":"true", "allowExtensibleEntities":"true" }, "AdministratorUserSettings":{ "InitialPassword":"admin@123456789" }, "ContentTypeSettings":{ "supportedMediaEntityContentTypes":[ "image/svg+xml", "image/png", "image/gif", "image/bmp", "image/jpeg", "application/pdf", "image/vnd.microsoft.icon" ] }, "LicensingConnectionSettings":{ "username":"<ptc-username>", "password":"<ptc-password>" } }, "PersistenceProviderPackageConfigs":{ "H2PersistenceProviderPackage":{ "ConnectionInformation":{ "password":"password", "username":"twadmin" } } } }
Please suggest.
Hi @tsharma.
Try taking out the section for "PersistenceProviderPackageConfigs." If that doesn't work, move platform-settings.json to another location and restart Tomcat to see if ThingWorx comes up without it. This will validate that the persistence provider is not needed in the .json and you can then just add back the settings needed. Remember to validate the contents by using a json validator such as this one.
Regards.
--Sharon
Hi @tshara.
If one of the previous responses provided a solution to your issue, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon
@tsharma were you able to resolve the issue?
I am also facing the same issue. Please assist
If you are experiencing an issue, please provide some details around your configuration:
We would need to check your platform-settings.json for errors there. Do you have logs that you can share?
Regards.
--Sharon