I have already searched for solution online but none of them has actually worked. I am moving from JBossFuse 6.2.1. to JbossFuse 6.3.0. This includes upgrading dependencies which I have managed, most of them. Right now I am stuck with this error:
Error executing command: Error starting bundles:
Unable to start bundle 390: Unresolved constraint in bundle pipeline-reception-ws-external-cxf [390]: Unable to resolve 390.0: missing requirement [390.0] osgi.wiring.package; (osgi.wiring.package=org.eclipse.jetty.http.ssl)
I am using maven-bundle-plugin which is configured this way:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Import-Package>
org.apache.camel.*;version="[${camel.range.start},${camel.range.end})",
ms.common.wsdl,template.velocity,org.eclipse.jetty.server,*
</Import-Package>
<Export-Package>
eu.unicorn.basse.ms.pipeline.reception.route.ws.external.cxf.*
</Export-Package>
<_removeheaders>Import-Service</_removeheaders>
</instructions>
</configuration>
</plugin>
I am not sure why this does not work if it works on older JbossFuse environment. Question is, how to solve this issue.
This error indicates that your environment does not contain a bundle which exports the package org.eclipse.jetty.http.ssl. As there is no version information in your package import it indicates that you also don't have a suitably bundled version of it in your bundle's build path (if you did then the maven-bundle-plugin would have found a version and added it to your import).
Either this requirement on org.eclipse.jetty.http.ssl is new to your bundle, or it was previously supplied by another bundle in Fuse 6.2.1 which is no longer present in Fuse 6.3.0.
In any event you need to start by fixing your bundle, either by putting the relevant parts of Jetty on the build path so that you get a version range on your import, or by removing the new dependency which has leaked into your bundle. Then, if needed, you can simply deploy the other bundles that your bundle requires.
Related
I am upgrading AEM 6.5.1 (Service pack 1) to AEM 6.5.10 (Service pack 10). For this I installed SP10 in AEM as well updated the uber-jar version to 6.5.10 in my source code POM.xml file.
I see that in the OSGI console, my bundle is in Installed and not Active state. This is because certain dependencies (which before the update were not present) are missing. I have been able to get those dependencies, except one.
com.microsoft.schemas.office.powerpoint -- Cannot be resolved
I am unable to find any JARs online that fixes this issue. I tried Apache POI but no success. Does anyone know what this dependency is and where I can get it?
Thanks!
If you are not using it at all, you can exclude it.
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<!-- Import any version of javax.inject, to allow running on multiple versions of AEM -->
<Import-Package>
javax.inject;version=0.0.0,
!sun.misc;resolution=optional,!javax.persistence,!com.sun.jdi.*,
!com.microsoft.schemas.office.powerpoint,*
</Import-Packages>
I am trying to install a latest version of my apache camel application using feature:install on Karaf
this new version has a dependency of org.apache.commons.configuration ver 1.9
but getting the below error
error:
Error executing command: Could not start bundle mvn: in feature(s)<package> : Unresolved constraint in bundle <bundle> [414]: Unable to resolve 414.0: missing requirement [414.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.commons.configuration)(version>=1.9.0)(!(version>=2.0.0)))
I had included it in the pom.xml
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.9</version>
</dependency>
also have tried several ways suggested in sof but none is working
have also put the for org.apache.commons.configuration under the plugins
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
org.apache.cxf.service.model,
org.apache.cxf.message,
org.apache.commons.configuration,
*
</Import-Package>
</instructions>
</configuration>
</plugin>
But still not able to resolve. Could anyone please help resolve this?
thanks
You need to ensure that the jar is installed in Karaf.
In order to do this you need to wrap the jar as a bundle:
osgi:install wrap:mvn:commons-configuration/commons-configuration/1.9
After you've done this make sure to remove the addition you made to Import-Package as it's not needed.
If you want the dependency to be installed along with your application's feature just add the following element to your feature:
<bundle>wrap:mvn:commons-configuration/commons-configuration/1.9</bundle>
Do you really want to import it from another deployed bundle or should it be a simple embedded dependency?
Since you list it under Import-Package, you expect the first. For that to work you need to have another bundle deployed in the container that exports org.apache.commons.configuration.
If you want to embedded it as simple dependency in the same bundle, you have to exclude it from Import-Package with ! as prefix and probably use Embed-Dependency instruction like the example in this answer: https://stackoverflow.com/a/30532447/8035582
I wrote a custom event adaptor and I have placed the jar in dropping folder, but the CLI does not show custom logging nor does it appear within the output adaptor.
I have read the 4.1.0 guide without success and tried to read the source code of:
http://dist.wso2.org/maven2/org/wso2/carbon/org.wso2.carbon.event.input.adaptor.email/1.0.1/
Perhaps the bundle which you put into dropins has not being activated.
To check whether it's active, you can start the WSO2 CEP server on OSGI console mode as follows:
Go to <CEP_HOME>/bin and execute command (assuming you're using Linux):
./wso2server.sh -DosgiConsole
After the server has started, you will see the OSGI prompt.
osgi>
Then run type ss <bundle_name>
For example:
ss org.wso2.carbon.event.output.adapter.custom.websocket
sample output:
id State Bundle
285 RESOLVED org.wso2.carbon.event.output.adapter.custom.websocket_5.0.12.SNAPSHOT
Note that you do not need to specify the complete bundle name with version and all but specifying a part of the name would be sufficient.
It will show you whether the bundle is ACTIVE or not.
If it's not in ACTIVE state, you can diagnose your bundle using its ID. E.g.
diag 285
This will show you the list of missing imported packages.
You can refer to [1] and [2] to learn about OSGI console commands.
Then make sure to expose those using your bundle pom file.
For example, refer to following portion of a pom file. It has exposed certain packages using the Export-Package element.
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>
org.wso2.carbon.event.output.adapter.websocket.local.internal,
org.wso2.carbon.event.output.adapter.websocket.local.internal.*
</Private-Package>
<Export-Package>
!org.wso2.carbon.event.output.adapter.websocket.local.internal,
!org.wso2.carbon.event.output.adapter.websocket.local.internal.*,
org.wso2.carbon.event.output.adapter.websocket.local.*,
</Export-Package>
<Import-Package>
org.wso2.carbon.event.output.adapter.core.*,
javax.xml.namespace; version=0.0.0,
*;resolution:=optional,
</Import-Package>
<DynamicImport-Package>*</DynamicImport-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
[3] might have some useful info too.
References
[1] http://movingaheadblog.blogspot.com/2014/01/how-to-debug-wso2-carbon-products-using.html
[2] https://isurues.wordpress.com/2009/01/01/useful-equinox-osgi-commands
[3] http://wso2.com/library/articles/getting-started-wso2-carbon/
I'm having an issue with an OSGi bundle project as follows:
I have classes that require the use of JDOM. I currently have the project working fine when I deploy JDOM as a separate bundle. That bundle exports the following packages:
org.jdom,version=1.0.0
org.jdom.adapters,version=1.0.0
org.jdom.filter,version=1.0.0
org.jdom.input,version=1.0.0
org.jdom.output,version=1.0.0
org.jdom.transform,version=1.0.0
org.jdom.xpath,version=1.0.0
Now I want to change the project such that I include JDOM as an Embed-dependency. To do that I add the dependency to my pom files and set the following in the maven-bundle-plugin configuration:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>com.qnx.aem.cloudsite-bundle</Bundle-SymbolicName>
<Embed-Transitive>true</Embed-Transitive>
<Embed-Dependency>jdom</Embed-Dependency>
</instructions>
</configuration>
</plugin>
After this when I look at our projects bundle manifest I see a bunch of new Import Packages requiring dependencies of the JDOM jar: jaxen, xerces, etc.
How on earth did the previously deployed OSGi bundle of JDOM resolve these same dependencies? They were never listed in the bundles Import Packages? Furthermore if I try to include these as dependencies of the project and embed them it just compounds the problem. Help!
The bundle that you use imports those packages with "resolution:=optional". Due to this reason, the original bundle could have been resolved without having the dependencies in the OSGi container.
I guess that When you embedded the dependency, maven-bundle-plugin analyzed the bytecode of the embedded dependency instead of the MANIFEST header. The packages are imported without the "resolution:=optional" directive. You can specify it again in the configuration of maven-bundle-plugin like this:
<Import-Package>
org.jaxen.*;resolution:=optional,
*
</Import-Package>
Question is: Why do you want to embed a jar that is already a working OSGi bundle? It is better to use it as it is.
Actually when i build my project it deploys the bundle to the running OSGI console. Now the bundle is in installed state and shows an red alert that commons-net bundle can not be find.
One way of solving this is problem is to install the bundle to the running osgi framework itself explicitly.
Another way could be adding Embeded-Dependency to the maven. But this approach is not working.
I added Embeded-Dependency to the instruction tag in maven-build-plugin. It didn't show any error.
Please let me know if any suggestions.
Embeded-Dependency did not show any error as you can place anything into the instructions. If the key-value pair is not known it will be simply inserted into the MANIFEST.MF as it is. Try writing Embed-Dependency, that should make it work.
A good example could be the following (how we created hibernate bundle for ourselves):
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<_exportcontents>
!org.hibernate.validator.*,
org.hibernate.*;-noimport:=true,
</_exportcontents>
<Import-Package>
javax.persistence*;version="1.1.0",
javax.naming*,
javax.sql,
javax.transaction*;version="1.1.0",
javax.xml.stream.*,
javax.xml.*,
org.slf4j,
org.w3c.dom,
org.xml.sax*,
antlr.*,
org.jboss.logging.*,
org.dom4j*,
*;resolution:=optional
</Import-Package>
<Embed-Dependency>
groupId=org.hibernate;artifactId=hibernate-core,
groupId=org.hibernate;artifactId=hibernate-entitymanager,
groupId=org.hibernate.common;artifactId=hibernate-commons-annotations
</Embed-Dependency>
</instructions>
</configuration>
</plugin>