OSGI bundle status grace period - osgi

I am trying to install two bundles on Karaf. For one of the bundle i am getting error and when I see the bundle:diag i got below message. It is the same thing compaining in logs also. Similar kind of bundle already deploy and it has the same dependencies. first one is working but the for second bundle i am getting below error. any thoughts?
opendaylight-user#root>bundle:diag
videoweb (421)
Status: GracePeriod
Blueprint
2/10/16 6:07 PM
Missing dependencies:
(objectClass=org.osgi.service.http.HttpService)
2016-02-10 23:54:07.113 GMT+00:00 [Blueprint Extender: 3] ERROR o.a.a.b.c.BlueprintContainerImpl - Unable to start blueprint container for bundle com.xyz.videosdn.tesweb due to unresolved dependencies [(objectClass=org.osgi.service.http.HttpService)]
java.util.concurrent.TimeoutException: null
at org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336) [org.apache.aries.blueprint.core:1.4.0]
at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48) [org.apache.aries.blueprint.core:1.4.0]

The error means that your bundle has a mandatory reference to a service with the interface org.osgi.service.http.HttpService.
So you need to install a bundle that provides this service. In karaf this service is normally provided by pax-web. It can be installed using:
feature:install http

Related

Deploy error message on WebLogic 10.3.6.0

After fresh install of web logic, deployment shows the error:
Message icon - Error Failed to load webapp: MyWebApp because of DeploymentException:
weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for "ServletContext#992422938[app:MyWebApp module:MyWebApp path:/MyWebApp spec-version:2.5]", defined in weblogic.xml [Extension-Name: jsf, Specification-Version: 2, exact-match: false]
Error Error: Unresolved Webapp Library references for "ServletContext#992422938[app:MyWebApp module:MyWebApp path:/MyWebApp
spec-version:2.5]", defined in weblogic.xml [Extension-Name: jsf, Specification-Version: 2, exact-match: false]
I have Cloud service weblogic, initially is installed
jsf(1.2,1.2.9.0) - [Name:jsf] [Specification Version:1.2] [Impl. Version: 1.2.9.0]
jstl(1.2,1.2.0.1) [jstl, 1.2, 1.2.0.1]
When I try to install jsf-2.0.war - Error is
An application with this name already exists. Please specify a different name.
After I changed the name to something - Error is
The deployment has not been installed.
Message icon - Error weblogic.management.ManagementException: [Deployer:149105]An attempt was made to deploy a library located at '/u01/data/domains/wls_domain/servers/wls_adminserver/upload/jsf-2.0.war' with name 'jsf(2.0,1.0.0.0_2-0-2)' that is different from the one specified in the manifest of the library: 'jsf'.
Your web application requires the JSF 2 shared library which is not deployed in your server. Deploy this library first and then your application.

JBoss Fuse: java.lang.IllegalStateException: Resource has no uri for installed bundle

I'm working on JBossFuse 6.2, have a CXF endpoint for which I needed to setup some special properties through httpj:engine-factory configuration block. Upon trying that I hited this issue
MapMetadataImpl not found by org.apache.cxf.cxf-rt-transports-http-jetty
The error was the following
> ERROR | pool-43-thread-1 | BlueprintContainerImpl | 14 -
> org.apache.aries.blueprint.core - 1.4.2 | Unable to start blueprint
> container for bundle test-ws java.lang.NoClassDefFoundError:
> org/apache/aries/blueprint/reflect/MapMetadataImpl at
> org.apache.cxf.transport.http_jetty.blueprint.JettyServerEngineFactoryParser.parseEngineConnector(JettyServerEngineFactoryParser.java:110)
> at
> org.apache.cxf.transport.http_jetty.blueprint.JettyServerEngineFactoryParser.parse(JettyServerEngineFactoryParser.java:83)
It appeared when trying to add the httpj block for CXF definition.
<httpj:engine-factory bus="cxf">
<httpj:engine port="${port}" host="${host}">
<httpj:threadingParameters minThreads="${minThreads}" maxThreads="${maxThreads}"/>
</httpj:engine>
</httpj:engine-factory>
I tried the solution provided, in the referred posts that is installing the osgi bundle for Blueprint Core Compatibility.
osgi:install mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0
However, after installing the bundle upon container start I get the following exception:
2016-06-22 11:01:13,279 | ERROR | 63859-1-thread-1 | DeploymentAgent | ?? | 83 - io.fabric8.fabric-agent - 1.2.0.redhat-133 | Unable to update agent
java.lang.IllegalStateException: Resource has no uri
at io.fabric8.agent.service.Deployer.getBundleInputStream(Deployer.java:1354)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]
at io.fabric8.agent.service.Deployer.deploy(Deployer.java:714)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]
at io.fabric8.agent.service.Agent.provision(Agent.java:348)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]
at io.fabric8.agent.service.Agent.provision(Agent.java:194)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]
at io.fabric8.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:642)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]
at io.fabric8.agent.DeploymentAgent$2.run(DeploymentAgent.java:256)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_80]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_80]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_80]
Has anybody ever applied the proposed solution in JbossFuse? I don't event understand that much why that exception is being fired.
Thanks in advanced!
I anybody falls into this, I got an answer from someone at Red Hat. The problem I was having is that I was on a Fabric environment, so I had to add the OSGi Blueprint Core Compatibility bundle to the Karaf profile in the Fabric. It can be done from the karaf console by running the following command
profile-edit --bundles mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0 karaf 1.x
Where 1.x is current fabric version in use.
If you are NOT on a fabric environment, then the solution posted above should work just as is.
Hope this helps!

Custom Spring roo addon fail

I have a custom spring roo addon for extjs, I put it into bundle directory and deleted cache directory but when I initiate the console by msdos I'm having the next messange just in the entrance:
ERROR: Bundle com.xxx.xxx.addons.extjs [7] Error starting file:/K:/Software/springsource32/springsource/spring-roo-1.2.2.RELEASE/bundle/com.xxx.xxx.addons.extjs-2.0.2.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle com.xxx.xxx.addons.extjs [7]: Unable to resolve 7.0:
missing requirement [7.0] package; (&(package=org.apache.commons.io)(version>=1.4.0)(!(version>=2.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.xxx.xxx.addons.extjs [7]: Unable to resolve 7.0: missing requirement [7.0] pack
age; (&(package=org.apache.commons.io)(version>=1.4.0)(!(version>=2.0.0)))
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3564)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1797)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)
at java.lang.Thread.run(Thread.java:722)
I don't know why this happend and don't know what to check, can anybody help me?

ServiceMix bundle status is "Active" even though bundle deployment fails

I have (intentionally created situation to test my CI setup) a bundle which does not have all dependencies configured correctly. When I deploy that the deployment fails with an exception as it should:
2014-02-07 09:17:15,738 | ERROR | rint Extender: 3 | BlueprintCamelContext | 103 - org.apache.camel.camel-blueprint - 2.10.7 | Error occurred during starting Camel: CamelContext(ura) due "org.xmlsoap.schemas.soap.envelope" doesnt contain ObjectFactory.class or jaxb.index
javax.xml.bind.JAXBException: "org.xmlsoap.schemas.soap.envelope" doesnt contain ObjectFactory.class or jaxb.index
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_11]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_11]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_11]
at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_11]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:143)[89:org.apache.servicemix.specs.jaxb-api-2.2:2.2.0]
at javax.xml.bind.ContextFinder.find(ContextFinder.java:310)[89:org.apache.servicemix.specs.jaxb-api-2.2:2.2.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:412)[89:org.apache.servicemix.specs.jaxb-api-2.2:2.2.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:375)[89:org.apache.servicemix.specs.jaxb-api-2.2:2.2.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:279)[89:org.apache.servicemix.specs.jaxb-api-2.2:2.2.0]
at org.apache.camel.dataformat.soap.SoapJaxbDataFormat.createContext(SoapJaxbDataFormat.java:303)[206:org.apache.camel.camel-soap:2.10.7]
at org.apache.camel.converter.jaxb.JaxbDataFormat.doStart(JaxbDataFormat.java:254)[187:org.apache.camel.camel-jaxb:2.10.7]
at org.apache.camel.dataformat.soap.SoapJaxbDataFormat.doStart(SoapJaxbDataFormat.java:101)[206:org.apache.camel.camel-soap:2.10.7]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[100:org.apache.camel.camel-core:2.10.7]
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)
The problem is that the bundle status is still "Active". Why?
karaf#root> osgi:list
START LEVEL 100 , List Threshold: 50
ID State Blueprint Spring Level Name
[ 242] [Active ] [Created ] [ ] [ 80] integraatiot-foo (1.0.0.SNAPSHOT)
I would like to setup my CI builds to that they detect failed bundles using http://code.citytechinc.com/osgi-bundle-status-maven-plugin/. This idea fails since bundle status is always "Active".
The bundle is active because it has been activated. This is normal. If an error occurred in some code within the bundle, that is nothing to do with the OSGi active state.
So you need to work out some way to report your internal failure such that it can be picked up by a CI build. I suggest using the OSGi LogService.
You'll need to make sure all your dependencies are required and with the correct version.
In this case it might be that the package your importing does existing in the wrong version.
Or better did you make sure you only import the right version of the package with [2,3.0) for example. Especially the stack trace makes it suspicious to me that your using import without version range and therefore do import the JRE jaxb classes which usually do have version 0.0.0
To check which bundles are actually used for import log in the shell and do a bundle:header [bundleID]

ESB Build issue from source code

I have downloaded platform source code and trying to build ESB 4.6.0 "by running mvn clean install inside "carbon/platform/tags/4.0.7/patch-releases/4.0.6/"
I am getting following error message -
Installation failed.
Cannot complete the install because one or more required items could not be foun
d.
Software being installed: WSO2 Carbon - Axis2 Transport HTTP Pass-through Featu
re 1.0.2 (org.wso2.carbon.transports.passthru.feature.group 1.0.2)
Missing requirement: WSO2 Carbon - Axis2 Transport HTTP Pass-through Feature 1.
0.2 (org.wso2.carbon.transports.passthru.feature.group 1.0.2) requires 'org.wso2
.carbon.core.server.feature.group [4.1.0,4.2.0)' but it could not be found
Application failed, log file location: C:\Users\user.m2\repository\org\eclipse\
tycho\tycho-p2-runtime\0.13.0\eclipse\configuration\1368415821993.log
Can you comment out following two code segments in pom.xml[1] and continue build using "mvn clean install -Dmaven.test.skip=true -Dproduct=esb" inside "carbon/platform/tags/4.0.7/patch-releases/4.0.6/" . this passthru feature is already included in synapse code. so you can remove it.
#line 178
<featureArtifactDef>org.wso2.carbon:org.wso2.carbon.transports.passthru.feature:${passthru.transport.patch.version}</featureArtifactDef>
#line 512
<feature>
<id>org.wso2.carbon.transports.passthru.feature.group</id>
<version>${passthru.transport.patch.version}</version>
</feature>
[1] https://svn.wso2.org/repos/wso2/carbon/platform/tags/4.0.7/products/esb/4.6.0/modules/p2-profile/pom.xml

Resources