ServiceMix 7.x : feature installs/starts but bundle dependency never starts - classloader

ServiceMix 7.0.1
Windows 7; Java 1.8.x
commons-io/commons-io/2.4/commons-io-2.4.jar (note: the jar is a bundle; does not need to be wrapped)
<features name="smx7-test" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<feature name="smx7-test" version="1.0.0-SNAPSHOT">
<bundle dependency="true" start="true">mvn:commons-io/commons-io/2.4</bundle>
</feature>
Something different in ServiceMix 7.x (7.0.1) that I am missing or I need to configure a standard feature or other?
The commons-io jar/bundle dependency in the features.xml (above) never starts after the feature is installed/started. This is not isolated to just the commons-io jar/bundle. I have the same issue with the antlr-runtime-4.7.jar and commons-beanutils.jar among others. I have just setup a small sample test-case to quickly deploy and test using commons-io.
I start with a pristine servicemix 7.0.1 install.
I place the features.xml file (above) in the system repo: system/smx7/smx7-test/1.0.0-SNAPSHOT/smx7-test-1.0.0-SNAPSHOT-features.xml
I place the commons-io-2.4 jar in the system repo: system/commons-io/commons-io/2.4/commons-io-2.4.jar
Start servicemix 7.0.1 (servicemix.bat). All good so-far.
The feature installs fine with the following commands:
feature:repo-add mvn:smx7/smx7-test/1.0.0-SNAPSHOT/xml/features
feature:install smx7-test
I can do a feature:list | grep smx7-test and the feature shows as installed and started.
karaf#root>feature:list | grep smx7-test
smx7-test | 1.0.0.SNAPSHOT | x | Started | smx7-test
BUT a bundle:list in the karaf console indicates the common-io bundle is not in the listing. If i duplicate all above in servicemix 6.x all works as expected. That is the commons-io bundle is listed and started.
If i try to deploy a business layer bundle in the 7.0.1 instance above, that wants to import a commons-io package/class the business layer bundle will never start (shows only as installed). The error in the servicemix.log is as expected since the commons-io bundle never started :
missing requirement [test [222](R 222.2)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.commons.io)(version>=1.4.0)(!(version>=2.0.0)))
Note: the commons-io-2.4 jar/bundle MANIFEST.MF Export-Package contents is/are backwards compatible hence the version parameters in the error above. I tried modifying my business layer bundle MANIFEST.MF to allow for the range indicated above and it had no impact.
Any ServiceMix 7 suggestions welcome!!

Related

Failed startup of context o.e.j.w.WebAppContext error after upgrade jetty version to 9.4.44

Current jetty version is 9.4.6, I tried to upgrade 9.4.44, I got the error. Could you please help me?
WebAppContext:554 -Failed startup of context o.e.j.w.WebAppContext#163f1cd{passwd-change,/passwd-change,file:///run/opt/corp/gsec/7.0.0/java-service/gsec-jetty-base/temp/jetty-gsec-2443-passwd-change.war-_passwd-change-any-6326268666909012254.dir/webapp/,UNAVAILABLE}{/passwd-change.war}
Caused by: java.lang.IllegalAccessError: tried to access method org.eclipse.jetty.server.handler.ContextHandler$StaticContext.createInstance(Ljava/lang/Class;)Ljava/lang/Object; from class jetty.webapp.StandardDescriptorProcessor
at org.eclipse.jetty.webapp.StandardDescriptorProcessor.newListenerInstance(StandardDescriptorProcessor.java:1945) ~[apacheds-service-2.0.0-M24.jar:2.0.0-M24]
at org.eclipse.jetty.webapp.StandardDescriptorProcessor.visitListener(StandardDescriptorProcessor.java:1900) ~[apacheds-service-2.0.0-M24.jar:2.0.0-M24]
The jetty files in your apacheds-service-2.0.0-M24.jar needs to be upgraded as well.
List the contents of the apacheds-service-2.0.0-M24.jar file and you'll see classes in the org.eclipse.jetty. namespace.
Those are conflicting with your efforts to upgrade Jetty via the jetty-distribution zip.
I had a different setup that triggered a similar stacktrace: using cargo-maven2-plugin 16.1 in a spring 5 project, mvn cargo:run would fail because of a conflict with javafx.base-11.0.0-SNAPSHOT.jar files.
Upgrading to cargo-maven3-plugin 1.9.9 fixed the matter.
I'd encourage who ever uses cargo-maven2-plugin to migrate to cargo-maven3-plugin as the doc states:
Please be aware that the Maven 2 / Maven 3 plugin of Codehaus Cargo has been retired with our version 1.9.0 and has been superseded by a Maven 3 only plugin.

Getting error while building project "com.bea.util.jam.internal.javadoc.JavadocClassloadingException:"

I am getting error while trying to build a java project in TeamCity. The same project builds and excecutes well on my local. I recently pushed changes to this project on GitLab. This is my first time working with GitLab and TeamCity together. Other projects have no issues during build. I am unable to understand what is causing this error:
[15:58:54][Step 1/1] compile.earCommons (4s)
[15:58:54][compile.earCommons] echo
[15:58:54][compile.earCommons] echo
[15:58:54][compile.earCommons] wlcompile (4s)
[15:58:59][wlcompile]
com.bea.util.jam.internal.javadoc.JavadocClassloadingException: An error
has occurred while invoking javadoc to inspect your source
files. This may be due to the fact that $JAVA_HOME/lib/tools.jar does
not seem to be in your system classloader. One common case in which
this happens is when using the 'ant' tool, which uses a special
context classloader to load classes from tools.jar.
This situation elicits what is believed to a javadoc bug in the initial
release of JDK 1.6. Javadoc attempts to use its own context classloader
tools.jar but ignores one that may have already been set, which leads
to some classes being loaded into two different classloaders. The
telltale sign of this problem is a javadoc error message saying that
'languageVersion() must return LanguageVersion - you might see this
message in your process' output.
This will hopefully be fixed in a later release of JDK 1.6; if a new
version of 1.6 has become available, you might be able to solve this
by simply upgrading to the latest JDK.
Alternatively, you can work around it by simply including
$JAVA_HOME/lib/tools.jar in the java -classpath
parameter. If you are running ant, you will need to modify the standard
ant script to include tools.jar in the -classpath.
[15:58:59][Step 1/1] Process exited with code 1
[15:58:59][Step 1/1] Ant output
[15:59:10][Step 1/1] Process exited with code 1 (Step: Ant)
[15:58:59][Step 1/1] Step Ant failed
****Update****
Build Step: Ant
Step 1:
Runner type: Ant (Runner for Ant build.xml files)
Execute: If all previous steps finished successfully
build.xml file: \ant\build.xml
Working directory: same as checkout directory
Targets: none specified
Ant home path: C:\apache-ant-1.7.0
Additional Ant command line parameters: -lib c:\WebLogic\12.1.2\wlserver\server\lib\javaee.jar;c:\WebLogic\12.1.2\wlserver\server\lib\weblogic.jar;c:\WebLogic\12.1.2\wlserver\server\lib\webservices.jar
JDK home path: c:\Program Files\Java\jdk1.7.0_80
JVM command line parameters: not specified
Reduce test failure feedback time: OFF
Java code coverage: disabled
Docker Settings
Docker Image: unset
I'll appreciate any help in this regard.
I found there was character encoding issue with one of the files that prevented compiler from loading the java classes. Once that was fixed, the build worked fine.

Pabot - Unable to run parallel robotframework tests

So, I'm working on a robotframework test project, and the goal is to run several test suites in parallel. For this purpose, pabot was chosen as the solution. I am trying to implement it, but with little success.
My issue is: after installing Pabot (which, I might say, I did by cloning the project and running "setup.py install", instead of using pip, since the corporate proxy I'm behind has proven an obstacle I can't overcome), I created a new directory in the project tree, moved some suites there, and ran:
pabot --processes 2 --outputdir pabot_results Login*.robot
Doing so results in the following error message:
2018-10-10 10:27:30.449000 [PID:9676] [0] EXECUTING Suites.LoginAdmin
2018-10-10 10:27:30.449000 PID:400 EXECUTING Suites.LoginUser
2018-10-10 10:27:30.777000 PID:400 FAILED Suites.LoginUser
2018-10-10 10:27:30.777000 [PID:9676] [0] FAILED Suites.LoginAdmin
WARN: No output files in "pabot_results\pabot_results"
Output:
[ ERROR ] Reading XML source '' failed: invalid mode ('rb') or filename
Try --help for usage information.
Elapsed time: 0 minutes 0.578 seconds
Upon inspecting the stderr file that was generated, I have this message:
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\robotframework-3.1a2.dev1-py2.7.egg\robot\running\runner.py", line 22, in
from .context import EXECUTION_CONTEXTS
ValueError: Attempted relative import in non-package
Apparently, this has to do with something from the runner.py script, which, if I'm not mistaken, came with the installation of robotframework. Since manually modifying that script does not seem to me the optimal solution, my question is, what am I missing here? Did I forget to do anything while setting this up? Or is this an issue of compatibility between versions?
This project is using Maven as the tool to manage dependencies. The version I am running is 3.5.4. I am using a Windows 10, 64bit system; I have Python 2.7.14, and Robot Framework 3.1a2.dev1. The Pabot version is 0.44. Obviously, I added C:\Python27 and C:\Python27\Scripts to the PATH environment variable.
Edit: I am also using robotframework-maven-plugin version 1.4.0.8, if that happens to be relevant.
Edit 2: added the error messages in text format.
I believe I've come across an issue similar when setting up parallel execution on my machine. Firstly I would confirm that pabot is installed using pip show robotframework-pabot.
Then you should define the directory your results are going to using -d.
I then modified the name of the -o to Output.xml to make it easy to identify.
This is a copy of the code I use. Runs optimally with 8 processes
pabot --processes 8 -d results -o Output.xml Tests
Seems that you stumbled on a bug in the prerelease version of robot framework (3.1a2.dev1).
Please install a release version of robot framework. For example 3.0.4.
Just in case anyone happens to stumble upon this issue in the future:
Since I can't use pip, and I tried a good deal of workarounds that eventually made things more unstable, I ended up saving my project and removing everything Python-related from my system, so as to allow me to install everything from scratch. In a Windows 10, 64bit system, I used:
Python 2.7.14
wxPython 2.8.12.1, win64, unicode, for py27
setuptools 40.2.0 (to allow me to use the easy_install command)
Robot Framework 3.0.4
robotremoteserver 1.1
Selenium2Library 3.0.0
and Pabot version 0.45.
I might add that, when installing the Selenium2Library the way I described above, it eventually tries to download some things from the pip repositories - which, if you have a proxy, will cause you trouble. I solved this problem by browsing https://pypi.org/simple/selenium/, manually downloading the 2.53.6 .tar.gz file, then extracting it and running setup.py install on the command line.
PS: Ideally, though, anyone should be able to use proxy settings from the command line (--proxy http://user:password#server:port) to get pip and then use it; however, for some reason, probably related to network security configurations that I didn't want to lose time with, this didn't work in my case.

Can't start test server on physical device

I installed calabash on a new machine, but tests that I ran on my old machine will not run.
As far as I can tell, both machines are set up the same way. They pull the project from the same repository, which includes a Gemfile with calabash-cucumber version 0.18.0. I set the same BUNDLE_ID, DEVICE_ENDPOINT, and DEVICE_TARGET values and use the same physical device.
When I try to run the tests in the console on the new machine, I get this:
$ bundle exec calabash-ios console
Running irb...
irb(main):001:0> start_test_server_in_background
ArgumentError: Could not find a device with a UDID or name matching 'com.my.apps.bundle.id'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/run_loop-2.1.1/lib/run_loop/device.rb:126:in `device_with_identifier'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/run_loop-2.1.1/lib/run_loop/device.rb:160:in `detect_device'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/run_loop-2.1.1/lib/run_loop/core.rb:71:in `run_with_options'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/run_loop-2.1.1/lib/run_loop.rb:134:in `run'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/launcher.rb:718:in `block in new_run_loop'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/launcher.rb:716:in `times'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/launcher.rb:716:in `new_run_loop'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/launcher.rb:584:in `relaunch'
from /Users/rjones/gambit/gemstubs/ruby/2.1.0/gems/calabash-cucumber-0.18.0/lib/calabash-cucumber/core.rb:943:in `start_test_server_in_background'
from (irb):1
from /Users/rjones/.rbenv/versions/2.1.5/bin/irb:11:in `<main>'
Any ideas why this isn't working?
Please update to 0.19.0.
Can you also paste the exact command you are using to start the
irb(main):001:0> start_test_server_in_background
ArgumentError: Could not find a device with a UDID or name matching
'com.my.apps.bundle.id'
It looks like you set your DEVICE_TARGET to the bundle id? If not, then you have found a bug. It is possible that 0.18.0 is not compatible with run-loop 2.1.1. Downgrade to run_loop 2.0.9 if you want to verify that this is the problem.
I experienced the same issue, when updating cucumber gem from version 1.3.19 to version 2.3.3. I also run tests on physical devices
edit: Sorry, forgot to mention, that I updated run_loop too from version 2.0.6 to 2.1.3
So the versions:
run_loop (2.1.3)
calabash-cucumber (0.18.1)
I guess these are the two that could affect this part, and cucumber was not involved
I found a solution, by setting the variable DEVICE instead of DEVICE_TARGET
For example:
BUNDLE_ID=<bundle_id> DEVICE=<dev_udid> DEVICE_ENDPOINT=<dev_ip> cucumber
Instead of
BUNDLE_ID=<bundle_id> DEVICE_TARGET=<dev_udid> DEVICE_ENDPOINT=<dev_ip> cucumber

'foundation-apps' is not recognized as an internal or external command, operable program or batch file

I did
npm install -g foundation-cli bower gulp
got
/|
| | /| .
. /\| \/ |/|
|\/ | Thanks for installing Foundation for Apps
||\__/\____/|| ------------------------------------------
Then, I did
gem install bundler
and got
Successfully installed bundler-1.10.5
but when I tried
foundation-apps new myApp
I got
'foundation-apps' is not recognized as an internal or external command,
operable program or batch file.
working on windows 7, behind proxy
I have it working in Windows 10 but I believe it is the same.
When I check the npm folder: C:\Users\(YourName)\AppData\Roaming\npm
The command name is foundation instead of foundation-apps
So you should type: foundation new
If you're using fedora-22 and potentially other OSes Siu Pang Tommy Choi's answer is also applicable; that is, replace foundation-apps new NAME with the foundation new NAME.
This is the first time I've encountered this problem, so perhaps there has been a change within the last few versions that has deprecated the foundation-apps command (or else you should consider this a work-around). Just make sure that you correctly specify that you want an 'app' and not a 'site' when prompted.
foundation studios install instructions on the url https://foundation.zurb.com/apps/docs/#!/installation
tells this
"You now have access to the foundation-apps command on your system! You'll use this to set up and update new projects"
Siu Pang Tommy Choi gave the best answer because foundation command worked instead of foundation-apps
still confusing because i am following instructions from the above url.
Are you sure there is no foundation-apps command?