Kura deployment package fails with 'bundle already present in other packages' - osgi

I am trying to run a Kura sample from the basic kura tutorial named: (Level 3) Kura Configuration Example
I got the sources, builded it with the 'Java OSGi Bundle for Eclipse Kura'. It generated a .dpp file. I used 'Quick build' to generate a .dp file.
Everything seems to work fine until I am trying to deploy it to a Kura session installed on a RPi.
On the RPi, Kura is up and running.
I tried to install the .dp but it yields the err('bundle already present in other package'):
Error
Mon Feb 05 17:40:37 EET 2018
Failed to install deployment package:
org.osgi.service.deploymentadmin.DeploymentException: Bundle
'com.bitreactive.blocks.osgi.runtime/2.6.1 already present in other
deployment packages!
org.tigris.mtoolkit.iagent.IAgentException: Failed to install
deployment package: org.osgi.service.deploymentadmin.DeploymentException: Bundle 'com.bitreactive.blocks.osgi.runtime/2.6.1 already present in other deployment packages!
at org.tigris.mtoolkit.iagent.internal.DeploymentManagerImpl.installDeploymentPackage(DeploymentManagerImpl.java:172)
at org.tigris.mtoolkit.osgimanagement.dp.logic.InstallDeploymentOperation.doOperation(InstallDeploymentOperation.java:98)
at org.tigris.mtoolkit.osgimanagement.dp.logic.RemoteDeploymentOperation.run(RemoteDeploymentOperation.java:49)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Related

Sonarqube Error

Sonarqube error in VSTS Build when version 4 of sonar extension is used.
Error -
[SQ] API GET. '/api/server/version' failed, error was:
{"code":"UNABLE_TO_GET_ISSUER_CERT_LOCALLY"} .
SonarQube extension version 3 build runs successfully.
We are using Sonarqube version 7.1
I also faced same error:
[error][SQ] API GET '/api/server/version' failed, error was: {"code":"UNABLE_TO_GET_ISSUER_CERT_LOCALLY"
To fix this issue:
First I installed Java 17 to devOps build agent machine https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html
Java SE Development Kit 17.0.5 Windows x64 Installer.
Installed path: C:\Program Files\Java\jdk-17.0.5
Then add two devOps build pipeline variables:
NODE_EXTRA_CA_CERTS and SONAR_SCANNER_OPTS
SONAR_SCANNER_OPTS:
Copy your cacerts and replace existing one.
path: “…\Java\jdk 17.0.5\lib\security\cacerts”
Then add both paths in devOps SONAR_SCANNER_OPTS variable:
-Djavax.net.ssl.trustStore="C:\program files\Java\jdk 17.0.5\lib\security\cacerts"
-Djavax.net.ssl.keyStore="C:\program files\Java\jdk 17.0.5\lib\security\cacerts"
NODE_EXTRA_CA_CERTS:
copy your cert *.PEM file and replace it the existing one in devops build agent path: C:\devOps_Agent\sonarchain.pem
After this step SonarQube prepare starting to work.

Unable to start tomcat7 in ubuntu

I installed tomcat7 but when I tried to start it. It fails to start.
previously I'd installed tomcat7 and it was working fine, But when I tried to add tomcat7 server in netbeans it gave me error of some Catalina home or something. I looked for that solution and applied. Then after adding the tomcat7 server to the netbeans, it won't start. Later I install glassfish server. It also got failed. So again I uninstalled the tomcat7 and tried again to start it. But now it is not getting started.
Creating config file /etc/logrotate.d/tomcat7 with new version
* Starting Tomcat servlet engine tomcat7 [fail]
invoke-rc.d: initscript tomcat7, action "start" failed.
Setting up tomcat7-admin (7.0.52-1ubuntu0.3) ...
Setting up tomcat7-docs (7.0.52-1ubuntu0.3) ...
Setting up tomcat7-examples (7.0.52-1ubuntu0.3) ...
Processing triggers for ureadahead (0.100.0-16) ...
Try this!
Step 1:
When Install tomcat 7 on Ubuntu 14.04
$ sudo apt-get install tomcat7
Step 2
If You find an error post installation which could look something similar to the code below:
Creating config file /etc/logrotate.d/tomcat7 with new version
* no JDK or JRE found - please set JAVA_HOME
invoke-rc.d: initscript tomcat7, action "start" failed.
Setting up authbind (2.1.1) ...
Processing triggers for ureadahead (0.100.0-16) ...
To rectify the above please do the following:
$ sudo mkdir -p /home/data/backup_scripts
$ cp /etc/init.d/tomcat7 /home/data/backup_scripts/
$ sudo vim /etc/init.d/tomcat7
After you open the file i.e tomcat7, please find the following line
JDK_DIRS="/usr/lib/jvm/default-java ${OPENJDKS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle"
Change the above line by appending the following to it:
/usr/lib/jvm/java-8-oracle
Thus the line would now become:
JDK_DIRS="/usr/lib/jvm/default-java ${OPENJDKS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle /usr/lib/jvm/java-8-oracle"
Save the file and start the tomcat server. This time it should happen at ease:
$ sudo service tomcat7 start
Hope it works!!!

Deploy vaadin 7 war file in EC2

I'm trying to deploy a Vaadin 7 example.war file in tomcat 7, using an EC2 server. I upload the file to /var/lib/tomcat7/webapps but then when I go to myIp:8080/example it doesn't find the resource.
Any idea why?
Thanks!
You have to use the tomcat manager (usually http://[YourHost]:8080/manager) to add a new webapp / war file, it is not just uploading the file to the webapps folder.
To install tomcat, the manager webapp, and configuring access credentials (debian or debian based distros), check this tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-apache-tomcat-on-a-debian-server
Solved!...
To install the manager:
sudo yum install tomcat7-webapps tomcat7-docs-webapp tomcat7-admin-webapps
To solve the Java Version mismatch, org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/prueba2]]:
On Eclipse:
Preferences >> Java >> Installed JREs
On EC2 server:
sudo yum remove java-1.7.0-openjdk
sudo yum install java-1.8.0
Then reinstall Tomcat7 and restart
Thanks #BlunT for all the help!!

Installing hawtio 1.4.27 on JBoss Fuse 6.0 giving error

I am trying to install the latest hawtio 1.4.27 version on JBoss Fuse 6.0, but it seems that it gives error while doing so.
Since this is server machine I have created an offline repository and added the below entries in the pom file for the offline repository
<descriptor>mvn:io.hawt/hawtio-karaf/1.4.27/xml/features</descriptor>
and
<feature>hawtio</feature>
After that I executed these commands in fuse console
features:addurl mvn:io.hawt/hawtio-karaf/1.4.27/xml/features
features:install hawtio
While installing it gives following error:
Error executing command: Could not start bundle mvn:io.hawt/hawtio-karaf-terminal/1.4.27/war in feature(s) hawtio-karaf-terminal-1.4.27: Uses constraint violation. Unable to resolve bundle revision io.hawt.hawtio-karaf-terminal [238.0] because it is exposed to package 'jline' from bundle revisions jline [239.0] and org.apache.karaf.shell.console [15.0] via two dependency chains.
Chain 1:
io.hawt.hawtio-karaf-terminal [238.0]
import: (&(osgi.wiring.package=jline)(version>=2.11.0)(!(version>=3.0.0)))
|
export: osgi.wiring.package=jline
jline [239.0]
Chain 2:
io.hawt.hawtio-karaf-terminal [238.0]
import: (&(osgi.wiring.package=org.apache.karaf.shell.console.jline)(version>=2.2.0)(!(version>=4.0.0)))
|
export: osgi.wiring.package=org.apache.karaf.shell.console.jline; uses:=jline
export: osgi.wiring.package=jline
org.apache.karaf.shell.console [15.0]
What I am missing? Please help.
Note: I tried installing hawtio 1.4.1 on JBoss Fuse 6.0 and it installs fine and runs successfully
I was running the wrong command.
As it was mention in hawtio site, if you are on ServiceMix 4.5 then you should install hawtio-core instead of hawtio
Following command to be executed.
features:addurl mvn:io.hawt/hawtio-karaf/1.4.27/xml/features
features:install hawtio-core
Here's a link to hawtio site. Under "Using Fuse, Fabric8, Apache Karaf or Apache Servicemix" section NOTE is provided.

Jenkins tomcat7 deploying error

I have a jenkins job named 'SampleMavenDeploy1' which copies artifacts(war file,pom.xml) from upstream project('SampleMavenBuild1') successfully to this project.
I have following configuration for this project:
"
Build Steps:
Copy artifacts from another project
Project Name:SampleMavenBuild1
Post-build Actions:
War/Ear files:MavenWebAppV14/target/*.war
Context Path:webapps
Containers:
Tomcat7.x
Manager username:tomcat
Manager Password:tomcat
Tomcat Url:http://localhost:8080/manager/text
"
The build of SampleMavenBuild1(make war file of a maven project) has succeeded. In workspace of this job (SampleMavenDeploy1), there is war file (MavenWebAppV14/target/MavenWebAppV14.war). I have also configured tomcat-users.xml to add user of username 'tomcat' , password 'tomcat' and roles as 'manager-gui' and 'manager-script' .
I am facing following errors in a jenkins build of a job. This job is designed for deploying war file on tomcat7 via CI server. I have also 'deploy to tomcat' plugin installed in jenkins.
Started by user vikas
Building in workspace C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace
Copied 2 artifacts from "SampleMavenBuild1" build number 4
Deploying C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace\MavenWebAppV14\target\MavenWebAppV14.war to container Tomcat 7.x Remote
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace\MavenWebAppV14\target\MavenWebAppV14.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:189)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:918)
at hudson.FilePath.act(FilePath.java:896)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1770)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unknown command /manager/text/list
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
... 16 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unknown command /manager/text/list
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:918)
at hudson.FilePath.act(FilePath.java:896)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1770)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Finished: FAILURE
Anyone who can figure out is most welcomed .
Thanks in advance!!!
You need to give permissions to the text-manager to be able to deploy.
Just go to tomcat-users.xml and add this:
<user username="tomcat" password="password" roles="manager-script"/>
Or just give the manager-script permission to your existing tomcat-manager user
You need to set the base URL to localhost:8080/ in the deploy URL, not the manager URL which is localhost:8080/manager/text (which is what happened in my case).
I have the same problem as you. But I had the tomcat users refresh like the first answer of this question and the problem still persists on Jenkins.
When I tried to connect to tomcat admin zone using my navigator, tomcat didn't display the page to me, because the tomcat-admin package was not installed. So I've installed the tomcat7-admin package and restarted tomcat :
sudo apt-get install tomcat7-admin
sudo service tomcat7 restart
Then the problem was fixed. It was because Jenkins couldn't connect with the program. So easy!
All you have to do is add the users and and assign the manager-gui (for GUI access) and manager-script (for access like Jenkins deployment ). Also, make sure to edit the file /webapps/manager/META-INF/context.xml, either to comment out valve or define appropriate reg ex for allow attribute
If it shows a connection error or fails to load when you deploy jenkins.war file on tomcat, then follow the steps below.
Paste the jenkins folder inside tomcat/webapps.
Restart the tomcat (localhost or ip:8080/jenkins)
Jenkins will load and may asks for password.
To get the jenkins admin password then run
{cat /opt/tomcat/.jenkins/secrets/initialAdminPassword}
If the permission is denied to access the password then
sudo chmod 0777 /opt/tomcat/.jenkins/secrets/initialAdminPassword
or else run ls -a there you will see .jenkins folder.

Resources