Expand my Community achievements bar.

SOLVED

error while installing osgi bundle

Avatar

Level 4

Hi, 

getting below error while trying to create OSGI bundle what could be the possible error?

 

HTTP ERROR 500
Problem accessing /system/console/bundles. Reason:

    Server Error
Caused by:
java.io.IOException: Bundle-SymbolicName header missing, cannot install bundle

 

 

Thank you

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Here is system requirement for archetype 36 -

DEBAL_DAS_0-1656406562351.png

Please install AEM service pack 13 and latest core component package this will resolve the issue I believe.

View solution in original post

20 Replies

Avatar

Community Advisor

Check that the MANIFEST.MF file contains a proper SymbolicName header

Himanshu Jain

Avatar

Community Advisor

Hi @sriram_1 ,

It seems like you are trying to Install traditional (JAR) bundle where Bundle-SymbolicName header is missing, Please verify it, have to make sure that this name is unique in OSGI where you are deploying this bundle.

You can also recheck this property in MANIFEST.MF file for cross validation. You can also refer below link to define the symbolic name of OSGI bundle.

https://www.ibm.com/docs/en/was/8.5.5?topic=files-example-osgi-composite-bundle-manifest-file

Hope that helps!

Regards,

Santosh

Avatar

Level 4

Hi Santosh,

 

the link you have sent is not working,

and could you please tell what is Manifest.mf file and where can i find it ?

 

Thank you

Avatar

Community Advisor

Are you trying to deploy any custom project on AEM or downloading any JAR file from web? 
In both the cases it should have Bundle-SymbolicName - check in target folder of the core there is jar bundle extract it and you must see there META-INF folder under that there is MANIFEST.MF file.Screen Shot 2022-06-27 at 10.45.20 AM.png

Please refer this article: https://www.techinnovia.com/osgi-bundles/ watch video at the end where I have specified each property details. 

Avatar

Level 4

Thank you Santosh,

please look at my attached file

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven 3.8.1
Built-By: sriram_nandipati
Build-Jdk: 11.0.6

Avatar

Community Advisor

@sriram_1 So, there is missing Bundle-SymbolicName, now you have to specify in pom.xml and follow steps for constructing bundles.  

Avatar

Employee Advisor

1. How did you create your maven project? Have you used AEM Project Archetype to create AEM project?

2. Please take a look into the MANIFEST.MF file in your project workspace [ e.g. C:\Users\debal\aem-projects\aem-demo\core\target\classes\META-INF\MANIFEST.MF], whether it has information like -

Manifest-Version: 1.0
Bundle-Category: AEM Demo sites
Bundle-Description: Core bundle for AEM Demo sites
Bundle-ManifestVersion: 2
Bundle-Name: AEM Demo sites - Core
Bundle-SymbolicName: aem-demo.core
Bundle-Version: 0.0.1.SNAPSHOT
Export-Package: com.aem.demo.core.filters;version="1.0";uses:="javax.s
 ervlet",com.aem.demo.core.listeners;version="1.0";uses:="org.osgi.ser
 vice.event",com.aem.demo.core.models;version="1.0";uses:="com.day.cq.
 audit,javax.annotation,javax.inject,org.apache.sling.api,org.apache.s
 ling.api.resource,org.apache.sling.models.annotations,org.apache.slin
 g.models.annotations.injectorspecific",com.aem.demo.core.schedulers;v
 ersion="1.0",com.aem.demo.core.servlets;version="1.0";uses:="javax.se
 rvlet,org.apache.sling.api,org.apache.sling.api.servlets"
Import-Package: javax.annotation;version="0.0.0",com.adobe.granite.ass
 et.api;version="[1.7,2)",com.adobe.granite.security.user;version="[1.
 10,2)",com.adobe.granite.taskmanagement;version="[1.2,2)",com.adobe.g
 ranite.workflow;version="[1.1,2)",com.adobe.granite.workflow.exec;ver
 sion="[1.2,2)",com.adobe.granite.workflow.metadata;version="[1.0,2)",
 com.adobe.granite.workflow.model;version="[1.2,2)",com.aem.demo.core.
 filters;version="[1.0,2)",com.aem.demo.core.listeners;version="[1.0,2
 )",com.day.cq.audit;version="[3.1,4)",com.day.cq.commons;version="[6.
 0,7)",com.day.cq.commons.predicate;version="[5.8,6)",com.day.cq.dam.a
 pi;version="[1.28,2)",com.day.cq.dam.commons.util;version="[1.60,2)",
 com.day.cq.mailer;version="[6.0,7)",com.day.cq.mailer.email;version="
 [6.0,7)",com.day.cq.replication;version="[6.5,7)",com.day.cq.search;v
 ersion="[1.3,2)",com.day.cq.search.result;version="[1.2,2)",com.day.c
 q.wcm.api;version="[1.29,2)",com.day.cq.wcm.api.components;version="[
 5.8,6)",com.day.cq.wcm.api.policies;version="[1.6,2)",com.google.comm
 on.base;version="[15.0,16)",javax.imageio,javax.inject;version="[1.0,
 2)",javax.jcr;version="[2.0,3)",javax.jcr.lock;version="[2.0,3)",java
 x.jcr.nodetype;version="[2.0,3)",javax.jcr.query;version="[2.0,3)",ja
 vax.jcr.version;version="[2.0,3)",javax.servlet;version="[3.1,4)",jav
 ax.xml.parsers,javax.xml.transform,javax.xml.transform.dom,javax.xml.
 transform.stream,org.apache.commons.collections;version="[3.2,4)",org
 .apache.commons.mail;version="[1.5,2)",org.apache.jackrabbit.api;vers
 ion="[2.6,3)",org.apache.jackrabbit.api.security.authentication.token
 ;version="[2.3,3)",org.apache.jackrabbit.api.security.user;version="[
 2.4,3)",org.apache.jackrabbit.vault.fs.io;version="[2.8,3)",org.apach
 e.jackrabbit.vault.packaging;version="[2.8,3)",org.apache.poi.ss.user
 model;version="[3.0,4)",org.apache.poi.xssf.usermodel;version="[3.0,4
 )",org.apache.sling.api;version="[2.3,3)",org.apache.sling.api.reques
 t;version="[2.4,3)",org.apache.sling.api.resource;version="[2.12,3)",
 org.apache.sling.api.servlets;version="[2.3,3)",org.apache.sling.caco
 nfig;version="[1.0,2)",org.apache.sling.caconfig.annotation;version="
 [1.1,2)",org.apache.sling.caconfig.resource;version="[1.0,2)",org.apa
 che.sling.commons.scheduler;version="[2.5,3)",org.apache.sling.models
 .annotations;version="[1.5,2)",org.apache.sling.models.annotations.in
 jectorspecific;version="[1.1,2)",org.apache.sling.rewriter;version="[
 1.0,2)",org.osgi.service.component;version="[1.4,2)",org.osgi.service
 .event;version="[1.3,2)",org.slf4j;version="[1.7,2)",org.w3c.dom,org.
 xml.sax,org.xml.sax.helpers
Private-Package: com.aem.demo.core.configurations,com.aem.demo.core.se
 rvices,com.aem.demo.core.services.impl,com.aem.demo.core.workflows
Provide-Capability: osgi.service;objectClass:List<String>="com.adobe.g
 ranite.workflow.exec.ParticipantStepChooser";uses:="com.adobe.granite
 .workflow.exec",osgi.service;objectClass:List<String>="com.adobe.gran
 ite.workflow.exec.WorkflowProcess";uses:="com.adobe.granite.workflow.
 exec",osgi.service;objectClass:List<String>="com.aem.demo.core.schedu
 lers.RecordScheduler";uses:="com.aem.demo.core.schedulers",osgi.servi
 ce;objectClass:List<String>="com.aem.demo.core.services.GetResolver";
 uses:="com.aem.demo.core.services",osgi.service;objectClass:List<Stri
 ng>="com.aem.demo.core.services.JcrUtility";uses:="com.aem.demo.core.
 services",osgi.service;objectClass:List<String>="com.aem.demo.core.se
 rvices.ReadCountryConfiguration";uses:="com.aem.demo.core.services",o
 sgi.service;objectClass:List<String>="com.aem.demo.core.services.Repo
 rtGenerationService";uses:="com.aem.demo.core.services",osgi.service;
 objectClass:List<String>="com.aem.demo.core.services.TaskNotification
 Service";uses:="com.aem.demo.core.services",osgi.service;objectClass:
 List<String>="com.aem.demo.core.services.WriteDataToFile";uses:="com.
 aem.demo.core.services",osgi.service;objectClass:List<String>="com.ae
 m.demo.core.services.WriteEmployeeData";uses:="com.aem.demo.core.serv
 ices",osgi.service;objectClass:List<String>="java.lang.Runnable",osgi
 .service;objectClass:List<String>="javax.servlet.Filter";uses:="javax
 .servlet",osgi.service;objectClass:List<String>="javax.servlet.Servle
 t";uses:="javax.servlet",osgi.service;objectClass:List<String>="org.a
 pache.commons.collections.Predicate";uses:="org.apache.commons.collec
 tions",osgi.service;objectClass:List<String>="org.apache.sling.common
 s.scheduler.Job";uses:="org.apache.sling.commons.scheduler",osgi.serv
 ice;objectClass:List<String>="org.apache.sling.rewriter.TransformerFa
 ctory";uses:="org.apache.sling.rewriter",osgi.service;objectClass:Lis
 t<String>="org.osgi.service.event.EventHandler";uses:="org.osgi.servi
 ce.event"
Require-Capability: osgi.service;filter:="(objectClass=com.adobe.grani
 te.security.user.UserPropertiesService)";effective:=active,osgi.servi
 ce;filter:="(objectClass=com.aem.demo.core.services.GetResolver)";eff
 ective:=active,osgi.service;filter:="(objectClass=com.aem.demo.core.s
 ervices.JcrUtility)";effective:=active,osgi.service;filter:="(objectC
 lass=com.aem.demo.core.services.ReportGenerationService)";effective:=
 active,osgi.service;filter:="(objectClass=com.aem.demo.core.services.
 TaskNotificationService)";effective:=active,osgi.service;filter:="(ob
 jectClass=com.aem.demo.core.services.WriteDataToFile)";effective:=act
 ive,osgi.service;filter:="(objectClass=com.aem.demo.core.services.Wri
 teEmployeeData)";effective:=active,osgi.service;filter:="(objectClass
 =com.day.cq.audit.AuditLog)";effective:=active,osgi.service;filter:="
 (objectClass=com.day.cq.commons.Externalizer)";effective:=active,osgi
 .service;filter:="(objectClass=com.day.cq.mailer.MailService)";effect
 ive:=active;resolution:=optional,osgi.service;filter:="(objectClass=c
 om.day.cq.mailer.MessageGatewayService)";effective:=active,osgi.servi
 ce;filter:="(objectClass=com.day.cq.mailer.email.EmailTemplate)";effe
 ctive:=active,osgi.service;filter:="(objectClass=com.day.cq.replicati
 on.AgentManager)";effective:=active,osgi.service;filter:="(objectClas
 s=com.day.cq.replication.Replicator)";effective:=active,osgi.service;
 filter:="(objectClass=com.day.cq.search.QueryBuilder)";effective:=act
 ive,osgi.service;filter:="(objectClass=org.apache.jackrabbit.vault.pa
 ckaging.Packaging)";effective:=active,osgi.service;filter:="(objectCl
 ass=org.apache.sling.api.resource.ResourceResolverFactory)";effective
 :=active,osgi.service;filter:="(objectClass=org.apache.sling.caconfig
 .resource.ConfigurationResourceResolver)";effective:=active,osgi.serv
 ice;filter:="(objectClass=org.apache.sling.commons.scheduler.Schedule
 r)";effective:=active,osgi.extender;filter:="(&(osgi.extender=osgi.co
 mponent)(version>=1.4.0)(!(version>=2.0.0)))",osgi.ee;filter:="(&(osg
 i.ee=JavaSE)(version=1.8))"
Service-Component: OSGI-INF/com.aem.demo.core.filters.LoggingFilter.xm
 l,OSGI-INF/com.aem.demo.core.listeners.PagePropertyUpdateListener.xml
 ,OSGI-INF/com.aem.demo.core.listeners.SimpleResourceListener.xml,OSGI
 -INF/com.aem.demo.core.schedulers.RecordScheduler.xml,OSGI-INF/com.ae
 m.demo.core.schedulers.ResourceExpirationScheduler.xml,OSGI-INF/com.a
 em.demo.core.schedulers.SimpleScheduledTask.xml,OSGI-INF/com.aem.demo
 .core.schedulers.TaskNotificationScheduler.xml,OSGI-INF/com.aem.demo.
 core.services.impl.DemoLinkRewriter.xml,OSGI-INF/com.aem.demo.core.se
 rvices.impl.ExpiryNotificationJobImpl.xml,OSGI-INF/com.aem.demo.core.
 services.impl.GetResolverImpl.xml,OSGI-INF/com.aem.demo.core.services
 .impl.ImageVideoAssetPredicate.xml,OSGI-INF/com.aem.demo.core.service
 s.impl.JcrUtilityImpl.xml,OSGI-INF/com.aem.demo.core.services.impl.Re
 adCountryConfigurationImpl.xml,OSGI-INF/com.aem.demo.core.services.im
 pl.ReportGenerationServiceImpl.xml,OSGI-INF/com.aem.demo.core.service
 s.impl.TaskNotificationServiceImpl.xml,OSGI-INF/com.aem.demo.core.ser
 vices.impl.WriteDataToFileImpl.xml,OSGI-INF/com.aem.demo.core.service
 s.impl.WriteEmployeeDataImpl.xml,OSGI-INF/com.aem.demo.core.servlets.
 AgentDetailsServlet.xml,OSGI-INF/com.aem.demo.core.servlets.DemoRespo
 nseServlet.xml,OSGI-INF/com.aem.demo.core.servlets.EmployeeFormServle
 t.xml,OSGI-INF/com.aem.demo.core.servlets.FailedWorkflowdetails.xml,O
 SGI-INF/com.aem.demo.core.servlets.PackgeUploadServlet.xml,OSGI-INF/c
 om.aem.demo.core.servlets.PageLockServlet.xml,OSGI-INF/com.aem.demo.c
 ore.servlets.PagePathTestServlet.xml,OSGI-INF/com.aem.demo.core.servl
 ets.PageUnLockServlet.xml,OSGI-INF/com.aem.demo.core.servlets.ReadIma
 geRenditionServlet.xml,OSGI-INF/com.aem.demo.core.servlets.ReadPageEv
 entServlet.xml,OSGI-INF/com.aem.demo.core.servlets.ReadPageInformatio
 nServlet.xml,OSGI-INF/com.aem.demo.core.servlets.ReferencePageSearchS
 ervlet.xml,OSGI-INF/com.aem.demo.core.servlets.ReplicationStatusServl
 et.xml,OSGI-INF/com.aem.demo.core.servlets.ResourceResportServlet.xml
 ,OSGI-INF/com.aem.demo.core.servlets.SearchResultDetailsServlet.xml,O
 SGI-INF/com.aem.demo.core.servlets.SimpleServlet.xml,OSGI-INF/com.aem
 .demo.core.servlets.TaskNotificationServlet.xml,OSGI-INF/com.aem.demo
 .core.servlets.UserInfoServlet.xml,OSGI-INF/com.aem.demo.core.servlet
 s.UserPropertiesServlet.xml,OSGI-INF/com.aem.demo.core.servlets.Write
 DatatoDamServlet.xml,OSGI-INF/com.aem.demo.core.workflows.ContentExpi
 ryNotification.xml,OSGI-INF/com.aem.demo.core.workflows.ContentReview
 Notification.xml,OSGI-INF/com.aem.demo.core.workflows.ContentReviewer
 Notification.xml,OSGI-INF/com.aem.demo.core.workflows.CustomParticipa
 ntStep.xml,OSGI-INF/com.aem.demo.core.workflows.DynamicParticipantSte
 p.xml,OSGI-INF/com.aem.demo.core.workflows.GetInitiatorInfoStep.xml,O
 SGI-INF/com.aem.demo.core.workflows.InitiatorDetailsStep.xml,OSGI-INF
 /com.aem.demo.core.workflows.PackageUploadProcess.xml,OSGI-INF/com.ae
 m.demo.core.workflows.PageLockWorkflowStep.xml,OSGI-INF/com.aem.demo.
 core.workflows.PageLockwithInitiatorWorkflowStep.xml,OSGI-INF/com.aem
 .demo.core.workflows.PageUnLockWorkflowStep.xml,OSGI-INF/com.aem.demo
 .core.workflows.RegionalHeadDynamicParticipantStep.xml,OSGI-INF/com.a
 em.demo.core.workflows.RemoveBulkAssetMetadata.xml
Sling-Model-Classes: com.aem.demo.core.models.ArticleModel,com.aem.dem
 o.core.models.CompaniesModel,com.aem.demo.core.models.CompaniesModel$
 Company,com.aem.demo.core.models.CompaniesModel$Department,com.aem.de
 mo.core.models.CompletionDateModel,com.aem.demo.core.models.HelloWorl
 dModel,com.aem.demo.core.models.PDPensionsPotInfoImpl,com.aem.demo.co
 re.models.PageEventModel,com.aem.demo.core.models.PageModel,com.aem.d
 emo.core.models.PagePropertiesModel,com.aem.demo.core.models.Products
 Model,com.aem.demo.core.models.ProductsModel$Product,com.aem.demo.cor
 e.models.ReadCountryInfoModel,com.aem.demo.core.models.RequestHeaderM
 odel

Avatar

Level 4

Hi Debal, 

 

yes, created using AEM Project Archetype. 

is there any other way we can create bundle ...error free and simpler way?

 

 

Thank you

Avatar

Community Advisor

@sriram_1 You can try creating new project and see how the bundle are created using plugins referring to pom.xml, For AEM 6.4.8 you can use any Archetype 24-27 https://github.com/adobe/aem-project-archetype/blob/master/VERSIONS.md

 

Use this below command to create project

mvn -B archetype:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=27 -D appTitle="My Project" -D appId="myproject" -D groupId="com.myproject.aem" -D artifactId="myproject-aem-project" -D version="0.0.1-SNAPSHOT" -D aemVersion="6.4.8" -D includeExamples=n

Once done, you can then deploy this project using below command

mvn clean install -PautoInstallPackage

 

Reference: https://experienceleague.adobe.com/docs/experience-manager-learn/sites/developing/aem-project-archet...

Avatar

Employee Advisor

You can refer below command to create AEM project -

 

1. mvn -B archetype:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=26 -D appTitle="My Project" -D appId="myproject" -D groupId="com.myproject.aem" -D artifactId="myproject-aem-project" -D version="0.0.1-SNAPSHOT" -D aemVersion="6.5.4" -D includeExamples=n

 

If you want to create AEM project from scratch then please use latest maven archetype as given here - https://github.com/adobe/aem-project-archetype

 

While selecting maven archetype version please make sure that you are following system requirements properly like the below one -

DEBAL_DAS_0-1656389737062.png

2. After successful creation of project , run the command -> mvn clean install to build the project.

3. After successful building the project , please add your development files like Java classes, Javascript, css etc.

4. Then again build your project using mvn clean install and deploy OSGi bundle on your AEM instance. This time I believe we won't be facing this issue.

 

This time if you do compare MANIFEST.MF file with the previous one , you will be seeing the difference.

Avatar

Level 4

Hi Debal,

now successfully able to deploy the bundle in aem 

so, i have made some sample java scope class and deployed package in aem 

but, getting below error while trying to authorize

and my sample java code 

import javax.servlet.http.HttpServletRequest;
import org.apache.jackrabbit.api.security.user.User;
import org.osgi.service.component.annotations.Component;
import com.adobe.granite.oauth.server.Scope;
import com.adobe.granite.oauth.server.ScopeWithPrivileges;
@Component(service=Scope.class)
public class SampleScopeAem implements ScopeWithPrivileges{
 
 private static final String DAM_RESOURCE_URI="/content/dam/digital";
 private static final String DAM_RESOURCE_READ_SCOPE_NAME="dam_read";
 
 public SampleScopeAem()
 {
  
 }
@Override
 public String getDescription(HttpServletRequest arg0) {
  return "Read DAM Assets";
 }
@Override
 public String getEndpoint() {
  return null;
 }
@Override
 public String getName() {
  return DAM_RESOURCE_READ_SCOPE_NAME;
 }
@Override
 public String getResourcePath(User user) {
  return DAM_RESOURCE_URI;
 }
@Override
 public String[] getPrivileges() {
   return new String[] {"jcr:read"};
 }
}

 

Avatar

Employee Advisor

I think within samescopeAem() you have written some business logic right? Without knowing that it will be difficult to say root cause and what are you trying achieve.

Avatar

Level 4

Hi Debal,

successfully deployed but with some error, could you please check

osgi.PNG 

Avatar

Employee Advisor

Hi @sriram_1 , 

It clearly says dependency issues. Your project specific mysite.core bundle has dependency on those Java packages [highlighted in red color].

Please let me know the AEM version with service package by click About Adobe Experience Manager as shown below -

 

DEBAL_DAS_0-1656405025429.png

DEBAL_DAS_1-1656405123464.png

 

Avatar

Employee Advisor

Please install the latest service pack , core components package then it will resolve this issue I believe.

Please tell me archetype version you have used.

Avatar

Level 4

mvn org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=36 -D appTitle="My Site" -D appId="mysite" -D groupId="com.mysite" -D artifactId="mysite" -D version="0.0.1-SNAPSHOT" -D aemVersion=6.5.13 -D frontendModule=none -D includeExamples=y -D includeDispatcherConfig=n -D includeErrorHandler=y

 

 

 

correct me if anything is missing or wrong

Avatar

Correct answer by
Employee Advisor

Here is system requirement for archetype 36 -

DEBAL_DAS_0-1656406562351.png

Please install AEM service pack 13 and latest core component package this will resolve the issue I believe.