object johnsnowlabs is not a member of package com - apache-zeppelin

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).

Related

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

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.

EntityFramework.BulkInsert: context does not contain a definition for BulkSaveChanges

I'm using EF 6.1.3 and installed EntityFramework.BulkInsert-ef6.
context.BulkSaveChanges();
gives me an error
context does not contain a definition for BulkSaveChanges
I'm forgetting a configuration? Reading https://entityframework-extensions.net/bulk-savechanges I cannot figure it out
You are using the wrong package.
See download link here: https://entityframework-extensions.net/download
You want to Z.EntityFramework.Extensions package: https://www.nuget.org/packages/Z.EntityFramework.Extensions/

Vespa Tutorial – HTTP API use-case fails to activate with IllegalArgumentException

I'm currently following the Vespa tutorials, and ran into an issue with the HTTP API use-case. Everything works fine from the mvn install package to the vespa-deploy prepare target/application.zip.
The call to vespa-deploy activate returns normally, but the application then never gets available on localhost:8080. Looking at /opt/vespa/logs/vespa/vespa.log (in the VM) one finds the following stack trace:
Container.com.yahoo.jdisc.core.StandaloneMain error Unexpected:
exception=
java.lang.IllegalArgumentException: Could not create a component with id 'com.mydomain.demo.DemoComponent'.
Tried to load class directly, since no bundle was found for spec: sample-app-http-api-searcher.
If a bundle with the same name is installed, there is a either a version mismatch or the installed bundle's version contains a qualifier string.
at com.yahoo.osgi.OsgiImpl.resolveFromClassPath(OsgiImpl.java:48)
...
This occurred using a fresh Docker image with a clean clone of the sample-apps git repository. Preparing and activating the basic sample as well as the other http example did work seamlessly.
I checked the sources and the xml files for obvious problems but don't have any clue about what is failing and where.
target/application.zip contains
application/components/http-api-using-searcher-1.0.1-deploy.jar
application/hosts.xml
application/searchdefinitions/basic.sd
application/services.xml
And the jar itself does contain a com/mydomain/demo/DemoComponent.class file (among other things).
Potentially related issue on the github tracker: https://github.com/vespa-engine/vespa/issues/3479 I'll be posting a link to this question there as well, but I still think it's worth a SO question, at least to get some action behind the vespa tag :)
The bundle id in the application's services.xml file was wrong. Please pull the application from git and try again now. See also PR: https://github.com/vespa-engine/sample-apps/pull/18
Brief explanation: The bundle id given in the bundle="<id>" declaration in services.xml must match the 'Bundle-SymbolicName' in the bundle's manifest. When the bundle has been built with the Vespa bundle-plugin, the symbolic name is by default the same as the project's artifactId. Hence, in most cases you just have to verify that the bundle id matches the artifactId.

Export MongoDB symbol in Package in Meteor 0.6.5

I need to use MongoDB driver in Meteor because I want to use Grid in my application. Before Meteor 0.6.5, I managed to have a mongodb as a package, and it worked fine.
But after the update, with the new Package system, I cannot make it to work. Here is my package.js (in myAppFolder/packages/mongodb/), I also did meteor add mongodb
Package.describe({
summary: "Mongodb driver"
});
Npm.depends({'mongodb': '1.3.18'});
Package.on_use(function(api){
MongoDB = Npm.require("mongodb");
console.log(MongoDB, '--------------');
api.export('MongoDB', 'server');
});
I can see that the console log prints something when I start the server, but then in my application code at runtime, the value of MongoDB is undefined, the same thing for Package.mongodb.MongoDB . It seems to me that these values are assigned to undefined somehow.
If someone knows how to use the already included MongoDB driver in the mongo-livedata package, it would be a better solution.
I don't think it works if you do it in the package.js file; it appears you have to use a separate file. I did something similar to get the csv package, in the following way:
package.js:
Npm.depends({
csv: "0.3.5"
});
Package.on_use(function (api) {
api.add_files('server.js', 'server');
api.export('csv');
});
server.js:
csv = Npm.require('csv');
This is Meteor 0.6.5+ specific. They have a section in the docs about it now: http://docs.meteor.com/#writingpackages
Like you said though, you should be able to Npm.require the same mongodb package that Meteor is already using, and save an additional npm install. For example, the mongo-livedata package exports something called MongoInternals, and you may be able to dig in to it and find out how to pull out the mongo driver:
https://github.com/meteor/meteor/blob/devel/packages/mongo-livedata/package.js

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