Skip to main content
6-Contributor
August 30, 2021
Solved

java extension with null

  • August 30, 2021
  • 2 replies
  • 1202 views

I made an extension to read excel data in java. It works well.

However, running this extension the next day results in a null.
I don't know if this is a bug or what causes it.
Please let me know if there is any opinion or solution to this phenomenon. For reference, I used thingworx 8.5.4

Best answer by VladimirRosu_116627

Hi @YC_9410522 ,

Since this is your custom code, you need to debug your code to see exactly why that happens.

Append to your Apache Tomcat Java options this line and restart the server after that:

-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n

Then, debug your ThingWorx extension from Eclipse in this manner:

  1. Goto Run>Debug Configurations
  2. Select Remote Java Applications and create a new configuration (right click>New)
  3. In the Project field,browse for and select your project
  4. In the Host field,enter the host of your Tomcat instance
  5. In the Port field,enter the debug port t=> 1043
  6. Run debug after Tomcat has started,and you will be connected

Note that this way to debug works only if you have access to the ThingWorx's instance port you set above (1043 in this case). There might be cases where access to this port is blocked by the infrastructure team where the platform is hosted.

An alternative to this is to add multiple logger statements in your extension that write lines in the Script/Application Log..

2 replies

19-Tanzanite
August 31, 2021

Hi @YC_9410522 ,

Since this is your custom code, you need to debug your code to see exactly why that happens.

Append to your Apache Tomcat Java options this line and restart the server after that:

-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n

Then, debug your ThingWorx extension from Eclipse in this manner:

  1. Goto Run>Debug Configurations
  2. Select Remote Java Applications and create a new configuration (right click>New)
  3. In the Project field,browse for and select your project
  4. In the Host field,enter the host of your Tomcat instance
  5. In the Port field,enter the debug port t=> 1043
  6. Run debug after Tomcat has started,and you will be connected

Note that this way to debug works only if you have access to the ThingWorx's instance port you set above (1043 in this case). There might be cases where access to this port is blocked by the infrastructure team where the platform is hosted.

An alternative to this is to add multiple logger statements in your extension that write lines in the Script/Application Log..

Support
September 10, 2021

Hi @YC_9410522.

 

If you found the previous response helpful, please mark it as the Accepted Solution for the benefit of others with the same issue.

 

Regards.

 

--Sharon