How to resolve "java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)" exception
book
Article ID: KB0076218
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON
2.1.0
Description
Some customers might encountered below exception while invoking the REST server through "Invoke REST API" activity.
============== Job-1116 [Processes/Common/ErrorLogger.process/Log]: ERROR : 3bcb3c0107a84932a8076a6a67499b3a / 00000000 : Error: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder; in Processes/Inbound/SMSInboundService.process/InvokeREST>Processes/InvokeREST/InvokeREST.process/Invoke REST API Stack Trace: Job-1116 Error in [Processes/InvokeREST/InvokeREST.process/Invoke REST API] java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder; at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) at org.glassfish.jersey.client.JerseyWebTarget.<init>(JerseyWebTarget.java:71) at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:290) at org.glassfish.jersey.client.JerseyClient.target(JerseyClient.java:76) at com.tibco.plugin.json.activities.RestActivity.eval(RestActivity.java:377) at com.tibco.pe.plugin.Activity.eval(Unknown Source) at com.tibco.pe.core.TaskImpl.eval(Unknown Source) at com.tibco.pe.core.Job.a(Unknown Source) at com.tibco.pe.core.Job.k(Unknown Source) at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source) at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source) ==============
Issue/Introduction
How to resolve "java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)" exception
Environment
Operation Systems: All
Resolution
The "Invoke REST API" need to call a public abstract method UriBuilder uri(java.lang.String uriTemplate) in the class javax.ws.rs.core.UriBuilder. For this to work, a subclass that implements this method must be available. The error indicates unavailability of implementation.
This subclass should be provided by "javax.ws.rs-api-2.0.1.jar" under TIBCO_HOME/bw/plugins/lib. However, sometimes a similar subclass with implementation was getting loaded from TIsforce.jar, which is part of TIBCO TPCL(TIBCO_HOME/tpcl/TPCL_Version/jdbc).
Although in TIsforce.jar, the "tibcosoftwareinc.sforce.externals.org.apache.cxf.jaxrs.impl.UriBuilderImpl" is a subclass of "javax.ws.rs.core.UriBuilder", it doesn't include the aforementioned method and hence the class "tibcosoftwareinc.sforce.externals.org.apache.cxf.jaxrs.impl.UriBuilderImpl" doesn't provide implementation for the same.
To resolve the issue, we can put the TPCL path (TIBCO_HOME/tpcl/TPCL_Version/jdbc) at the end of classpath in TRA file. If it doesn't work, then we can try to backup and remove the TIsforce.jar in the TIBCO_HOME/tpcl/TPCL_Version/jdbc folder.