0

Currently i am using web3j to create an account in my private block chain. Like:

Web3j web3 = Web3j.build(new HttpService());
    Web3ClientVersion web3ClientVersion;

String walletFileName = WalletUtils.generateFullNewWalletFile("password",new File("/opt/test"));

LOGGER.info("walletFileName>>>>>" + walletFileName.substring(0));

This code works fine in my local machine.But i am getting this exception in my test server:

java.security.InvalidAlgorithmParameterException: parameter object not a ECParameterSpec
    at org.bouncycastle.jce.provider.JDKKeyPairGenerator$EC.initialize(Unknown Source)
    at org.web3j.crypto.Keys.createSecp256k1KeyPair(Keys.java:49)
    at org.web3j.crypto.Keys.createEcKeyPair(Keys.java:55)
    at org.web3j.crypto.WalletUtils.generateNewWalletFile(WalletUtils.java:44)
    at org.web3j.crypto.WalletUtils.generateFullNewWalletFile(WalletUtils.java:29)
    at com.belrium.service.UserWalletService.createNewWallet(UserWalletService.java:91)
    at com.belrium.service.UserAuthenticationService.verifyEmailAddress(UserAuthenticationService.java:126)
    at com.belrium.controller.UserAuthenticationController.verifyEmailAddress(UserAuthenticationController.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)

I have searched a lot and tried all things but not able to resolve it.Please help.

Michal Borowiecki
  • 4,244
  • 1
  • 11
  • 18
Abhishek saini
  • 507
  • 1
  • 8
  • 29

2 Answers2

0

This error is typically related to your current JDK/ceritificate/configurations installations : Solution : RE-install the JDK/configurations on your test server.

Other possible Issue : If you have any SSL certificate on your test server ? please refer to below URL to understand the issue : Please go through http://iwang.github.io/support/2014/03/14/cxf-cause-https-error.html

0

I was using this maven plugin

<!-- flying saucer pdf -->
<!--    <dependency>
        <groupId>org.xhtmlrenderer</groupId>
        <artifactId>flying-saucer-pdf</artifactId>
        <version>9.1.4</version>
    </dependency> -->

for creating pdf. By removing this plugin from my pom.xml my issue is ressolved.But why it was creating that exception not know.

Abhishek saini
  • 507
  • 1
  • 8
  • 29