I could run Harness example here
but I copied the code to another directory and use the same dependencies in pom.xml, it raised error that no routers defined
I debug and found that MyModule which extends StateFunModule was not found. Thus the class loader get no module and the router and func size is 0 and failed in validation step. (The step to check ingress, egress, router, func not size 0)
PS: I just copied all the code, thus #AutoService is also included. According to here, it should work without further configuration.
Update:
Seems its statefun issue related to #AutoService
I added following code in the pom in another project (unrelated to statefun)
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.0-rc6</version>
<optional>true</optional>
</dependency>
It works, the META-INF is generated.
But if using
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>statefun-flink-distribution</artifactId>
<version>2.2-SNAPSHOT</version>
</dependency>
The META-INF is not generated, and I found in statefun, the dependency used is actually
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.0-rc6</version>
<optional>true</optional>
</dependency>
And I test this dependency, it could not generate META-INF, and I am curious that why if we directly clone the statefun repo and mvn clean package, it could work.
Related
I configured extent reports (Selenium - TESTING) in my project and everything was working fine. I had tried to configure Maven but it failed, now extent reports were working fine and suddenly I have started getting below messages in eclipse console,
I tried to clean project, restart the system, update extent jar files, removing Maven related configurations, but nothing worked and still getting the below errors in console and my second iteration is not getting executed properly.
DEBUG 15341 [freemark] (): Couldn't find template in cache for "index.ftl"("en", UTF-8, parsed); will try to load it.
DEBUG 15341 [freemark] (): TemplateLoader. findTemplateSource("index_en.ftl"): Not found.
DEBUG 15341 [freemark] (): TemplateLoader.findTemplateSource("index.ftl"): Found.
DEBUG 15341 [freemark] (): Loading template for "index.ftl"("en", UTF-8, parsed) from "jar:file:/C:/Users/a00/Downloads/selenium-java-3.13.0/jar_files(1) /extentreports-3.1.5.jar!/com/aventstack/extentreports/view/html-report /index.ftl".
and so on.
Set org.freemarker.loggerLibrary property to none as below
System.setProperty("org.freemarker.loggerLibrary", "none");
If you are moving to maven as a build tool make sure you have the dependencies for extent reports. Your stack trace is complaining about freemarker. Make sure you have these 3 dependencies in your POM file
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
I am invoking JsonBuilder.toString() in Groovy code inside a Camel route. This Camel route runs inside Widlfly Camel 12.0. The code looks like so:
def builder = new JsonBuilder()
builder {
'myField': myFieldVal
}
return builder.toString()
The builder.toString() method invocation produces the following error:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
groovy.json.internal.FastStringUtils
But I do have the dependencies mentioned properly in pom.xml like so:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-groovy</artifactId>
<scope>provided</scope>
</dependency>
I also tried adding this extra dependency to resolve the problem:
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>2.4.13</version>
</dependency>
But I still keep on getting the above exception. However when I run the same Camel code using the camel-maven-plugin, without deploying it inside Wildfly, it runs perfectly.
Can someone please help?
Thanks in advance.
I think the problem is that module org.apache.camel.script.groovy cannot access sun.misc.Unsafe. So I added the following module dependency to modules/system/layers/fuse/org/apache/camel/script/groovy/main/module.xml.
<module name="sun.jdk">
<imports>
<include path="sun/misc/Unsafe"/>
</imports>
</module>
Your example worked for me afterwards.
I need to mark a step pass or fail a step after validating a text "shipping" available or not available in the page.
How can I mark the step pass or fail based availability.
As you are using Cucumber, I am assuming you are using JUnit and Java.
You need to use Assert of JUNIT/TestNG
You need to use Junit separately don't use cucumber JUnit API for asserting
You can use below dependencies
https://mvnrepository.com/artifact/junit/junit/4.12
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
Now you can use assert as below:
Assert.assertEquals("shubham page", driver.getTitle());
Use below import
import org.junit.Assert;
Running Camel 2.17.3 on Karaf 4.0.5 with camel-atmosphere-websocket feature Atmosphere (v2.4.3) raises the following exception:
Cannot load the WebSocketProtocol org.apache.camel.component.atmosphere.websocket.WebsocketHandler
java.lang.ClassNotFoundException: org.apache.camel.component.atmosphere.websocket.WebsocketHandler not found by org.atmosphere.runtime [203]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)[org.apache.felix.framework-5.4.0.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)[org.apache.felix.framework-5.4.0.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:805)[:1.8.0-internal]
at org.atmosphere.util.IOUtils.loadClass(IOUtils.java:370)[203:org.atmosphere.runtime:2.4.3]
at org.atmosphere.cpr.AtmosphereFramework.initWebSocket(AtmosphereFramework.java:1762)[203:org.atmosphere.runtime:2.4.3]
The package is exported by the bundle org.apache.camel.camel-atmosphere-websocket.
Am I missing any dependencies or is there an issue with the startup order?
Add this dependency to your pom.xml
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-atmosphere-websocket</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>
As mentioned you need to use the same version for all dependecies.Reference : http://camel.apache.org/atmosphere-websocket.htmlHope this Works.
I'm following this example, http://code.google.com/p/google-api-java-client/wiki/OAuth2Draft10 and I paste in the code however the following lines give errors (cannot be resolved):
import com.google.api.client.auth.oauth2.draft10.AccessTokenResponse;
import com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessProtectedResource;
import com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant;
import com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAuthorizationRequestUrl;
The same page says ok bro no problem just add this to Maven:
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.11.0-beta</version>
</dependency>
Unfortunately I don't know jack about Maven. I don't have a POM.XML (I created another project and still no pom.xml).