Expand my Community achievements bar.

Install jar bundle to publisher instance.

Avatar

Level 2

I generate project from maven archetype, when run the command mvn clean install -P autoInstallPackage there are 2 package in the package manager, which are foo.ui-apps and foo.ui-content. In the ui-apps there are apps/foo/install/ that contain jar file. But when I replicate that 2 package to the publisher, the bundle jar file not installed, but exists in the apps/foo/install folder.

Any idea how the correct way to do that?

I tried to manually install the bundle via /system/console/bundles, upload jar file from the app/foo/install/XYZ.jar, but got error 500 java.io.IOException: Bundle-SymbolicName header missing, cannot install bundle.

13 Replies

Avatar

Level 2

I've check that thread before.

I've never install the jar before and when icheck in the osgi component or the bundle list, there is not foo package installed, and I can't use the java bundle in my component.

Avatar

Employee Advisor

Hi,

if you get this message, the bundle lacks the necessary metadata to be an actual bundle. When you have uploaded the package via maven, can you check if the bundle is installed at all?

Jörg

Avatar

Level 2

Hi Jorg,

I install the bundle in the author via mvn clean install -P autoInstallPackage and I use autoInstallBundle if I change the java class. In the author it worked well, but when I replicated to the publisher all is there (including app/training/install/XYZ.jar). But when I use it in the component, it showed error "Cannot find a a file corresponding to class id.jeffersonsetiawan.aem.core.models.MyModel in the repository.".

I assumed the it not work because the bundle is not exists. So I tried to upload it manual via console, but get the "

error 500 java.io.IOException: Bundle-SymbolicName header missing, cannot install bundle."

What do you mean by lacks of metadata, Is it different to install the bundle from publisher?

Avatar

Community Advisor

Chek This java.io.IOException: Bundle-SymbolicName header missing, cannot install bundle - while installing b...  .

     Also, as far as I know if anything works fine in author should work proper in publish too. Can you share a sample code ? May be we can try to replicate the issue ?

Thanks

Veena

Avatar

Level 2

It just a code from the sample MyModel.java class

```

package id.jeffersonsetiawan.aem.core.models;

import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.settings.SlingSettingsService;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;

/**
* Created by jeffersonsetiawan on 7/5/17.
*/
@Model(adaptables=Resource.class)

public class MyModel {

   @Inject
   private SlingSettingsService settings;

   @Inject @Named("sling:resourceType") @Default(values="No resourceType")

   protected String resourceType;

   @Inject @Named("title") @Default(values="No Title")

   protected String javaTitle;

   @Inject @Default(values="First Name")

   protected String firstName;

   @Inject @Named("lastName") @Default(values="No name defined")

   protected String name;

  private String message;

   @PostConstruct

   protected void init() {

  message = "";
   message += "\tThis is instance: " + settings.getSlingId() + "\n";
   message += "\tResource type is: " + resourceType + "\n";
   }

   public String getMessage() {

   return message;
   }

   public String getJavaTitle() {

   return javaTitle;
   }

   public String message() {

   return firstName + " " + name;
   }

}```

I run mvn clean install -P autoInstallPackage, and everytime and change the java code, I use mvn clean install -P autoInstallBundle.

In author server, it works fine, when I replicate the package manager (apps and the content), I got the error.

Avatar

Employee Advisor

Hi,

the fact, that you can deploy a bundle on one AEM installation, but it fails on the other (the same binary apparently) shows, that your second AEM instance is somehow stragen. Are you sure that you get the exception on publish from the same bundle?

Jörg

Avatar

Level 10

If community members can get this working - issue looks like its with your Pub instance.

Avatar

Community Advisor

Hi Jefferson

          The issue should not be with your code. It has to do something with the way the maven project or the bundle is created. If you can share a sample project with the issue still replicable , it would really help

Avatar

Community Advisor

Hi Jeff

  

    I downloaded the package , built it using mvn clean install -P autoInstallPackage and replicated the same to publish. I can see the bundles installed and active in publish . Do you think there is any issue with your publish ? Do you want to try it in a new publish server ?

1287914_pastedImage_0.png

Avatar

Level 2

I have reinstall the publish server, and still facing the same problem.

Maybe my steps to replicate is wrong?

This is my step that I used:

mvn clean install -P autoInstallPackage (it install the package to the author server).

In http://localhost:4502/crx/packmgr/index.jsp I replicate the ui.apps first, then ui.content.

Am I miss something?

Avatar

Community Advisor

I will try this once again in a fresh instance later today. I will let you know .