Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:24:19+00:00 2026-06-01T08:24:19+00:00

I am trying to use com.sun.crypto.provider.SunJCE (for HMAC) in an OSGi Bundle. I am

  • 0

I am trying to use com.sun.crypto.provider.SunJCE (for HMAC) in an OSGi Bundle.

I am using the maven-bundle-plugin with these configs:

<Embed-Dependency>*;scope=runtime;inline=false</Embed-Dependency>
<Import-Package>*;resolution:=optional</Import-Package>

When i execute my bundle I get this error:

Caused by: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE

How can I get the code in my OSGi bundle to have access to com.sun.crypto.provider?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:24:20+00:00Added an answer on June 1, 2026 at 8:24 am

    Looking at your maven config, one thing which jumps out is that making all your package imports optional is unwise. It undoes many of the benefits OSGi gives you by deferring problems to execution time, instead of letting you know at bundle start time that something isn’t right. Fail slow instead of fail fast, in other words! It’s only appropriate for dependencies which are genuinely optional.

    Of course, your ultimate aim is to not fail at all, rather than just failing faster. As a starting point to understanding what’s happening, have you opened up your built bundle and checked that the crypto packages are actually being embedded? It’s a good idea to check your build is doing what you hope it is.

    However, in this particular case, since this is a class which you would normally expect the JVM to provide, I’d suggest checking your boot classpath to ensure it’s available, dropping the embed dependency, and using the org.osgi.framework.system.packages.extra property instead of embedding the dependency.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use com.sun.grizzly.SSLConfig.setKeyStoreFile() to set SSL for Grizzly. It only takes a
I'm trying to use Maven, Jetty and HtmlUnit to test a webapp written using
I'm trying to use the example taken from the http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html , in which I've
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying to use datetimepicker from: http://trentrichardson.com/ functionality is working it seems, but
I am trying to use this function from a COM API which enables the
I am trying to use django-socialauth ( http://github.com/uswaretech/Django-Socialauth ) for authenticating users for my
I am trying to use the Class.forName('com.mypack.MyDomain').newInstance() to create an instance of the grails
I am trying to use http://code.google.com/p/as3svgrendererlib/ in my flash cs 5.5 project to import
When trying to use subversive with my beanstalk svn repo (https://beanstalkapp.com) I get the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.