title: Java getEncoded() NoSuchMethodError
body: <p>I'm using this web-push java library: <a href="https://github.com/MartijnDwars/web-push" rel="nofollow noreferrer">https://github.com/MartijnDwars/web-push</a></p>
  
  <p>Gradle build task to compile as a jar file to be use in Coldfusion.</p>
  
  <pre><code>jar {
    baseName = 'web-push'
    version = '3.0.0'
    doFirst {
        from {
            configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
        }
    }
    exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA' 
  }
  </code></pre>
  
  <p>So i have a functioning jar file with all the dependencies. However, when I go to send a notification I get this error.</p>
  
  <p><code>java.lang.NoSuchMethodError: org.bouncycastle.math.ec.ECPoint.getEncoded(Z)[B</code></p>
  
  <p>which points to the <code>savePublicKey</code> method in <code>Utils.java</code></p>
  
  <pre><code>public static byte[] savePublicKey(ECPublicKey publicKey) {
      return publicKey.getQ().getEncoded(false);
  }
  </code></pre>
  
  <p>Its my understanding that <code>getEncoded</code> is a build int java Key method. So I'm not sure if I'm getting this error because <code>publicKey.getQ</code> isn't a valid key or because I need to import/include a java key class. </p>
  
  <p>Thanks in advance for any tips/help. </p>
  
  <p>CFML Code</p>
  
  <pre><code>&lt;cfscript&gt;
  
  variables.server.pubKey = 'XXXXXXXXXXX';
  variables.server.priKey = 'XXXXXX';
  
  variables.subscription = {
        "endpoint": "https://fcm.googleapis.com/fcm/send/eEmctHWg8-k:APA91bF-kzQfUv1Y1T9C3sJ3eN5zDDtyRhcDU0MyVS1XWgPIko2X7VpjeymhqDAzb-4nbg4x2SmObHk1JSITG4lmsx-40E_uNi4a_TnFavs4ICMzbeHQJzKgnuTAcQxSXDxJSBNFrzY_"
      , "keys": {
            "p256dh": "BMIWtizmL6BgkofOn6DmPq/AaDwBvh894GBHvPpH2xgg9/uNoNsvKWAfEXVxLgpaUeytb8tGryguvIAmYTDO0W8="
          , "auth": "zDH8z4GPHvW2zFXG0bf2pQ=="
      } 
  }
  variables.json = serializeJSON(variables.subscription);
  
  variables.java.gson = createObject('java', 'com.google.gson.Gson', expandPath('/fw/jar/gson-2.8.0.jar'));
  
  variables.lib               = expandPath('/fw/jar/web-push-3.0.0.jar');
  variables.java.subscription = createObject('java', 'nl.martijndwars.webpush.Subscription', variables.lib);
  variables.java.notification = createObject('java', 'nl.martijndwars.webpush.Notification', variables.lib);
  variables.java.pushservice  = createObject('java', 'nl.martijndwars.webpush.PushService', variables.lib);
  
  variables.java.subscription = variables.java.gson.fromJson(variables.json, variables.java.subscription.class);
  
  variables.java.notification.init(variables.java.subscription, 'Hello, World!');
  
  variables.java.pushservice.init(variables.server.pubKey, variables.server.priKey, "mailto:craig@thinkerventures.com");
  
  variables.resonse = variables.java.pushservice.send(variables.java.notification);
  
  &lt;/cfscript&gt;
  </code></pre>
  
  <p>CFML Stack Trace</p>
  
  <pre><code>Full Trace: org.bouncycastle.math.ec.ECPoint.getEncoded(Z)[B 
  at nl.martijndwars.webpush.Utils.savePublicKey(Utils.java:36):36 
  at nl.martijndwars.webpush.HttpEce.lengthPrefix(HttpEce.java:124):124 
  at nl.martijndwars.webpush.HttpEce.deriveDH(HttpEce.java:115):115 
  at nl.martijndwars.webpush.HttpEce.deriveKey(HttpEce.java:55):55 
  at nl.martijndwars.webpush.HttpEce.encrypt(HttpEce.java:172):172 
  at nl.martijndwars.webpush.PushService.encrypt(PushService.java:92):92 
  at nl.martijndwars.webpush.PushService.sendAsync(PushService.java:128):128 
  at nl.martijndwars.webpush.PushService.send(PushService.java:113):113 
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method):-2 
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62):62 
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43):43 
  at java.lang.reflect.Method.invoke(Method.java:497):497 
  at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:55):55 
  at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:857):857 
  at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:842):842 
  at lucee.runtime.java.JavaObject.call(JavaObject.java:228):228 
  at lucee.runtime.java.JavaObject.call(JavaObject.java:259):259 
  at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:743):743 
  at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1593):1593 
  at script.dev.push_cfm$cf.call(D:\nonprofitthrive_com\script\dev\push.cfm:38):38 
  at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:954):954 
  at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:858):858 
  at fw.application_fw_cfc$cf.udfCall1(D:\nonprofitthrive_com\fw\application_fw.cfc:279):279 
  at fw.application_fw_cfc$cf.udfCall(D:\nonprofitthrive_com\fw\application_fw.cfc):-1 
  at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111 
  at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328 
  at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229 
  at lucee.runtime.ComponentImpl._call(ComponentImpl.java:642):642 
  at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524 
  at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1761):1761 
  at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:414):414 
  at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:223):223 
  at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:37):37 
  at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2265):2265 
  at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2228):2228 
  at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456 
  at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:47):47 
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:729):729 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291):291 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206 
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239):239 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206 
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217):217 
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106):106 
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502):502 
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142):142 
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79):79 
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88):88 
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518):518 
  at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:844):844 
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673):673 
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500):1500 
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456):1456 
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142 
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617 
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61 
  at java.lang.Thread.run(Thread.java:745):745 
  </code></pre>