Observing error while running Gatling project 'object gatling is not a member of package io' - gatling

I m seeing the following error while running Engine.scala
object gatling is not a member of package io import io.gatling.app.Gatling
Below is the code that is used
`import io.gatling.app.Gatling
import io.gatling.core.config.GatlingPropertiesBuilder
object Engine extends App {
val props = new GatlingPropertiesBuilder()
.resourcesDirectory(IDEPathHelper.mavenResourcesDirectory.toString)
.resultsDirectory(IDEPathHelper.resultsDirectory.toString)
.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString)
Gatling.fromMap(props.build)
}`
I tried changing the Gatling version in mvn file, but no luck. could someone please help

It means the Gatling jars are not properly imported in your classpath.
No idea how to help you though as you're not describing exactly what you're doing and how you're getting this error: when running maven from the command line? when running from IntelliJ? or another IDE?
Note: if you're struggling with properly setting up a development environment for Scala, you should probably consider using Gatling with Java instead, where the set up is way more simple.

Related

object johnsnowlabs is not a member of package com

I am very new to Zeppelin/spark and couldn't get an accurate description of steps to configure new dependencies like that of NLP libraries.
Found similar issue here.
I was trying to use Johnsnowlabs NLP library in Zeppelin notebook (spark version2.2.1).
Setup included :
In Zeppelin's Interpreters configurations for Spark, include the following artifact:
com.johnsnowlabs.nlp:spark-nlp_2.11:2.5.4
Then, in conf/zeppelin-env.sh, setup SPARK_SUBMIT_OPTIONS.
export SPARK_SUBMIT_OPTIONS=” — packages JohnSnowLabs:spark-nlp:2.2.2". Then restarted Zeppelin.
But the below program gives the error :
%spark
import com.johnsnowlabs.nlp.base._
import com.johnsnowlabs.nlp.annotator._
<console>:26: error: object johnsnowlabs is not a member of package com
import com.johnsnowlabs.nlp.base._
^
<console>:27: error: object johnsnowlabs is not a member of package com
import com.johnsnowlabs.nlp.annotator._
Can someone please share how this can be done? I referred this link .
TIA
you don't need to edit the conf/zeppelin-env.sh (anyway you're using it incorrectly, as you're specifying completely different version), you can make all changes via Zeppelin UI. Go to the Spark interpreter configuration, and put com.johnsnowlabs.nlp:spark-nlp_2.11:2.5.4 into spark.jars.packages configuration property (or add it if it doesn't exist), and into the Dependencies at the end of configuration (for some reason, it isn't automatically pulled into driver classpath).

Cant use 'fs' in my react-native project.. don't know how to solve

Hi im trying to use the fs.createReadStream() function in 'fs' however i cant seem to use this module as i keep getting this build error.
bundling failed: Error: While trying to resolve module fs from file /Users/bentait/Desktop/memriio/memriio_app/src/datapass.js, the package /Users/bentait/Desktop/memriio/memriio_app/node_modules/fs/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/Users/bentait/Desktop/memriio/memriio_app/node_modules/fs/index.js. Indeed, none of these files exist:
Im almost at my end trying to learn js, react, react-native.. i seem to spend 90% of time trying to solve these sorts of problems and 10% of time writing actual code..
anyway - not really expecting a response on this but cool, if you know how to help..
You're not able to use node's fs because it is part of nodejs environment. As you surely know your application code is not running on nodejs but rather directly on your smartphone (besides debug mode but even there you cannot use node's fs package).
To access and manipulate smartphone's filesystem take a look at react-native-fs or rn-fetch-blob package.

Unable to find the features file?

I am running Cucumber JVM for a POC with Selenium 2.37.
The folder structure of my project as follows
src
>> main
> test
>java
>package
>TestRunner.java
>StepfDef.java
>resource
>package
>bdddemo.features
When i run the test runner via Junit, i am getting the following error message.
cucumber.runtime.CucumberException:
No features found at [classpath:test/java/com/package]
I believe the folder structure has some issue.
Can anybody post me where the Cucumber-JVM is actually looking for story files by default ?
By default, when using classpath:, Cucumber starts looking in the root of you classpath.
If you configure Cucumber to search in "classpath:features", you can put your features in src/test/resources/features.

appengine error - java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.org.apache.xerces

I re-deployed my app (google appengine), it seems to be working fine, but when I try to parse Xml I get:
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.com.sun.org.apache.xerces.internal.parsers")
what does it mean? and how I can solve it?
on previous version of the app I didn't got this error.
when running the app locally I don't get this error.
I made minor changes - I pass some data from the UI to the datastore
Here is the code that parse the XML:
public static <T extends BaseDataObject> T xml2Bean(Class<T> clazz,
String xmlData) throws UnsupportedEncodingException, JAXBException {
Reader reader = new StringReader(xmlData);
JAXBContext context = getContext(clazz);
Unmarshaller um = context.createUnmarshaller();
return (T) um.unmarshal(reader);
}
My guess is that Google use to support com.sun.org.apache.xerces.internal.parsers but now they don't, and my old code still working because it was pushed when it was still supported...
how can I verify this guess? i.e. where can I find the list of unsupported packages?
I'm thinking of dropping the XML code and use json instead, how can I make sure json is supported?
Problem was solved: I've downloaded xerces and added the jars to war\WEB-INF\lib and to the build path in eclipse.
I also upgrade to the latest JDK (java 7).
I'm not sure which of those solved the problem...
Something in your code or a dependency of your code, is trying to refer to the package com.sun.org.apache.xerces.internal.parsers, which is not allowed on GAE. Just a guess: maybe a dependency has been upgraded and this dependency is trying to access that package.

jTwitter, oAuth, and Google App Engine. NoClassDefFoundError

I'm trying to use jTwitter to get an oauth instance to twitter with my consumer key/secret and access token/secret. This is well documented in the javadoc here. I have downloaded signpost, signpost-jetty, and the jtwitter library, but after deploying and running the servlet, I get a error java.lang.NoClassDefFoundError: winterwell/jtwitter/OAuthSignpostClient Eclipse isn't complaining about the class not being there, because it is there-- I can see it in the JAR file itself, which is in my project. So, I said forget it, I'll try out OAuthScribeClient instead, but this generated a VERY SIMILAR ERROR java.lang.NoClassDefFoundError: org/scribe/oauth/Token This one confuses me even further because I have the following code in my java file, and it compiles without error or warning:
import org.scribe.oauth.Token;
Token token = new Token("myaccesstokeninfo", "accesstokensecret");
Clearly, I'm missing something very fundamental, but I am at an absolute loss as to what it may be. Thanks.
Usually "NoClassDefFoundError" happens when you forget to copy all jar-files to your "/war/WEB-INF/lib" directory, so those libs will be unavailable from server-side.
Xo4yHaMope is probably right.
If you're working from Eclipse but running using a web container, then your runtime classpath might be different from your project classpath - which can cause this error.
In order to complete Ben Winters answer what I actually did and worked is add the jar in
the libs folder within the project
see also here about folder hierarchy.
When you do this eclipse will normally add the jar to the android dependencies before launching the application. What I realise is that adding a jar in the build path will make classes available only during the build

Resources