IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Please help java.lang.reflect.InvocationTargetException: id_hmacWithSHA3_224 java.lang.reflect.InvocationTargetException:id_hmacWithSHA3_224

  • 1.  Please help java.lang.reflect.InvocationTargetException: id_hmacWithSHA3_224 java.lang.reflect.InvocationTargetException:id_hmacWithSHA3_224

    Posted Tue May 18, 2021 04:42 PM

    HI,
    I am trying to do sign on prodess, i provided config file pah and privita cert.
    getting folloewing error, please help
    here is java code:

    package Gen_CMISDP.java;

    import com.wm.data.*;
    import com.wm.util.Values;
    import com.wm.app.b2b.server.Service;
    import com.wm.app.b2b.server.ServiceException;
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.nio.charset.StandardCharsets;
    import javax.ws.rs.client.Client;
    import javax.ws.rs.client.ClientBuilder;
    import javax.ws.rs.client.Invocation;
    import javax.ws.rs.client.WebTarget;
    import javax.ws.rs.core.MediaType;
    import javax.ws.rs.core.Response;
    import com.google.common.net.UrlEscapers;
    import com.oracle.bmc.http.signing.RequestSigningFilter;

    public final class signIN_OCI_SVC

    {

    /** 
    * The primary method for the Java service
    *
    * @param pipeline
    *            The IData pipeline
    * @throws ServiceException
    */
    public static final void signIN_OCI(IData pipeline) throws ServiceException {
    IDataCursor pipelineCursor = pipeline.getCursor();
    String configurationFilePath = IDataUtil.getString( pipelineCursor,
    "configurationFilePath" );
    String profile = "DEFAULT";
    String instanceId = null;
    String error=null;
    try {
    RequestSigningFilter requestSigningFilter =
    RequestSigningFilter.fromConfigFile(configurationFilePath, profile);
    Client client =
    ClientBuilder.newBuilder().build().register(requestSigningFilter);
    WebTarget target =
    client.target("https://iaas.us-phoenix-1.oraclecloud.com")
    .path("20160918")
    .path("instances")
    .path(UrlEscapers.urlPathSegmentEscaper().escape(instanceId));
    Invocation.Builder ib = target.request();
    ib.accept(MediaType.APPLICATION_JSON);
    Response response = ib.get();
    // MultivaluedMap <String, Object> responseHeaders = response.getHeaders();
    //System.out.println(responseHeaders);
    InputStream responseBody = (InputStream) response.getEntity();
    try (final BufferedReader reader =
    new BufferedReader(new InputStreamReader(responseBody,
    StandardCharsets.UTF_8))) {
    StringBuilder jsonBody = new StringBuilder();
    String line;
    while ((line = reader.readLine()) != null) {
    jsonBody.append(line);
    }
    IDataUtil.put( pipelineCursor, "jsonBody", jsonBody.toString() );
    pipelineCursor.destroy();
    }
    
    } catch (Exception e) {
    // TODO Auto-generated catch block
    error=e.getLocalizedMessage();
    IDataUtil.put( pipelineCursor, "error", error );
    pipelineCursor.destroy();
    }
    
    
    }
    
    // --- <<IS-BEGIN-SHARED-SOURCE-AREA>> ---
    
    
    
    // --- <<IS-END-SHARED-SOURCE-AREA>> ---
    
    /**
    * The service implementations given below are read-only and show only the
    * method definitions and not the complete implementation.
    */
    public static final void signIn_javaService(IData pipeline) throws ServiceException {
    }
    
    final static signIN_OCI_SVC _instance = new signIN_OCI_SVC();
    
    static signIN_OCI_SVC _newInstance() { return new signIN_OCI_SVC(); }
    
    static signIN_OCI_SVC _cast(Object o) { return (signIN_OCI_SVC)o; }
    

    }

    Launch started: 2021-05-18 16:08:30.883
    Configuration name: signIN
    Configuration location: C:/Users//.metadata/.plugins/org.eclipse.debug.core/.launches/sigI.launch

    Could not run ‘signIN_OCI’
    java.lang.reflect.InvocationTargetException: id_hmacWithSHA3_224

    java.lang.reflect.InvocationTargetException:id_hmacWithSHA3_224
    Launch completed: 2021-05-18 16:08:32.747


    #webMethods-io-Integration
    #CloudStreams
    #B2B-Integration
    #API-Portal
    #Integration-Server-and-ESB
    #webMethods
    #webMethods-io-B2B
    #API-Management
    #soa
    #Service-Designer
    #Flow-and-Java-services


  • 2.  RE: Please help java.lang.reflect.InvocationTargetException: id_hmacWithSHA3_224 java.lang.reflect.InvocationTargetException:id_hmacWithSHA3_224

    Posted Tue May 18, 2021 07:51 PM

    Can some one please help what this error means i am running on webMethods 9.12

    Could not run ‘signIN_OCI’
    java.lang.reflect.InvocationTargetException: id_hmacWithSHA3_224


    #Service-Designer
    #Integration-Server-and-ESB
    #API-Portal
    #CloudStreams
    #webMethods
    #API-Management
    #webMethods-io-B2B
    #webMethods-io-Integration
    #B2B-Integration
    #soa
    #Flow-and-Java-services


  • 3.  RE: Please help java.lang.reflect.InvocationTargetException: id_hmacWithSHA3_224 java.lang.reflect.InvocationTargetException:id_hmacWithSHA3_224

    Posted Wed May 19, 2021 11:29 AM

    You may want to consider trying to use a REST API Descriptor (RAD) component in IS rather than using Java EE code. Not sure if RAD supports signing requests but if it does (and that is absolutely required by the Oracle endpoint you’re trying to call) that would be the way to go.


    #B2B-Integration
    #soa
    #Integration-Server-and-ESB
    #API-Management
    #webMethods-io-Integration
    #webMethods
    #webMethods-io-B2B
    #CloudStreams
    #Service-Designer
    #API-Portal
    #Flow-and-Java-services


  • 4.  RE: Please help java.lang.reflect.InvocationTargetException: id_hmacWithSHA3_224 java.lang.reflect.InvocationTargetException:id_hmacWithSHA3_224

    Posted Wed May 19, 2021 12:18 PM

    I think you have a java compatibility issue with the underlying JAR file. Also how have you packaged the jar dependencies, where have you put them ?

    You need to provide a lot more information, java version?
    How are you calling this class?
    Where have you put your dependent libraries and what are they etc ?

    And I agree with reamon, this not the webMethods way. You could run this as a standalone java app or in an apache runtime.

    With webMethods you could do the above with just a couple of lines of code like;

    Screenshot 2021-05-19 at 18.17.40

    John


    #webMethods
    #Integration-Server-and-ESB
    #API-Portal
    #webMethods-io-B2B
    #Flow-and-Java-services
    #B2B-Integration
    #API-Management
    #webMethods-io-Integration
    #soa
    #CloudStreams
    #Service-Designer