Hi,

I am facing below issue, trying to cast the retrieved object at a webapp
application.

java.lang.ClassCastException: org.wso2.SomeServiceImpl cannot be cast
to org.wso2.SomeService
which is the interface it extends.
This is registered into OSGI environment from a separate component and here
I am trying to capture it to be used in an endpoint.

When I check the classLoaders of the classes,
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@58e1a6d3[com.wso2.finance.open.banking.consent.mgt:1.0.0.SNAPSHOT(id=30)]
  is used in the backend module,

while inside the webapp it is,
CarbonWebappClassLoader
  context: /consent
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@20b6b38d
[tomcat:7.0.73.wso2v1(id=527)]

The difference in the class loaders seems to be reason for
ClassCastException.
Appreciate any inputs to resolve this.

Thanks,
-- 
Pushpalanka.
-- 
Pushpalanka Jayawardhana, B.Sc.Eng.(Hons).
Senior Software Engineer, WSO2 Lanka (pvt) Ltd;  wso2.com/
Mobile: +94779716248
Blog: pushpalankajaya.blogspot.com/ | LinkedIn:
lk.linkedin.com/in/pushpalanka/ | Twitter: @pushpalanka
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to