Exception while running ejbca.sh which was deployed in JBOSS EAP6.1

Help
vinod
2014-08-08
2014-08-12
  • vinod
    vinod
    2014-08-08

    Hi

    I have downloaded ejbca6.2.0 and deployed in jboss and able to execute ejbca.sh.
    But i have copied some of the jars and ejbca.ear to separate environment there i able to deploy ejbca in jboss server but execution of ejbca.sh was failed with below exception.It seems i missed some jars .Can anyone help me in this.

    Exception in thread "main" java.util.ServiceConfigurationError: org.ejbca.ui.cli.infrastructure.command.CliCommandPlugin: Provider org.ejbca.ui.cli.ca.CaImportCertCommand could not be instantiated: java.lang.NoClassDefFoundError: javax/ejb/FinderException
    at java.util.ServiceLoader.fail(ServiceLoader.java:224)
    at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
    at org.ejbca.ui.cli.infrastructure.library.CommandLibrary.<init>(CommandLibrary.java:53)
    at org.ejbca.ui.cli.infrastructure.library.CommandLibrary.<clinit>(CommandLibrary.java:38)
    at org.ejbca.ui.cli.EjbcaEjbCli.main(EjbcaEjbCli.java:30)
    Caused by: java.lang.NoClassDefFoundError: javax/ejb/FinderException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2493)
    at java.lang.Class.getConstructor0(Class.java:2803)
    at java.lang.Class.newInstance(Class.java:345)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)
    ... 4 more
    Caused by: java.lang.ClassNotFoundException: javax.ejb.FinderException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 9 more
    bash-3.2#

     
  • Mike Kushner
    Mike Kushner
    2014-08-08

    Hi,

    You seem to have missed the Java EE jars, they should be located in your appserver's lib directory.

    Cheers,
    Mike Kushner
    Developer, Primekey Solutions


    PrimeKey Solutions offers commercial EJBCA and SignServer support
    subscriptions and training courses. Please see www.primekey.se or
    contact sales@primekey.se for more information.
    http://www.primekey.se/Services/Support/
    http://www.primekey.se/Services/Training/


     
  • vinod
    vinod
    2014-08-08

    Thanks mike,

    But I have not removed/updated the appserver jars.Is it like i need to copy the appserver jars to custom directory where i have ejbca related jars ?

    This is the directories present in the jboss there is no lib directory.
    JBossEULA.txt appclient bundles domain modules version.txt
    LICENSE.txt bin docs jboss-modules.jar standalone welcome-content

     
  • Mike Kushner
    Mike Kushner
    2014-08-08

    By missing, I mean that they're missing from your classpath. In JBoss 6+ all libs are found under the modules directory.

    Cheers,
    Mike Kushner
    Developer, Primekey Solutions
    PrimeKey Solutions offers commercial EJBCA and SignServer support
    subscriptions and training courses. Please see www.primekey.se or
    contact sales@primekey.se for more information.
    http://www.primekey.se/Services/Support/
    http://www.primekey.se/Services/Training/

     
    • vinod
      vinod
      2014-08-12

      Hi Mike,

      I was able to resolve the issue by adding missing jars to ejbca-ejb-cli/lib/.
      Now I am able to execute the ejbca.sh.
      But i am getting like below

      Allow external re-configuration: true
      Added system properties to configuration source (java -Dfoo.prop=bar).
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/ejbca.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/web.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/cmptcp.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/externalra-caservice.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/ocsp.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/jaxws.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/xkms.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/cache.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/database.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/va.properties
      Added file to configuration source: /var/tmp/ejbca_ce_6_2_0/conf/va-publisher.properties
      Added file to configuration source: /etc/ejbca/conf/ejbca.properties
      Added file to configuration source: /etc/ejbca/conf/web.properties
      Added file to configuration source: /etc/ejbca/conf/cmptcp.properties
      Added file to configuration source: /etc/ejbca/conf/externalra-caservice.properties
      Added file to configuration source: /etc/ejbca/conf/ocsp.properties
      Added file to configuration source: /etc/ejbca/conf/jaxws.properties
      Added file to configuration source: /etc/ejbca/conf/xkms.properties
      Added file to configuration source: /etc/ejbca/conf/cache.properties
      Added file to configuration source: /etc/ejbca/conf/database.properties
      Added file to configuration source: /etc/ejbca/conf/va.properties
      Added file to configuration source: /etc/ejbca/conf/va-publisher.properties


      The following categories are available:
      [ ca | config | cryptotoken | hardtoken | keybind | ra | roles | service | svgtemplate ]


      And the following commands are available:
      asn1dump Dumps PEM or DER encoded certificate as readable ASN.1
      batch Generate keys and certificates for all users with status NEW
      clearcache Clears caches used internally by EJBCA.
      createcert Issue a certificate for a user based on a CSR
      encryptpwd Encrypts a password to avoid accidental reading
      upgrade Upgrade command. Use 'ant upgrade' instead of running this directly.

      Type a command and "--help" for more information.

      Do i need to update any property to hide the messages like "Added file to configuration source: /etc/ejbca/conf/va-publisher.properties"

      Thanks,
      Vinod

       
  • vinod
    vinod
    2014-08-12

    Hi Mike

    I got this because i have updated the ejbca.properites "allow.external-dynamic.configuration" to true before build after commenting it i did not get those messges.

    Thanks,
    Vinod