AppD Archive

ClassCastException thrown while registering new CloudConnector

CommunityUser
Splunk Employee
Splunk Employee

I created a cloudconnector following the https://docs.appdynamics.com/display/PRO40/Connector+Development+Guide, but that didn't work.

The exception I get is as follows..

Caused by: java.lang.ClassCastException: com.appdynamics.connectors.SoftLayerConnector cannot be cast to com.singularity.ee.connectors.api.IConnector
        at com.singularity.ee.controller.connectors.ConnectorFactory.getConnector(ConnectorFactory.java:159)
        ... 156 more

What is the reason ?

Pls. find the server.log (as failure.txt) attached.

Thanks for your replies.

0 Karma

Arun_Dasetty
Super Champion

Hi ,

Can you check the existing of files at path in refernce to below error:
Caused by: java.io.FileNotFoundException: /opt/AppDynamics/Controller/appserver/glassfish/../.././lib/connectors/.classpath/image-repository-types.xml (Not a directory)

Regarding the below error can you check whether the class SoftLayerConnector is an instancOf Or implements IConnector in jar file /opt/AppDynamics/Controller/appserver/glassfish/../.././lib/connectors/SoftLayer/connector.jar
Caused by: java.lang.RuntimeException: java.lang.ClassCastException: com.appdynamics.connectors.SoftLayerConnector cannot be cast to com.singularity.ee.connectors.api.IConnector

Regards,

Arun

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Arun,

I removed ".classpath" from AppDynamics "lib/connectors" folder. Now I don't see the FileNotFoundException.

But I don't understand why ClassCastException is still reported in logs.

I implemented the interface com.singularity.ee.connectors.api.IConnector from <AppDynamics_home>/appserver/glassfish/domains/domain1/applications/controller/lib/connector-api.jar.

pfa, screenshot of my implementation class (SoftLayerConnector_1.png) & server.log as (failure.txt)

Thanks for your replies

Raj

0 Karma

Arun_Dasetty
Super Champion

Hi Raj,

Can you attach the jar and source code of the connector jar deployed so that i will replicate in local as we see you are using self service trial account you do not have permissions to raise help ticket so we need jar file so that helps me to assist you better by simulating in local, keep us posted the details requested

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Arun,

Thanks for your reply.

I'll send the project zip directly to your mail address.

Thanks

Raj

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

PFA, the source zip.

Thank you

Raj

0 Karma

Arun_Dasetty
Super Champion

Hi Raj,

I will try to replicate in local using the attachement and will keep you posted my observations

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Arun,

Any updates on this problem ?

Thank you

Raj

0 Karma

Arun_Dasetty
Super Champion

Hi Raj,

Can you clarify when classcastexception error raises in server.log, is it raise when you do any specific operation in controller UI under Images or compute clouds? 

I deployed in local controller and could not see the error:

============================================= 

[#|2015-04-23T13:49:18.988+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.connectors.ConnectorFactory|_ThreadID=1;_ThreadName=Thread-5;|Adding connector jar to isolated classloader /mnt/AppDynamics/Controller/appserver/glassfish/../.././lib/connectors/SoftLayer/connector.jar|#]

[#|2015-04-23T13:49:18.993+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.connectors.ConnectorFactory|_ThreadID=1;_ThreadName=Thread-5;|Adding connector jar supporting libraries to isolated classloader: /mnt/AppDynamics/Controller/appserver/glassfish/../.././lib/connectors/SoftLayer/lib|#]

[#|2015-04-23T13:49:19.846+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.connectors.ConnectorFactory|_ThreadID=1;_ThreadName=Thread-5;|Connector [com.appdynamics.connectors.SoftLayerConnector] registered with controller|#]

[#|2015-04-23T13:49:20.176+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.servlet.ConnectorLoader|_ThreadID=1;_ThreadName=Thread-5;|ComputeCenterTypes:|#]

[#|2015-04-23T13:49:20.183+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.servlet.ConnectorLoader|_ThreadID=1;_ThreadName=Thread-5;|SoftLayer...|#]

[#|2015-04-23T13:49:20.284+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.servlet.ConnectorLoader|_ThreadID=1;_ThreadName=Thread-5;|ImageTypes:|#]

[#|2015-04-23T13:49:20.289+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.servlet.ConnectorLoader|_ThreadID=1;_ThreadName=Thread-5;|SoftLayer Image...|#]

[#|2015-04-23T13:49:20.400+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.servlet.ConnectorLoader|_ThreadID=1;_ThreadName=Thread-5;|Finished loading pluggable connectors|#]

[#|2015-04-23T13:49:20.726+0000|INFO|glassfish3.1.2|com.singularity.ee.controller.servlet.StartupContextListener|_ThreadID=1;_ThreadName=Thread-5;|Initializing blitz registration manager|#]

=============================================

image.png

Regards,

Arun 

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Arun,

I've been restarting the controller process after adding the connector ZIP file in "connectors" folder.

After restart of controller, when I try to 'Register Compute Cloud', I get the ClassCastException

PFA, the screenshot of the web page (Register_ComputeCloud.png) where this exception is being reported..

Thank you

Raj

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...