Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How to acess controller service from advanced UI

avatar
New Member

with the custom processor i have, i need to get controllerService inside advanced UI, with following code im not able to access it, getting following casting error. also im not sure why its returning "com.sun.proxy.$Proxy78" class.

am i doing it right ? how can i get controller service under advance UI ?

MYDBCPConnectionPool cs = (MYDBCPConnectionPool) nifiWebContext.getControllerService(componentDetails.getProperties().get("MYDBCP-connection-pool"), processorId);
logger.info(cs.getClass().getName());
>> com.sun.proxy.$Proxy78 cannot be cast to org.apache.nifi.dbcp.MYDBCPConnectionPool

also what is the dependency requirement for "advanced-UI" when i need to access "ControllerService" . didn't find any source or example.

1 ACCEPTED SOLUTION

avatar
New Member

ok. found the issue.

added "<scope>provided</scope>" to maven dependencies of "MYProcessor" project.

before "Myservice" was deployed twice one inside "MYProcessor.Nar" and one alone "Myservice.nar" which was wrong. adding following code to MYProcessor project solved it.

<scope>provided</scope>

View solution in original post

1 REPLY 1

avatar
New Member

ok. found the issue.

added "<scope>provided</scope>" to maven dependencies of "MYProcessor" project.

before "Myservice" was deployed twice one inside "MYProcessor.Nar" and one alone "Myservice.nar" which was wrong. adding following code to MYProcessor project solved it.

<scope>provided</scope>