2 Replies Latest reply on Apr 17, 2011 6:28 AM by Ravi Kumar

    Missing Constraint: Import-Package: sun.net.www.protocol.http; version="0.0

    Ravi Kumar Newbie

      Hi,

       

      Iam using Apache ServiceMix (4.3.0-fuse-02-00) version and I have a service which imports below statements and functions from package sun.net.www.protocol.http. Iam able to compile the service using maven. But when I deploy the service i get below errors(Reason: Missing Constraint: Import-Package: sun.net.www.protocol.http; version="0.0.0"). This packages are part of JDK, if i want these packages in servicemix how to get the bundle & deploy for the same in servicemix. Or is there any other way to resolve this issue.

       

       

      import sun.net.www.protocol.http.AuthCacheValue;

       

      import sun.net.www.protocol.http.AuthCacheImpl;

       

       

      ....

       

       

      AuthCacheValue.setAuthCache(new AuthCacheImpl());

       

       

       

       

      -


      Exception

      -


      java.lang.Exception: Could not start bundle mvn:project/IntegrationService in feature(s) : The bundle "mvn:project.IntegrationService_1.0.0.SNAPSHOT 148" could not be resolved. Reason: Missing Constraint: Import-Package: sun.net.www.protocol.http; version="0.0.0"

      at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:311)8:org.apache.karaf.features.core:2.0.0.fuse-01-00

      at org.apache.karaf.features.internal.FeaturesServiceImpl$1.run(FeaturesServiceImpl.java:765)8:org.apache.karaf.features.core:2.0.0.fuse-01-00

      Caused by: org.osgi.framework.BundleException: The bundle "mvn:project.IntegrationService_1.0.0.SNAPSHOT 148" could not be resolved. Reason: Missing Constraint: Import-Package: sun.net.www.protocol.http; version="0.0.0"

      at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)osgi-3.6.0.v20100517.jar:

      at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)osgi-3.6.0.v20100517.jar:

      at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)osgi-3.6.0.v20100517.jar:

      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)osgi-3.6.0.v20100517.jar:

      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)osgi-3.6.0.v20100517.jar:

      at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:303)8:org.apache.karaf.features.core:2.0.0.fuse-01-00

      ... 1 more

       

       

       

      Thanks for the help

      Ravi

       

      Edited by: ravin4u on Apr 16, 2011 1:28 PM