cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Foundation - 503 Service Unavailable error

GSPatil
11-Garnet

Foundation - 503 Service Unavailable error

Hi ,

 

I am also facing same error message while trying to access the ThingWorx composer. Hence attaching the log files. 

 

1. Setttings.json file is at ThingworxPlatform folder

2. JDBC .Jar files are at <Tomcat>\lib folder

3. Table are created in thingworx database

4. Using Thingworx 8.4.4 with MS SQL server database

 

gone through article Connections could not be acquired from the underlying database

 

Please give your opinions

 

Json file is as :

 

{
"PlatformSettingsConfig": {
"AdministratorUserSettings": {
"InitialPassword": "trUf6yuz2?_Gub"
},
"OrchestrationSettings": {
"EnableOrchestration": true,
"QueueHost": "win-5aoe9h447vu",
"QueuePort": 5672,
"QueueName": "256mb",
"QueueUsername": "flowuser",
"QueuePassword": "e24bbe712caab365b11a5a4f4b21a0b3",
"QueueVHost": "orchestration"
}
},
"PersistenceProviderPackageConfigs": {
"MssqlPersistenceProviderPackage": {
"ConnectionInformation": {
"driverClass": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"jdbcUrl": "jdbc:sqlserver://localhost:1433;databaseName=thingworx;applicationName=Thingworx;",
"password": "PlantPAxPTC@1234",
"username": "twadmin"
}
}
}
}

1 ACCEPTED SOLUTION

Accepted Solutions
slangley
23-Emerald II
(To:GSPatil)

Hi @GSPatil.

 

Are you having issues importing just this one extension or all extensions?  If this is affecting all extensions you probably need to check \ThingworxPlatform\platform-settings.com to ensure the Extension Package Import policy exists?  Here's an example:

 

{
    "PersistenceProviderPackageConfigs": {
        "MssqlPersistenceProviderPackage": {
            "ConnectionInformation": {
                "driverClass": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
                "jdbcUrl": "jdbc:sqlserver://localhost:1433;databaseName=thingworx;applicationName=Thingworx;",
                "password": "twadmin",
                "username": "twadmin"
            }
        }
    },
    "PlatformSettingsConfig": {
        "LicensingConnectionSettings":{
            "username":"username",
            "password":"password"
        },
        "ExtensionPackageImportPolicy": {
            "allowCSSResources": true,
            "allowEntities": true,
            "allowExtensibleEntities": true,
            "allowJSONResources": true,
            "allowJarResources": true,
            "allowJavascriptResources": true,
            "allowWebAppResources": true,
            "importEnabled": true
        },
        "ContentTypeSettings": {
            "supportedMediaEntityContentTypes": [
                "image/svg+xml",
                "image/png",
                "image/gif",
                "image/bmp",
                "image/jpeg",
                "application/pdf",
                "image/vnd.microsoft.icon"
            ]
        }
    }
}

 

I don't have any knowledge indicating that the relational database extension is no longer needed but I will check on it..

 

Regards.

 

--Sharon

View solution in original post

12 REPLIES 12

Hi,

 

Can you connect in MSSQL with twadmin user? If yes, I am recommending to check Tomcat logs, there some exceptions are thrown and can help with investigation.

If you want, you can attach Tomcat logs here to look into.

 

Thank you,

Raluca Edu

Hi, 

Thanks for immediate reply, Yes I am able to connect MSSQL  to 'twadmin' user.

 

Also I have gone through the logs, but could not find any error.  Attaching available logs for your review.

 

 

Regards;

Ganesh Shete

Hi,

 

I think I found why this is failing:

 

ERROR com.thingworx.system.configuration.PlatformSettings - Configuration setting ContentTypeSettings.supportedMediaEntityContentTypes cannot be null

 

You need to add ContentTypeSettings in platform-settings.json , please follow this article: https://www.ptc.com/en/support/article?n=CS305798

After this, restart Tomcat.

 

Best regards,

Raluca Edu

GSPatil
11-Garnet
(To:GSPatil)

Hi,

 

I have added the Content Settings as below, and tried.  The application log is still showing same error. And attaching the latest Tomacat logs for your reference.

 

{
"PlatformSettingsConfig": {
"AdministratorUserSettings": {
"InitialPassword": "trUf6yuz2?_Gub"
},
"ContentTypeSettings": {
"supportedMediaEntityContentTypes": ["image/svg+xml", "image/png", "image/gif", "image/bmp", "image/jpeg", "application/pdf", "image/vnd.microsoft.icon"]
},
"OrchestrationSettings": {
"EnableOrchestration": true,
"QueueHost": "win-5aoe9h447vu",
"QueuePort": 5672,
"QueueName": "256mb",
"QueueUsername": "flowuser",
"QueuePassword": "e24bbe712caab365b11a5a4f4b21a0b3",
"QueueVHost": "orchestration"
}
},
"PersistenceProviderPackageConfigs": {
"MssqlPersistenceProviderPackage": {
"ConnectionInformation": {
"driverClass": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"jdbcUrl": "jdbc:sqlserver://localhost:1433;databaseName=thingworx;applicationName=Thingworx;",
"password": "PlantPAxPTC@1234",
"username": "twadmin"
}
}
}
}

You may have already checked this, but I have seen that error when the TCP/IP protocol is not enabled for the SQL server. The SQL Server Manager tool doesn't use TCP/IP, but JDBC does, so the test to connect with SSMS may not be a completely accurate test.

 

Load up SQL Server Configuration Manager, navigate down to where it says "Protocols for <INSTANCE>" and then in the right pane make sure TCP/IP is enabled. By default it isn't. I believe you need to restart the SQL engine after making that change.

 

 

SQL Server Configuration ManagerSQL Server Configuration Manager

Another item that I've seen a few times in reference docs is to add the Instance Name to the JDBC connection string. I would bet more on the TCP/IP issue though.

Hi,

Thanks for reply. I the TCP/IP was already enabled with the port 1433. Even I had added inbound & outbound rules to avoid any blocking from windows firewall.

 

About adding instance name to JDBC driver string, it is required if the SQL server an thingworx are on different servers. In my case all are on same server. But for confirmation I have tried by adding the instance name to the JDBC driver string, but did not served the purpose. 

slangley
23-Emerald II
(To:GSPatil)

Hi @GSPatil.

 

Did you load the JDBC driver needed for SQL Server? I'm attaching it here.

 

Just extract the file and drop it in <tomcat_home>\lib.  Then restart Tomcat.

 

Regards.

 

--Sharon

Hi Sharon,

 

Thanks for your reply. Actually I have already loaded the JDBC driver as shown in the attachment.

slangley
23-Emerald II
(To:GSPatil)

Hi @GSPatil.

 

At this point, it might be best to open a case for this so we can schedule a WebEx to look at your system.  I'll be happy to open it on your behalf if you are in agreement.

 

Regards.

 

--Sharon

Thanks you all.

 

About this issue, we uninstalled thingworx & tomacat and gone for fresh installation of version TW Foundation 8.4.5 for MSSQL. The best thing PTC has done here is, they have integrated all the required components (json file, JDBC driver, tomcat)  hence we got results.

 

Thanks Sheron for helping us.

 

I have one more question for you. I am unable to import the MSSQL Relational database extension to in TW composer. And I can see the Persistence Providers are available for MSSQL   (I have created one instance ) with all configuration all ready. SO do we really do not need this RDB extension in this version?  Please refer the attachment. 

 

Regards;

Ganesh  

slangley
23-Emerald II
(To:GSPatil)

Hi @GSPatil.

 

Are you having issues importing just this one extension or all extensions?  If this is affecting all extensions you probably need to check \ThingworxPlatform\platform-settings.com to ensure the Extension Package Import policy exists?  Here's an example:

 

{
    "PersistenceProviderPackageConfigs": {
        "MssqlPersistenceProviderPackage": {
            "ConnectionInformation": {
                "driverClass": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
                "jdbcUrl": "jdbc:sqlserver://localhost:1433;databaseName=thingworx;applicationName=Thingworx;",
                "password": "twadmin",
                "username": "twadmin"
            }
        }
    },
    "PlatformSettingsConfig": {
        "LicensingConnectionSettings":{
            "username":"username",
            "password":"password"
        },
        "ExtensionPackageImportPolicy": {
            "allowCSSResources": true,
            "allowEntities": true,
            "allowExtensibleEntities": true,
            "allowJSONResources": true,
            "allowJarResources": true,
            "allowJavascriptResources": true,
            "allowWebAppResources": true,
            "importEnabled": true
        },
        "ContentTypeSettings": {
            "supportedMediaEntityContentTypes": [
                "image/svg+xml",
                "image/png",
                "image/gif",
                "image/bmp",
                "image/jpeg",
                "application/pdf",
                "image/vnd.microsoft.icon"
            ]
        }
    }
}

 

I don't have any knowledge indicating that the relational database extension is no longer needed but I will check on it..

 

Regards.

 

--Sharon

Hi Sheron,

 

Yes you are right, The auto generated Settings.json file for TWx version 8.4.5 was missing the following lines & hence I was unable to import the extension.

"ExtensionPackageImportPolicy": {
            "allowCSSResources": true,
            "allowEntities": true,
            "allowExtensibleEntities": true,
            "allowJSONResources": true,
            "allowJarResources": true,
            "allowJavascriptResources": true,
            "allowWebAppResources": true,
            "importEnabled": true
        },

 

Also as per my recent experience, the relational database extensions are still needed for this version, since they contains the corresponding thing templates.

 

Thanks for your reply

 

-Ganesh

 

Top Tags