osgi.wiring.package; (&(osgi.wiring.package=META-INF.cxf)(version>=2.6.0)(!(version>=3.0.0))) - cxf

I have generated this project with maven
mvn archetype:generate
-DarchetypeGroupId=org.apache.servicemix.tooling
-DarchetypeArtifactId=servicemix-cxf-code-first-osgi-bundle
-DarchetypeVersion=2012.01.0.redhat-60024
-DgroupId=org.fusesource.example
-DartifactId=cxf-basic
-Dversion=1.0-SNAPSHOT
created the boundle and trying to install and start it to Jboss Fuse I getting the Error
Error executing command: Error installing bundles:
Unable to start bundle mvn:org.fusesource.example/cxf-basic/1.0-SNAPSHOT: Unresolved constraint in bundle cxf-basic [363]: Unable to resolve 363.0: missing requirement [363.0] osgi.wiring.package; (&(osgi.wiring.package=META-INF.cxf)(version>=2.6.0)(!(version>=3.0.0)))
I have already tried to change the version of
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Import-Package>
javax.jws,
javax.wsdl,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.namespace,
javax.xml.ws,
org.apache.cxf.bus,
org.apache.cxf.bus.spring,
org.apache.cxf.bus.resource,
org.apache.cxf.configuration.spring,
org.apache.cxf.resource,
org.apache.cxf.jaxws,
org.apache.cxf.transport.http,
org.springframework.beans.factory.config
</Import-Package>
<Private-Package>
!org.fusesource.example.client,
org.fusesource.example,
org.fusesource.example.types
</Private-Package>
<Require-Bundle>org.apache.cxf.bundle</Require-Bundle>
<!--
<DynamicImport-Package>*</DynamicImport-Package>
-->
</instructions>
</configuration>
</plugin>
with a new one but when I do it the error change slightly in
Error executing command: Error installing bundles:
Unable to start bundle mvn:org.fusesource.example/cxf-basic/1.0-SNAPSHOT: Unresolved constraint in bundle cxf-basic [362]: Unable to resolve 362.0: missing requirement [362.0] osgi.wiring.package; (&(osgi.wiring.package=javax.jws)(version>=2.0.0)(!(version>=3.0.0)))
what am I doing wrong?

The package javax.jws is missing. You have to install the lib in your container with the good version (2.0.0).
If it is already the case, and you want to use the version provided, try this:
<Import-Package>
javax.jws;version="[1.0.0, 0)",
javax.wsdl,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.namespace,
javax.xml.ws,
org.apache.cxf.bus,
org.apache.cxf.bus.spring,
org.apache.cxf.bus.resource,
org.apache.cxf.configuration.spring,
org.apache.cxf.resource,
org.apache.cxf.jaxws,
org.apache.cxf.transport.http,
org.springframework.beans.factory.config
</Import-Package>

Related

How do I migrate "yarn run-script build" task from frontend-maven-plugin to gradle?

I use gradle-node-plugin instead of frontend-maven-plugin.
"yarn run-script build" task in maven is written such as following
<execution>
<id>yarn run-script build</id>
<goals>
<goal>yarn</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<arguments>build</arguments>
<environmentVariables>
<buildDir>${project.build.directory}/classes/static</buildDir>
</environmentVariables>
</configuration>
</execution>
In gradle, I wrote yarnScriptBuild task
task yarnScriptBuild(type: YarnTask, dependsOn: yarnTest) {
group 'Node'
args = ['run', 'build']
}
If I did "./gradlew yarnScriptBuild" command,
I got the error "Output path MUST not be project root directory!"
Then I inserted outputs.dir = ("$buildDir/classes") to yarnScriptBuild,but it didn't work.
(I found the page "$buildDir means {root directory}/build" few days ago)
I got another error "No such property: dir for class: org.gradle.api.internal.tasks.DefaultTaskOutputs"
Does this mean that "dir" property isn't exist?
How should I do? What is missing?
If information lacks, please let me know.
Thank you.
Try configuring the yarnWorkDir and nodeWorkDir in NodeExtension :
NodeExtension node = project.extensions.getByType(NodeExtension.class)
node.with {
nodeModulesDir = ${pathToDirWithNodeModulesDir}
yarnWorkDir = ${pathToYarnJs}
}
also, you might want to fix your outputs path to this:
outputs.dir = project.file("$buildDir/classes")
or this:
output.dir "$buildDir/classes"

getting error : java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector

I am getting following error stack while launching chrome browser through selenium. Chrome version is 65.
[AppClassLoader#18b4aac2] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Starting ChromeDriver 2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7) on port 40188
Only local connections are allowed.
org.testng.TestNGException:
Cannot instantiate class ipd.project.analytics.BarChart
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:31)
at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:410)
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:323)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:126)
at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:191)
at org.testng.TestClass.getInstances(TestClass.java:99)
at org.testng.TestClass.initTestClassesAndInstances(TestClass.java:85)
at org.testng.TestClass.init(TestClass.java:77)
at org.testng.TestClass.<init>(TestClass.java:42)
at org.testng.TestRunner.initMethods(TestRunner.java:423)
at org.testng.TestRunner.init(TestRunner.java:250)
at org.testng.TestRunner.init(TestRunner.java:220)
at org.testng.TestRunner.<init>(TestRunner.java:169)
newInstance(Constructor.java:423)
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:23)
... 25 more
Caused by: java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.toImmutableSet()Ljava/util/stream/Collector;
at org.openqa.selenium.remote.ProtocolHandshake.streamW3CProtocolParameters(ProtocolHandshake.java:284)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:149)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:184)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:148)
at ipd.Base.setupChromeDriver(Base.java:143)
at ipd.Base.<init>(Base.java:61)
at ipd.project.analytics.BarChart.<init>(BarChart.java:28)
... 30 more
Suppressed: java.io.IOException: Incomplete document
at com.google.gson.stream.JsonWriter.close(JsonWriter.java:559)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:167)
... 41 more
I tried adding following dependency in pom.xml but it did not help:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
Clean, build project also did not help.
Thanks !!

Angular Jasmine Tests Fail When Running In Linux - Unable to Locate PhantomJS Binary

Context:
I'm completely new to jasmine and only have a little bit of experience when working with AngularJS. I have some very basic Jasmine tests implemented simply to ensure that these can be ran fine before implementing the actual jasmine tests.
The project is ran using Maven.
The tests run throught he jasmine maven plugin.
The issues arise when trying to build the project within IBM's Bluemix Build & Deploy pipeline despite working locally.
Here are the tests:
Test 1 Runs fine Both Locally and in Cloud
describe('JavaScript addition operator', function () {
it('adds two numbers together', function () {
expect(1 + 2).toEqual(3);
});
});
Test 2 Runs fine Locally but fails in the Cloud
describe("App", function() {
beforeEach(module('mainjs'));
var ctrl, scope;
beforeEach(inject(function($controller, $rootScope) {
scope = $rootScope.$new();
ctrl = $controller("studentHome", {
$scope : scope
});
}));
it("testing", function() {
expect(1 + 2).toEqual(3);
})
});
The tests are ran using the Jasmine Maven Plugin
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<preloadSources>
<source>webjars/jquery.js</source>
<source>jasmine-jquery</source>
<source>webjars/angular.js</source>
<source>webjars/angular-mocks.js</source>
<source>webjars/angular-route.js</source>
</preloadSources>
<jsSrcDir>${project.basedir}/src/main/resources/static/js</jsSrcDir>
<jsTestSrcDir>${project.basedir}/src/test/resources/static/js</jsTestSrcDir>
<specIncludes>
<include>*Spec.js</include>
</specIncludes>
</configuration>
</plugin>
Here a multiple errors, possibly caused by eachother:
Unable to Install phantomjs
[INFO] Downloading: http://repo.maven.apache.org/maven2/com/github/klieber/phantomjs/2.0.0/phantomjs-2.0.0-linux-x86_64.tar.bz2
[DEBUG] Writing tracking file /home/pipeline/.m2/repository/com/github/klieber/phantomjs/2.0.0/phantomjs-2.0.0-linux-x86_64.tar.bz2.lastUpdated
[ERROR] Unable to locate phantomjs binary
com.github.klieber.phantomjs.install.InstallationException: Unable to install phantomjs.
at com.github.klieber.phantomjs.install.PhantomJsInstaller.install(PhantomJsInstaller.java:55)
at com.github.klieber.phantomjs.locate.ArchiveLocator.locate(ArchiveLocator.java:45)
at com.github.klieber.phantomjs.locate.CompositeLocator.locate(CompositeLocator.java:39)
at com.github.klieber.phantomjs.locate.PhantomJsLocator.locate(PhantomJsLocator.java:58)
at com.github.searls.jasmine.driver.WebDriverFactory.createPhantomJsWebDriver(WebDriverFactory.java:145)
at com.github.searls.jasmine.driver.WebDriverFactory.createWebDriver(WebDriverFactory.java:68)
at com.github.searls.jasmine.mojo.TestMojo.createDriver(TestMojo.java:264)
at com.github.searls.jasmine.mojo.TestMojo.executeSpecs(TestMojo.java:235)
at com.github.searls.jasmine.mojo.TestMojo.run(TestMojo.java:204)
at com.github.searls.jasmine.mojo.AbstractJasmineMojo.execute(AbstractJasmineMojo.java:385)
at com.github.searls.jasmine.mojo.TestMojo.execute(TestMojo.java:191)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:495)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: com.github.klieber.phantomjs.download.DownloadException: Unable to resolve artifact.
at com.github.klieber.phantomjs.download.RepositoryDownloader.download(RepositoryDownloader.java:64)
at com.github.klieber.phantomjs.install.PhantomJsInstaller.install(PhantomJsInstaller.java:52)
... 31 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.github.klieber:phantomjs:tar.bz2:linux-x86_64:2.0.0 in central (http://repo.maven.apache.org/maven2)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:295)
at com.github.klieber.phantomjs.download.RepositoryDownloader.download(RepositoryDownloader.java:58)
... 32 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.github.klieber:phantomjs:tar.bz2:linux-x86_64:2.0.0 in central (http://repo.maven.apache.org/maven2)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1012)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$6.wrap(WagonRepositoryConnector.java:1004)
at org.eclipse.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:725)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:785)
-
Failed to Instantiate Mode ng due to: TypeError: 'undefined' is not an object
J A S M I N E S P E C S
-------------------------------------------------------
[INFO]
JavaScript addition operator
adds two numbers together
App
testing <<< FAILURE!
* Error: [$injector:modulerr] Failed to instantiate module ng due to:
TypeError: 'undefined' is not an object (evaluating 'Function.prototype.bind.apply')
at instantiate (http://localhost:38192/webjars/angular.js:4640)
at provider (http://localhost:38192/webjars/angular.js:4454)
at http://localhost:38192/webjars/angular.js:365
at forEach (http://localhost:38192/webjars/angular.js:335)
at http://localhost:38192/webjars/angular.js:4444
at ngModule (http://localhost:38192/webjars/angular.js:2494)
at invoke (http://localhost:38192/webjars/angular.js:4625)
at runInvokeQueue (http://localhost:38192/webjars/angular.js:4518)
at http://localhost:38192/webjars/angular.js:4527
at forEach (http://localhost:38192/webjars/angular.js:321)
at loadModules (http://localhost:38192/webjars/angular.js:4550)
at createInjector (http://localhost:38192/webjars/angular.js:4430)
at workFn (http://localhost:38192/webjars/angular-mocks.js:2922)
at attemptSync (http://localhost:38192/webjars/jasmine/jasmine.js:1886)
at http://localhost:38192/webjars/jasmine/jasmine.js:1874
at http://localhost:38192/webjars/jasmine/jasmine.js:1859
at http://localhost:38192/webjars/jasmine/jasmine.js:697
at http://localhost:38192/webjars/jasmine/jasmine.js:363
at http://localhost:38192/webjars/jasmine/jasmine.js:2479
at attemptAsync (http://localhost:38192/webjars/jasmine/jasmine.js:1916)
at http://localhost:38192/webjars/jasmine/jasmine.js:1871
at http://localhost:38192/webjars/jasmine/jasmine.js:1859
at http://localhost:38192/webjars/jasmine/jasmine.js:697
at http://localhost:38192/webjars/jasmine/jasmine.js:2473
at attemptAsync (http://localhost:38192/webjars/jasmine/jasmine.js:1916)
at http://localhost:38192/webjars/jasmine/jasmine.js:1871
at http://localhost:38192/webjars/jasmine/jasmine.js:1898
at http://localhost:38192/webjars/jasmine/jasmine.js:1842
at http://localhost:38192/webjars/jasmine/jasmine.js:2467
at clearStack (http://localhost:38192/webjars/jasmine/jasmine.js:660)
at http://localhost:38192/webjars/jasmine/jasmine.js:1881
at http://localhost:38192/webjars/jasmine/jasmine.js:1898
at http://localhost:38192/webjars/jasmine/jasmine.js:1842
at complete (http://localhost:38192/webjars/jasmine/jasmine.js:371)
at clearStack (http://localhost:38192/webjars/jasmine/jasmine.js:660)
at http://localhost:38192/webjars/jasmine/jasmine.js:1881
at http://localhost:38192/webjars/jasmine/jasmine.js:1859
at http://localhost:38192/webjars/jasmine/jasmine.js:697
at http://localhost:38192/webjars/jasmine/jasmine.js:363
at http://localhost:38192/webjars/jasmine/jasmine.js:2479
at attemptAsync (http://localhost:38192/webjars/jasmine/jasmine.js:1916)
at http://localhost:38192/webjars/jasmine/jasmine.js:1871
at http://localhost:38192/webjars/jasmine/jasmine.js:1859
at http://localhost:38192/webjars/jasmine/jasmine.js:697
at http://localhost:38192/webjars/jasmine/jasmine.js:2473
at attemptAsync (http://localhost:38192/webjars/jasmine/jasmine.js:1916)
at http://localhost:38192/webjars/jasmine/jasmine.js:1871
at http://localhost:38192/webjars/jasmine/jasmine.js:1859
at http://localhost:38192/webjars/jasmine/jasmine.js:697
at http://localhost:38192/webjars/jasmine/jasmine.js:2332
at http://localhost:38192/webjars/jasmine/jasmine.js:761
at http://localhost:38192/webjars/jasmine/boot.js:141
http://errors.angularjs.org/1.5.3/$injector/modulerr?p0=ng&p1=TypeError%3A%20'undefined'%20is%20not%20an%20object%20(evaluating%20'Function.prototype.bind.apply')%0A%20%20%20%20at%20instantiate%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A4640)%0A%20%20%20%20at%20provider%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A4454)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A365%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A335)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A4444%0A%20%20%20%20at%20ngModule%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A2494)%0A%20%20%20%20at%20invoke%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A4625)%0A%20%20%20%20at%20runInvokeQueue%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A4518)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A4527%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A321)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A4550)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular.js%3A4430)%0A%20%20%20%20at%20workFn%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fangular-mocks.js%3A2922)%0A%20%20%20%20at%20attemptSync%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1886)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1874%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1859%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A697%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A363%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A2479%0A%20%20%20%20at%20attemptAsync%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1916)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1871%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1859%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A697%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A2473%0A%20%20%20%20at%20attemptAsync%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1916)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1871%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1898%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1842%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A2467%0A%20%20%20%20at%20clearStack%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A660)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1881%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1898%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1842%0A%20%20%20%20at%20complete%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A371)%0A%20%20%20%20at%20clearStack%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A660)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1881%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1859%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A697%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A363%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A2479%0A%20%20%20%20at%20attemptAsync%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1916)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1871%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1859%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A697%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A2473%0A%20%20%20%20at%20attemptAsync%20(http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1916)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1871%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A1859%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A697%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A2332%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fjasmine.js%3A761%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A38192%2Fwebjars%2Fjasmine%2Fboot.js%3A141 in http://localhost:38192/webjars/angular.js (line 4548)
-
Spec Failiures
Results: 2 specs, 1 failures, 0 pending
...
[ERROR] Failed to execute goal com.github.searls:jasmine-maven-plugin:2.1:test (default) on project StudyPlanner: There were Jasmine spec failures. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.searls:jasmine-maven-plugin:2.1:test (default) on project StudyPlanner: There were Jasmine spec failures.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:495)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There were Jasmine spec failures.
at com.github.searls.jasmine.mojo.TestMojo.throwAnySpecFailures(TestMojo.java:308)
at com.github.searls.jasmine.mojo.TestMojo.run(TestMojo.java:206)
at com.github.searls.jasmine.mojo.AbstractJasmineMojo.execute(AbstractJasmineMojo.java:385)
at com.github.searls.jasmine.mojo.TestMojo.execute(TestMojo.java:191)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
When running locally this works fine. I'm presuming the error is to do with initialising the controller, but I'm struggling to understand why this would suddenly become a problem when running not locally (considering we are using maven to manage dependencies and the preloaded sources are included within the plugin's config).
Also, the above error isn't giving me much information, any pointers on how to get extended logs or greater direction would be very helpful.
Update
It looks like the version (2.0.0) of PhantomJS may be the problem, but I am not sure where the version to be downloaded is defined. Is this default considering the jasmine plugin version?
https://github.com/klieber/phantomjs-maven-plugin/issues/35
Not sure if this is a fix or a workaround, but I added in the phantomhjs-maven-plugin to force retrieval of version 2.1.1 of phantomjs for use by jasmine. Here are the two plugins together.
<plugin>
<groupId>com.github.klieber</groupId>
<artifactId>phantomjs-maven-plugin</artifactId>
<version>0.7</version>
<executions>
<execution>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
<configuration>
<version>2.1.1</version>
</configuration>
</plugin>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<preloadSources>
<source>webjars/jquery.js</source>
<source>jasmine-jquery</source>
<source>webjars/angular.js</source>
<source>webjars/angular-mocks.js</source>
<source>webjars/angular-route.js</source>
</preloadSources>
<jsSrcDir>${project.basedir}/src/main/resources/static/js</jsSrcDir>
<jsTestSrcDir>${project.basedir}/src/test/resources/static/js</jsTestSrcDir>
<specIncludes>
<include>*Spec.js</include>
</specIncludes>
<webDriverClassName>org.openqa.selenium.phantomjs.PhantomJSDriver</webDriverClassName>
<webDriverCapabilities>
<capability>
<name>phantomjs.binary.path</name>
<value>${phantomjs.binary}</value>
</capability>
</webDriverCapabilities>
</configuration>
</plugin>

Can't run Geb tests using HtmlUnitDriver under Maven

I am running the example Google spec, i.e:
class GoogleHomePageSpec extends GebReportingSpec {
def "first result for wikipedia search should be wikipedia"() {
given:
to GoogleHomePage
expect:
at GoogleHomePage
when:
search.field.value("wikipedia")
then:
waitFor { at GoogleResultsPage }
and:
firstResultLink.text().startsWith "Wikipedia"
when:
firstResultLink.click()
then:
waitFor { at WikipediaPage }
}
}
with the following GebSpec:
reportsDir = "target/geb-reports"
/* webdriver.*.driver system properties are set in the POM */
driver = {
new HtmlUnitDriver();
}
and the following relevant pom.xml excerpt:
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.7-groovy-2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.39.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.gebish</groupId>
<artifactId>geb-spock</artifactId>
<version>0.9.2</version>
<scope>test</scope>
</dependency>
and it fails with the message if I run it from CLI or IDE:
First result for wikipedia search should be wikipedia(scratch.GoogleHomePageSpec) Time elapsed: 0.96 sec <<< ERROR!
geb.driver.DriverCreationException: failed to create driver from callback 'GebConfig$_run_closure1#20fcbdaf'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:354)
at geb.Configuration.getDriver(Configuration.groovy:343)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.Browser.clearCookies(Browser.groovy:483)
at geb.Browser.clearCookiesQuietly(Browser.groovy:491)
at geb.spock.GebSpec.resetBrowser(GebSpec.groovy:45)
at geb.spock.GebSpec.cleanup(GebSpec.groovy:67)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections/set/ListOrderedSet
at com.gargoylesoftware.htmlunit.CookieManager.<init>(CookieManager.java:59)
at com.gargoylesoftware.htmlunit.WebClient.<init>(WebClient.java:131)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.newWebClient(HtmlUnitDriver.java:289)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.createWebClient(HtmlUnitDriver.java:263)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:144)
at GebConfig.run_closure1(GebConfig.groovy:10)
at GebConfig.run_closure1(GebConfig.groovy)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:354)
at geb.Configuration.getDriver(Configuration.groovy:343)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.Browser.clearCookies(Browser.groovy:483)
at geb.Browser.clearCookiesQuietly(Browser.groovy:491)
at geb.spock.GebSpec.resetBrowser(GebSpec.groovy:45)
at geb.spock.GebSpec.cleanup(GebSpec.groovy:67)
I've checked and the commons-collection jar is present and contains the 'missing' class.
I don't get this error at all using ChromeDriver, FirefoxDriver and InternetExplorerDriver.
Unfortunately for environmental reasons I have to use HtmlUnitDriver so I'm really scratching my head about this one.
Would be grateful for any suggestions.
EDIT 1:
Have managed to run a portion of this test successfully on my Mac, the remainder times out.
But am not seeing the same errors as above (which were observed on Windows).
Resolved this problem by rebuilding the maven_repo i.e. moving the old one out of the way so maven is forced to rebuild it on the next run of the tests.
The exception no longer appears.

Launch and endpoint inside servicemix

What do I have to do to call Endpoint.publish from a bundle in servicemix?
I have used wsdl2java to create an impl that I launch inside a BundleActivator:
LOG.info("WSBundle registering using endpoint...");
endpointAddress = substituteParameters(endpointAddress, ref);
Endpoint endpoint = Endpoint.publish(endpointAddress, service);
myEndpoints.put(service, endpoint);
LOG.info("WSBundle registered server at: "+endpointAddress);
This works fine inside the Eclipse IDE but fails when I run the bundle inside the service mix deploy area.
At first the failure was due to missing some classes in the following packages:
javax.xml.ws,
javax.xml.ws.spi,
org.apache.cxf.endpoint,
org.apache.cxf.frontend,
org.apache.cxf.jaxws,
org.apache.cxf.jaxws.spi,
After adding these to my manifest as imported packages I get the following error:
ERROR: Bundle WSExposer [187] EventDispatcher: Error during dispatch. (javax.xml.ws.spi.FactoryFinder$ConfigurationError: Provider org.apache.cxf.jaxws.spi.ProviderImpl not found)
javax.xml.ws.spi.FactoryFinder$ConfigurationError: Provider org.apache.cxf.jaxws.spi.ProviderImpl not found
at javax.xml.ws.spi.FactoryFinder$2.run(FactoryFinder.java:133)
at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:238)
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:127)
at javax.xml.ws.spi.FactoryFinder.access$200(FactoryFinder.java:44)
at javax.xml.ws.spi.FactoryFinder$3.run(FactoryFinder.java:229)
at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.java:238)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:163)
at javax.xml.ws.spi.Provider.provider(Provider.java:43)
at javax.xml.ws.Endpoint.publish(Endpoint.java:57)
My manifest file is as follows:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WSBundle
Bundle-SymbolicName: WSBundle
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.company.soa.wsbundle.WSExposerActivator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.company.product.history.filtertypes.v1,
com.company.product.system.basetypes.v1,
com.company.svc.product.event.v1,
com.company.svc.product.service.event.v1,
com.company.svc.product.service.faults.v1,
javax.xml.ws,
javax.xml.ws.spi,
org.apache.cxf.endpoint,
org.apache.cxf.frontend,
org.apache.cxf.jaxws,
org.apache.cxf.jaxws.spi,
org.osgi.framework
Export-Package: com.company.soa.wsbundle
I found that you can switch service mix to use the Equinox frame work which resolved the issue.
in the etc/config.properties change the karaf.framework to eclipse:
karaf.framework=equinox

Resources