Author Topic: Problems with Java Platform SDK version 8.5.301  (Read 3869 times)

Offline Gabi

  • Jr. Member
  • **
  • Posts: 64
  • Karma: 0
Problems with Java Platform SDK version 8.5.301
« on: November 19, 2019, 02:11:49 PM »
So... I gave up on using version 8.5.201 and decided to try version 8.5.301 instead.

I included the JARs in my project's build path, and now I'm getting the following error:

[quote]The type com.genesyslab.platform.applicationblocks.commons.Action cannot be resolved. It is indirectly referenced from required .class files[/quote]

The Genesys classes I am importing are the following:

[code]import com.genesyslab.platform.applicationblocks.com.CfgObject;
import com.genesyslab.platform.applicationblocks.com.CfgXPathBasedQuery;
import com.genesyslab.platform.applicationblocks.com.ConfService;
import com.genesyslab.platform.applicationblocks.com.ConfServiceFactory;
import com.genesyslab.platform.applicationblocks.com.ConfigException;
import com.genesyslab.platform.applicationblocks.com.ICfgFilterBasedQuery;
import com.genesyslab.platform.applicationblocks.com.ICfgObject;
import com.genesyslab.platform.applicationblocks.com.ICfgQuery;
import com.genesyslab.platform.applicationblocks.com.runtime.CfgObjectActivator;
import com.genesyslab.platform.commons.GEnum;
import com.genesyslab.platform.commons.collections.KeyValueCollection;
import com.genesyslab.platform.commons.connection.configuration.ClientADDPOptions.AddpTraceMode;
import com.genesyslab.platform.commons.connection.configuration.PropertyConfiguration;
import com.genesyslab.platform.commons.protocol.Endpoint;
import com.genesyslab.platform.commons.protocol.Message;
import com.genesyslab.platform.configuration.protocol.ConfServerProtocol;
import com.genesyslab.platform.configuration.protocol.confserver.requests.objects.RequestReadObjects;
import com.genesyslab.platform.configuration.protocol.confserver.requests.objects.RequestReadObjects2;
import com.genesyslab.platform.configuration.protocol.types.CfgObjectType;[/code]

Does anyone know which class may be causing the problem, and how to fix it?

Thank you in advance.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Problems with Java Platform SDK version 8.5.301
« Reply #1 on: November 19, 2019, 02:33:35 PM »
Check your classpath whether all referenced JAR files are on configured classpath

Offline Gabi

  • Jr. Member
  • **
  • Posts: 64
  • Karma: 0
Re: Problems with Java Platform SDK version 8.5.301
« Reply #2 on: November 19, 2019, 03:08:50 PM »
They are. I just found an interface which was extending the no longer existing Action interface. I have fixed that now.

I am still having some issues trying to replace the old subscription to configuration events, however. I'm trying to get my application to be notified to changes in the application configuration (Configuration Server) and I still haven't quite figured out how to do it. Do you by any chance have any code samples you could show me?

Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: Problems with Java Platform SDK version 8.5.301
« Reply #3 on: November 20, 2019, 09:21:13 AM »
I use something like this:

[code] /**
* Subscribe application conf events.
*
* @param appDBID the app dbid
*/
public synchronized void subscribeApplicationConfEvents(int appDBID) {
unSubscribeNotifications();
// Create notification query:
NotificationQuery notificationQuery = new NotificationQuery();
notificationQuery.setObjectType(CfgObjectType.CFGApplication);
notificationQuery.setObjectDbid(appDBID);
NotificationFilter notificationFilter = new NotificationFilter(notificationQuery);
Predicate<ConfEvent> mFilter = notificationFilter;
log.info("Subscribing for Application ConfigServer Events for Application DBID: " + appDBID);
Subscriber<ConfEvent> subscriber = new ConfigSubscriber(mFilter);
confService.register(subscriber);
log.info("Subscribed for Application ConfigServer Events for Application DBID: " + appDBID);
try {
Subscription mySubscription = confService.subscribe(notificationQuery);
subscriptions.put("App", mySubscription);
} catch (Exception e) {
log.error("Error Subscribing for Application Update Events", e);
}
}


/**
* The Class ConfigSubscriber.
*/
public class ConfigSubscriber implements Subscriber<ConfEvent> {

/** The log. */
private static Logger log = Logger.getLogger(ConfigSubscriber.class);

/**
* Instantiates a new config subscriber.
*
* @param mFilter
*            the m filter
*/
public ConfigSubscriber(Predicate<ConfEvent> mFilter) {
this.mFilter = mFilter;
}

/** The m filter. */
private Predicate<ConfEvent> mFilter;

/*
* (non-Javadoc)
*
* @see
* com.genesyslab.platform.applicationblocks.commons.broker.Subscriber#getFilter
* ()
*/
public Predicate<ConfEvent> getFilter() {
return mFilter;
}

/**
* Gets the m filter.
*
* @return the m filter
*/
public Predicate<ConfEvent> getMFilter() {
return mFilter;
}

/*
* (non-Javadoc)
*
* @see
* com.genesyslab.platform.applicationblocks.commons.Action#handle(java.
* lang.Object)
*/
public void handle(ConfEvent event) {
try {
log.warn("Config Update Event " + event.toString());
if (event.getObjectType() == CfgObjectType.CFGApplication) {
ParseConfigApplicationEvent parse = new ParseConfigApplicationEvent(event);
} else if (event.getObjectType() == CfgObjectType.CFGCampaign) {
//ParseConfigCampaignEvent parse = new ParseConfigCampaignEvent(event);
} else if (event.getObjectType() == CfgObjectType.CFGPerson) {
//ParseConfigPersonEvent parse = new ParseConfigPersonEvent(event);
} else if (event.getObjectType() == CfgObjectType.CFGDN) {
//ParseConfigDNEvent parse = new ParseConfigDNEvent(event);
} else if(event.getObjectType()== CfgObjectType.CFGCallingList){
//ParseCallingListEvent parse = new ParseCallingListEvent(event);
}else if(event.getObjectType()== CfgObjectType.CFGAgentGroup){
//ParseAgentGroupEvent parse = new ParseAgentGroupEvent(event);
}
else if(event.getObjectType()== CfgObjectType.CFGAgentLogin){
//ParseAgentLoginEvent parse = new ParseAgentLoginEvent(event);
}

} catch (Exception e) {
log.error(e.getMessage(), e);
}
}

/**
* Sets the m filter.
*
* @param filter
*            the new m filter
*/
public void setMFilter(Predicate<ConfEvent> filter) {
mFilter = filter;
}

}[/code]

Offline Gabi

  • Jr. Member
  • **
  • Posts: 64
  • Karma: 0
Re: Problems with Java Platform SDK version 8.5.301
« Reply #4 on: November 20, 2019, 10:50:14 AM »
Thanks! Except... What does unSubscribeNotifications do?

[Edit: nevermind, I assume you keep a reference to your subscriber and unSubscribeNotifications calls unregister(subscriber).]
« Last Edit: November 20, 2019, 11:22:48 AM by Gabi »