Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [osgi-dev] Need help about Importing java.* packages not allowed: java.io error
  • From: BJ Hargrave <hargrave@xxxxxxxxxx>
  • Date: Sat, 1 Jul 2023 23:31:14 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=us.ibm.com; dmarc=pass action=none header.from=us.ibm.com; dkim=pass header.d=us.ibm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9g00YRSjQWMwQWIVM8lPYYMlocLbywOzIpfr5Nd32l4=; b=NLMVuFhGLn3ge5SysgkA6Yj7AjrRFtylc3sWlpWyaIWtIGh4m4Doqj2U3zzLBKi86nR2udxZBjnihQGU3+WCs0OR1YcX5aVaniwMxqUSnGh6DVYuWlGmJDFU18cIZjmtTcVK3z2KlyefaerpK9mGKFzNXtg7qTBezrBEz2SjWObOIKmMRYOTgLbzOx1elZprgPIEcmmoT1ewfLtomI7FdR/V92re9qf7TGVUj7bw8CsKHhLK8LSkoNxKCjbG4MUx9eDFP/p1q/M9Mt127z9FLOd70ykNBLnI2+4VwN9qlp8NLz9x4T1vUtBkH3FGSytN9Fbd/Um/jXHWVjjRa2vUKw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jw+7zd4Vqzsvtc5sZr/ciDUqlvOoafOdvDk2Lj/3hS9qJzJhHmuXtUebVb5FWekScba5gbZc/imd2Hp8TXqnPnnX7MlNpdoJxrzJcRZfQWZfnVELy1CZ3vZsfSp4DglQR/5dyubaSWvGV8VmjPt2HAdqO69APfMSCYq4M1OswRut4eGxHjMZKQxJdMw8hcEJByJCnN9kmkQlAuBrey+ubC8XAud+9k7k/6MDqBWBKUDs1y9R2iyrYX0pc7ANDU7pYLqQBpOjV06A6Cotl8Ei/tAV6Djlaix+GMjtitBt8bk/CtP+jMD5o6BE72M7Ykuhoiv0oxS27S7sObl/U2BW4g==
  • Delivered-to: osgi-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/osgi-dev/>
  • List-help: <mailto:osgi-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/osgi-dev>, <mailto:osgi-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/osgi-dev>, <mailto:osgi-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHZrG7XGVRLHrEFJkqDmtjHs0G0sa+ljl82
  • Thread-topic: [EXTERNAL] [osgi-dev] Need help about Importing java.* packages not allowed: java.io error

You need to configure “-noimportjava: true” which is (I think) “<_noimportjava>true<_ noimportjava>” in maven-bundle-plugin configuration.

 

Importing of java.* is allowed in OSGi Core 7. It would appear that you may be compiling against OSGi Core 7 while attempting to deploy on OSGi Core 6 which is not good.

 

-- 


BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
Open Source Development // mobile: +1 386 848 3788
hargrave@xxxxxxxxxx

 

 

 

From: osgi-dev <osgi-dev-bounces@xxxxxxxxxxx> on behalf of BINGZHI QIAO <bingzhi.qiao@xxxxxxxxx>
Date: Saturday, July 1, 2023 at 18:53
To: osgi-dev@xxxxxxxxxxx <osgi-dev@xxxxxxxxxxx>
Subject: [EXTERNAL] [osgi-dev] Need help about Importing java.* packages not allowed: java.io error

Hello all,  I tried to deploy my bundle in a karaf container 4. 2. 16. ( Using AdoptOpenJDK-11. 0. 11+9 (build 11. 0. 11+9) and OSGI 6. 0. 0)  When my bundle was installing, i'm facing this issue  with error message below :  org. osgi. framework. BundleException: 

ZjQcmQRYFpfptBannerStart

This Message Is From an Untrusted Sender

You have not previously corresponded with this sender.

    Report Suspicious    ‌

ZjQcmQRYFpfptBannerEnd

Hello all, 

 

I tried to deploy my bundle in a karaf container 4.2.16. ( Using AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) and OSGI 6.0.0) 

 

When my bundle was installing, i'm facing this issue  with error message below : 

 

org.osgi.framework.BundleException: Importing java.* packages not allowed: java.io
        at org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeImportClauses(ManifestParser.java:349)
        at org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java:181)
        at org.apache.felix.framework.BundleRevisionImpl.<init>(BundleRevisionImpl.java:117)
        at org.apache.felix.framework.BundleImpl.createRevision(BundleImpl.java:1282)
        at org.apache.felix.framework.BundleImpl.<init>(BundleImpl.java:113)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3042)
        at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:167)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.installOrUpdateBundle(DirectoryWatcher.java:1037)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:963)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:884)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:489)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316)

 

 

Maybe i forgot something, please help,  i tried also modifying the pom.xml, but always the same result : 

 

<plugin>
<
groupId>org.apache.felix</groupId>
<
artifactId>maven-bundle-plugin</artifactId>
<
version>${maven-bundle-plugin.version}</version>
<
extensions>true</extensions>
<
configuration>
<
instructions>
<
Export-Package>!*</Export-Package>
<
Import-Package>java.*,*</Import-Package>
<
Private-Package>
io.abc.restapi.*
</
Private-Package>
</
instructions>
</
configuration>

 

Thanks

 

BR,

___________________________________________________________
BINGZHI QIAO


Back to the top