Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evinwilkins/osgi dev #35

Merged
merged 13 commits into from
May 3, 2017
Merged

Evinwilkins/osgi dev #35

merged 13 commits into from
May 3, 2017

Conversation

evinwilkins
Copy link

This one required some extensive revisions and I will need more I suspect (if not now, in the future). Please review carefully as a result. I believe I had more questions but my original list did not make it after I created the PR. I'll start with the following:

Should "the" be before OSGi Container when reference in sentences?

Should "Shell" be included in GoGo Shell? Is it a brand?

I am not sure how to reword this without possibly changing the functionality. Any suggestions? - To add a new bundle into OSGi container, you must include it in server.bndrun (also add it to server-debug.bndrun ) in that part

This really probably needs to be reworded yet again, I'm not certain how to do so without possibly changing the functionality - Note: if you will use some class i. e. com.fasterxml.jackson.annotation.JsonIgnore; , which is from bundle injected into OSGi container and forget to import com.fasterxml.jackson.annotation , annotation @JsonIgnore won't work in runtime and you will get an error on an endpoint where you have to use @JsonIgnore . Please take a look at VersionUtil.java

This one required (and probably still requires) extensive revision. Please go over it carefully to ensure I have not changed functionality. I listed some questions below although I feel more work is required (within a future revision if not now):

Is it okay to put "the" before OSGi Container?

I tried with this one but am honestly not sure how to reword without knowing OSGi Container. Thoughts? - To add a new bundle into OSGi container, you must include it in `server.bndrun`(also add it to `server-debug.bndrun`) in that part:

Are Repos and Run labeled in the UI here? Wondering if they should be capitalized and/or bolded - Note: It is very helpful to use Eclipse BND tools to import bundles into `server.bndrun`. Simply drag and drop from Repos to Run bundles.

Is "Run OSGi" in the UI? I'm just wondering if Run should be capitalized and/or bolded - 

## OSGi GoGo Shell

To run OSC with GoGo Shell, open in Eclipse `server-debug.bndrun` and Run OSGi.

I am completely unsure as to how to change this verbiage without possibly changing the functionality - Note: if you will use some class i. e. `com.fasterxml.jackson.annotation.JsonIgnore;`, which is from bundle injected into OSGi container and forget to import `com.fasterxml.jackson.annotation`,  annotation `@JsonIgnore` won't work in runtime and you will get an error on an endpoint where you have to use `@JsonIgnore`.
@hai1337
Copy link
Contributor

hai1337 commented Apr 27, 2017

To answer some of your questions..

I would use "the" when referring to an OSGi container. A container is a general software term and there is no specific product, "OSGi Container" so I would not capitalize container and would use "the" or "an" depending on the context.

"GoGo" is a product and a "shell" (textual UI for commands) is another general software term. Gogo has a shell. I am seeing other documents use "Gogo shell".

Hope this helps! I will try to answer your other two questions in line since they are a little tricky...

@@ -1,26 +1,26 @@
# OSC And OSGi Development Guide

In this article you can find information how is [OSGi](https://en.wikipedia.org/wiki/OSGi) integrated into project, and how to avoid and handle some typical OSGi troubles related to development.
This article provides information on how [OSGi](https://en.wikipedia.org/wiki/OSGi) is integrated into a project, along with how to avoid and handle some typical OSGi troubles related to development.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... integrated into the OSC project, along ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is integrated into a project -> is integrated into the OSC projects : reason - there is more than one OSC project

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- `osc-uber` - contains `osc-common`, `osc-server` and dependencies from`pom.xml` not injected directly into OSGi container
- `osc-domain` - data access object module
- `osc-uber-jcloud` - contains all dependencies to integrate with Openstack
- `osc-uber` - contains `osc-common`, `osc-server` and dependencies from`pom.xml` not injected directly into OSGi container.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... , and dependencies from the POM file not injected into the OSGi container.
pom.xml is a single file so not sure if it should be like this. I would replace pom.xml with "the POM file"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

- `osc-uber-jcloud` - contains all dependencies to integrate with Openstack
- `osc-uber` - contains `osc-common`, `osc-server` and dependencies from`pom.xml` not injected directly into OSGi container.
- `osc-domain` - data access object module.
- `osc-uber-jcloud` - contains all dependencies to integrate with Openstack.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Openstack -> OpenStack

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done




## OSGi Container

OSGi container is a place, where all OSGi compatible jars(aka bundle) should be placed. In `osc-export` you can find few important files:
OSGi container is a place where all OSGi compatible jars (aka bundle) should be placed. In `osc-export` you can find few important files:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> The OSGi container is a place where all OSGi compatible JAR files, or bundles, should be placed. In the osc-export module, you will find some important files:
@emanoelxavier is there only one OSGi container? or multiple? In the case of multiple, use "OSGi containers are a ..."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmthomax I have implemented your new sentence.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmthomax in this context it is one.

- `server.bnd`- included into server*.bndrun files, defines run environment, requirements, properties etc.
- `server.bndrun`- contains all bundles that are fundamental part of our application
- `server-debug.bndrun`- contains bundles from `server.bndrun` and bundles to run OSGi [GoGo Shell](http://enroute.osgi.org/appnotes/gogo.html)
- `server.bnd`- included into server. bndrun files, defines run environment, requirements, properties etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

included in server.bndrun and defines the run environment, requirements, properties etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


#### Missing Non-Runtime Requirements

In some situation, we would like to include some library but it's dependency force us to include also some other lib to our Uber bundle. In this situation we can exclude packages that requires other libs.
In some situations, you may want to include some library however, its dependency may force the inclusion of some other lib to your Uber bundle. You can exclude packages that requires other libs in this situation as shown below:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib -> library
.. to the osc-uber bundle.
libs -> libraries in the situation shown below:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


1. Go to `osc-uber\bnd.bnd` and remove line `!org.apache.commons.beanutils,\`. Recompile and Run OSGi with GoGo Shell.
1. Navigate to `osc-uber\bnd.bnd` and remove line `!org.apache.commons.beanutils,\`. Recompile and Run OSGi with GoGo Shell.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.. remove the line...
Run OSGi

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


*Notice: excluding some packages is very helpful way to avoid big size of our bundle. We should always know what libs and packages we need inside our bundle.*
>Note: It is helpful to exclude some packages to avoid a very large bundle. You should always be aware as to which libs and packages need be inside your bundle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libs -> libraries

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done




## OSC-Control

Inside `osc-core` you can find project named `osc-control` . This is just standalone jar application that run/stop/reset server and do few more things. However, in this paragraph we will discuss only the way it is build with BND Tools.
You will find the project `osc-control`inside `osc-core`. This is a standalone jar application that runs, stops, resets, etc. the server. This section will cover the only the way it is built with BND Tools.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jar -> JAR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

>Note: Remember to ensure that `osc-control\bnd.bnd` is included if external lib from pom is added. Remember to also add a class from a package that is not included within the conditional package.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... if an external library from the POM file is added.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@evinwilkins
Copy link
Author

evinwilkins commented Apr 28, 2017 via email

@evinwilkins
Copy link
Author

evinwilkins commented Apr 28, 2017 via email

@evinwilkins
Copy link
Author

Changes are made and committed. Thank you!

- `server.bnd`- included into server*.bndrun files, defines run environment, requirements, properties etc.
- `server.bndrun`- contains all bundles that are fundamental part of our application
- `server-debug.bndrun`- contains bundles from `server.bndrun` and bundles to run OSGi [GoGo Shell](http://enroute.osgi.org/appnotes/gogo.html)
- included in `server.bndrun` and defines the run environment, requirements, properties etc.
Copy link
Contributor

@emanoelxavier emanoelxavier Apr 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line should be:

  • server.bnd - included in server*.bndrun and defines the run environment, requirements, properties etc.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -69,7 +69,7 @@ To add new bundle into OSGi container you have to include it in `server.bndrun`(
org.glassfish.jersey.ext.jersey-entity-filtering;version='[2.25.0,2.25.1)',\
org.hibernate.validator;version='[5.1.3,5.1.4)',\
com.fasterxml.classmate;version='[1.3.0,1.3.1)',\
com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider;version='[2.8.5,2.8.6)',\
com.fasterxml.vackson.jaxrs.jackson-jaxrs-json-provider;version='[2.8.5,2.8.6)',\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vackson -> jackson

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


Let us take a look at `osc-uber\bnd.bnd` . It is bundle that contains it's own java classes but also classes from dependencies selected to `bnd.bnd` from `pom.xml`.
`osc-uber\bnd.bnd` is a bundle that contains not only its own Java classes, but also those from dependencies selected to `bnd.bnd` from `pom.xml`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can improve this a bit more... To add dependencies in the OSC uber bundle you will need to modify the file osc-uber\bnd.bdn. This file contains not only...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with new suggested text on LN 134

@@ -156,7 +156,7 @@ then we are able to include resources like below:

#### Excluding packages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excluding Packages

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -156,7 +156,7 @@ then we are able to include resources like below:

#### Excluding packages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also observe other headings for proper capitalization

@@ -303,25 +301,24 @@ Let us take a look at example below:


*Notice: to know exactly what dependency should be added to OSGi Container while adding some new one, you need to look at dependency network of that bundle and provide all that are require. In Eclipse open `pom.xml` and go to Dependency Hierarchy tab:*
>Note: To know the dependency that should be added to OSGi Container while adding a new one, you need to look at the dependency network of the specific bundle, and provide all that are required. In Eclipse, open `pom.xml` and navigate to the **Dependency Hierarchy** tab:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open the pom.xml

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


#### BND.BND In OSC-Control

Basically, this is build as a bundle and includes dependencies that are necessary to work without problems in runtime. Let us take a llok at `bnd.bnd` file:
Basically, this is built as a bundle and includes dependencies that are necessary to work without problems in runtime. Below is an example of the `bnd.bnd` file:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in runtime -> at runtime

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


1. It contains line that help us to work with `pom.xml` as a repository:
1. It contains line that helps us to work with `pom.xml` as a repository:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to It contains the following line, allowing us to work with... :

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


```java
-include target/depend.bnd
```

2. We have conditional package section, that imports packages only from libs that are inside `pomx.ml`:
2. We have an conditional package section that imports packages only from libs that are inside `pomx.ml`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an -> a

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inside pom.xml -> inside the pom.xml

>Note: Remember to ensure that `osc-control\bnd.bnd` is included if an external library from the POM file is added. Remember to also add a class from a package that is not included within the conditional package.
Copy link
Contributor

@emanoelxavier emanoelxavier Apr 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be this Remember to ensure that any external library added in the POM file should also be included in the osc-control\bnd.bnd. Remember to also add a class from a package that is not included within the conditional package.

@ghost ghost self-assigned this May 2, 2017
@@ -211,25 +211,23 @@ import-extra:\
com.fasterxml.jackson.core
```

*Notice: if you will use some class i. e. `com.fasterxml.jackson.annotation.JsonIgnore;`, which is from bundle injected into OSGi container and forget to import `com.fasterxml.jackson.annotation`, annotation `@JsonIgnore` won't work in runtime and you will get an error on an endpoint where you have to use `@JsonIgnore`. Please take a look at [VersionUtil.java](https://github.com/opensecuritycontroller/osc-core/blob/master/osc-common/src/main/java/org/osc/core/util/VersionUtil.java#L100)*
>Note: If you you are using a class from a bundle in the OSGi container and forget to import its package you will get an error at runtime. For instance, if you use com.fasterxml.jackson.annotation.JsonIgnore; and do not import com.fasterxml.jackson.annotation, the annotation @JsonIgnore will not work. Please take a look at [VersionUtil.java](https://github.com/opensecuritycontroller/osc-core/blob/master/osc-common/src/main/java/org/osc/core/util/VersionUtil.java#L100)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you you -> you

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

com.fasterxml.jackson.annotation.JsonIgnore -> com.fasterxml.jackson.annotation.JsonIgnore
com.fasterxml.jackson.annotation -> com.fasterxml.jackson.annotation
@JsonIgnore -> @JsonIgnore

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorporated changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HopkinRx these are not yet addressed:
com.fasterxml.jackson.annotation.JsonIgnore -> com.fasterxml.jackson.annotation.JsonIgnore
com.fasterxml.jackson.annotation -> com.fasterxml.jackson.annotation
@JsonIgnore -> @JsonIgnore


Let us take a look at example below:
1. Remove all bundles from `server-debug.bndrun` with the groupID `com.fasterxml.jackson.jaxrs` groupID.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the repeated groupId in the end of the line. Also for the first groupID -> groupId. So basically this line should be:

  1. Remove all bundles from server-debug.bndrun with the groupId com.fasterxml.jackson.jaxrs.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


1. It contains line that help us to work with `pom.xml` as a repository:
1. It contains line the following line. allowing us to work with `pom.xml` as a repository:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line the following line -> the following line

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also remove the period in the middle of the sentence

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


```java
-include target/depend.bnd
```

2. We have conditional package section, that imports packages only from libs that are inside `pomx.ml`:
2. We have aa conditional package section that imports packages only from libs that are inside the `pomx.ml`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aa -> an

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libs -> libraries
pomx.ml -> pom.xml

(i'm being lenient on the file extension formatting in this doc since it is on community and not osc.org just make sure it is conistent, there are some POM and some pom.xml)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

>Note: Remember to ensure that any external library added in the POM file should also be included in the osc-control\bnd.bnd. Remember to also add a class from a package that is not included within the conditional package.
Copy link
Contributor

@emanoelxavier emanoelxavier May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

osc-control\bnd.bnd -> osc-control\bnd.bnd

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -1,26 +1,26 @@
# OSC And OSGi Development Guide

In this article you can find information how is [OSGi](https://en.wikipedia.org/wiki/OSGi) integrated into project, and how to avoid and handle some typical OSGi troubles related to development.
This article provides information on how [OSGi](https://en.wikipedia.org/wiki/OSGi) is integrated into a projects, along with how to avoid and handle some typical OSGi troubles related to development.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> ... is integrated into OSC projects, .....

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously corrected

- `osc-uber` - contains `osc-common`, `osc-server` and dependencies from`pom.xml` not injected directly into OSGi container
- `osc-domain` - data access object module
- `osc-uber-jcloud` - contains all dependencies to integrate with Openstack
- `osc-uber` - contains `osc-common`, `osc-server` and dependencies from the POM file not injected directly into the OSGi container.
Copy link
Contributor

@hai1337 hai1337 May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

osc-common, osc-server, and dependencies

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


To read more about bundle lifecycle go to [link](http://eclipsesource.com/blogs/2013/01/23/how-to-track-lifecycle-changes-of-osgi-bundles/).
View the [OSGi bundle lifecycle](http://eclipsesource.com/blogs/2013/01/23/how-to-track-lifecycle-changes-of-osgi-bundles/) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra space after View

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed


First of all, if we want to include resources based on `pom.xml` to our bundle we need to have that line in our `bnd.bnd` file:
If you want to include resources based on `pom.xml` to your bundle, you must first include that line in your `bnd.bnd` file:
Copy link
Contributor

@hai1337 hai1337 May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you must first include the following line in your bnd.bnd file:

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously done

@@ -173,7 +173,7 @@ exclude-tomcat:\
...
```

In above fragment from `bnd.bnd` file we exclude `!javax.servlet.jsp` and `!javax.servlet.jsp.tagext`, however if you go to class `com.mcafee.vmidc.server.Server` you can notice that we use other packages from `javax.servlet`, i. e. :
In the fragment from the `bnd.bnd` file, the `!javax.servlet.jsp` and `!javax.servlet.jsp.tagext` were excluded however, if you look at the `com.mcafee.vmidc.server.Server` class, you will notice that packages from `javax.servlet` are used:
Copy link
Contributor

@hai1337 hai1337 May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to com.mcafee.vmidc.server.Server org.osc.core.server
On line 179, change to package org.osc.core.server;

@emanoelxavier can you verify this

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done made both corrections on LN 176 and LN 179


![](../images/bnd-osgi-dependency-hierarchy.png)

#### Missing Requirements in the OSC Uber Bundle

Non OSGi dependencies being added to the OSC uber bundle may also have missing requirements. This situation gives us same log as that one before, but our intend is different. We want to include resource inside `osc-uber` bundle.
Non-OSGi dependencies added to the OSC uber bundle may also have missing requirements. This situation provides the same log as the previous one, but with a different intent. You must include the resource inside the `osc-uber` bundle as shown below:
Copy link
Contributor

@hai1337 hai1337 May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.... to the osc-uber bundle may .....

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


1. Remove ` @${yavijava.dep},\` from `osc-uber\bnd.bnd` and then recompile and Run OSGi with GoGo Shell.
1. Remove ` @${yavijava.dep},\` from `osc-uber\bnd.bnd` and then recompile and Run OSGi with GoGo shell.
Copy link
Contributor

@hai1337 hai1337 May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space after ` in @${yavijava.dep},\

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


2. Look at console log:
2. The console log should appear as:

```java
! Failed to start bundle osc-uber-1.0.0, exception Unable to resolve osc-uber [15](R 15.0): missing requirement [osc-uber [15](R 15.0)] osgi.wiring.package; (osgi.wiring.package=com.vmware.vim25) Unresolved requirements: [[osc-uber [15](R 15.0)] osgi.wiring.package; (osgi.wiring.package=com.vmware.vim25)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emanoelxavier should we not use this vmware example?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we should replace that, @HopkinRx please replace as:
yavijava.dep -> xxx.dep (line 313)
com.vmware.vim25 -> xxx (on both places)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmthomax I have opened issue #40 to have addressed with appropriate values later.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated per Emanuel's' email "yes we should replace that, @HopkinRx please replace as:
yavijava.dep -> xxx.dep (line 313)
com.vmware.vim25 -> xxx (on both places)"


1. It contains line that help us to work with `pom.xml` as a repository:
1. It contains line the following line. allowing us to work with `pom.xml` as a repository:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also remove the period in the middle of the sentence


```java
-include target/depend.bnd
```

2. We have conditional package section, that imports packages only from libs that are inside `pomx.ml`:
2. We have aa conditional package section that imports packages only from libs that are inside the `pomx.ml`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libs -> libraries
pomx.ml -> pom.xml

(i'm being lenient on the file extension formatting in this doc since it is on community and not osc.org just make sure it is conistent, there are some POM and some pom.xml)

@ghost
Copy link

ghost commented May 2, 2017

Done


2. Look at console log:
2. The console log should appear as:

```java
! Failed to start bundle osc-uber-1.0.0, exception Unable to resolve osc-uber [15](R 15.0): missing requirement [osc-uber [15](R 15.0)] osgi.wiring.package; (osgi.wiring.package=com.vmware.vim25) Unresolved requirements: [[osc-uber [15](R 15.0)] osgi.wiring.package; (osgi.wiring.package=com.vmware.vim25)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we should replace that, @HopkinRx please replace as:
yavijava.dep -> xxx.dep (line 313)
com.vmware.vim25 -> xxx (on both places)


```java
-include target/depend.bnd
```

2. We have aa conditional package section that imports packages only from libs that are inside the `pomx.ml`:
2. We have an conditional package section that imports packages only from libraries that are inside the `pom.xml`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an -> a

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -434,4 +434,4 @@ Basically, this is built as a bundle and includes dependencies that are necessar

This set is a minimal requirement to work properly in runtime.

>Note: Remember to ensure that any external library added in the POM file should also be included in the osc-control\bnd.bnd. Remember to also add a class from a package that is not included within the conditional package.
>Note: Remember to ensure that any external library added in the POM file should also be included in the `osc-control\bnd.bnd`. Remember to also add a class from a package that is not included within the conditional package.
Copy link
Contributor

@hai1337 hai1337 May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure the term POM/pom.xml is consistent. I think this is the only instance of "POM" so I would change this to pom.xml like the rest of the doc

Copy link
Contributor

@hai1337 hai1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more! 😀

@@ -173,7 +173,7 @@ exclude-tomcat:\
...
```

In the fragment from the `bnd.bnd` file, the `!javax.servlet.jsp` and `!javax.servlet.jsp.tagext` were excluded however, if you look at the `com.mcafee.vmidc.server.Server` `org.osc.core.server` class, you will notice that packages from `javax.servlet` are used:
In the fragment from the `bnd.bnd` file, the `!javax.servlet.jsp` and `!javax.servlet.jsp.tagext` were excluded however, if you look at the `com.mcafee.vmidc.server.Server org.osc.core.server` class, you will notice that packages from `javax.servlet` are used:
Copy link
Contributor

@hai1337 hai1337 May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove com.mcafee.vmidc.server.Server
... look at the org.osc.core.server class, ....

Copy link
Contributor

@emanoelxavier emanoelxavier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HopkinRx two remaining comments from me. Those were previous comments that were missed. After this I should be able to approve.


Let us take a look at example below:
1. Remove all bundles from server-debug.bndrun with the groupId com.fasterxml.jackson.jaxrs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HopkinRx please bring back the format:
server-debug.bndrun -> server-debug.bndrun
and
com.fasterxml.jackson.jaxrs -> com.fasterxml.jackson.jaxrs

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -211,25 +211,23 @@ import-extra:\
com.fasterxml.jackson.core
```

*Notice: if you will use some class i. e. `com.fasterxml.jackson.annotation.JsonIgnore;`, which is from bundle injected into OSGi container and forget to import `com.fasterxml.jackson.annotation`, annotation `@JsonIgnore` won't work in runtime and you will get an error on an endpoint where you have to use `@JsonIgnore`. Please take a look at [VersionUtil.java](https://github.com/opensecuritycontroller/osc-core/blob/master/osc-common/src/main/java/org/osc/core/util/VersionUtil.java#L100)*
>Note: If you are using a class from a bundle in the OSGi container and forget to import its package you will get an error at runtime. For instance, if you use com.fasterxml.jackson.annotation.JsonIgnore; and do not import com.fasterxml.jackson.annotation, the annotation @JsonIgnore will not work. Please take a look at [VersionUtil.java](https://github.com/opensecuritycontroller/osc-core/blob/master/osc-common/src/main/java/org/osc/core/util/VersionUtil.java#L100)
Copy link
Contributor

@emanoelxavier emanoelxavier May 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from a previous comment that has not been addressed:
com.fasterxml.jackson.annotation.JsonIgnore -> com.fasterxml.jackson.annotation.JsonIgnore
com.fasterxml.jackson.annotation -> com.fasterxml.jackson.annotation
@JsonIgnore -> @JsonIgnore

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that done.

@ghost
Copy link

ghost commented May 3, 2017 via email

@emanoelxavier emanoelxavier merged commit 6c867b2 into master May 3, 2017
@emanoelxavier emanoelxavier unassigned ghost May 5, 2017
@emanoelxavier emanoelxavier deleted the evinwilkins/osgi-dev branch June 13, 2017 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants