Cannot import ArangoDriver class in springboot - spring

I have been trying to run an application in batch mode to upload data to arango db. But to start the driver in batch mode I tried importing ArangoDriver class. But the class is not accessible. It is giving import error. But I'am able to import all the other packages in com.arangodb. I tried creating instance as per the tutorial available here https://www.arangodb.com/2014/11/arangodb-java-driver-batch-asynchronous-mode/'. But Iam not able to import anything. Has new changes have come to arango? How to resolve this?

Related

Google Cloud Spark ElasticSearch TransportClient connection exception

I am using Spark on Google Cloud and I have the following code to connect to an Elasticsearch database
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
public TransportClient openConnection(String ipAddress, int ipPort) throws UnknownHostException {
Settings settings = Settings.settingsBuilder().put("cluster.name", "elasticsearch").build();
TransportClient client = TransportClient.builder().settings(settings).build().
addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(ipAddress), ipPort));
return client;
}
When I run it locally, i.e. spark-submit --master local[*] everything runs OK. When I run it in a google cloud spark cluster I get the following Exception:
java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.threadpool.ThreadPool
at org.elasticsearch.client.transport.TransportClient$Builder.build(TransportClient.java:131)
at javaTools.ElasticSearchConnection.openConnection(ElasticSearchConnection.java:24)
The last referred method (openConnection) is the connection described above.
The code is uploaded to the google cloud using a fat jar created using sbt asssembly, so all libraries used are common, except for the native java ones.
I am thinking it might be some library dependency, since the same jar runs fine on my local computer and it is able to connect to the ElasticSearch server, but the same jar fails to run on the spark cluster on Google cloud. Both local and and cloud versions of Spark are the same, 1.6.0.
The problem is caused due to conflicting Guava libraries used in Spark and Elasticsearch. The solution can be found in this StackOverflow question

the ggts cant import the spring source code

I want to read and learn Spring's source code, but I cant import the gradle project after I download the source cdoe.
Here is the error message
enter image description here
can anybody help me?

Spring Boot modifying example project - Error: Could not find or load main class hello.Application

I imported on of the Spring Boot getting started projects,
gs-rest-service-complete and looked over it, ran it and got the
general idea how I could start things.  So needless to say, I started
to modify that project in order to get my own set of web services
started.  Originally there was an Application class in the hello
package annotated with the #SpringBootApplication and had a main
method which did a SpringApplication.run(Application.class, args) to
get it running.  Obviously I was going to use the 'hello' package, so
I deleted all that and made my own package hierarchy something on the
order of com.mycompany.product.  In that package I made an
Application.class with the same guts (but corresponding to this
package) and a controller in a subpackage of that.
When trying to start the spring boot app, i get this error in the console now:
    Error: Could not find or load main class hello.Application
I have no idea what's telling it to look for that specific class in
that specific package.  There's no reference to that stuff in my
project anymore.  (running in STS).
What controls this?  What do I do?  I had assumed having only class in
the project at the top of a package layout with the
#SpringBootApplication would get everything moving 'just right'.
How about that... The Boot Dashboard is actually a bunch of launch configurations for run or debug.
I selected my app there and realized when right clicking on it there was an option called "Open Config" which brought me to the "Debug Configurations" dialog. And there was my answer... in the "Main type" field, it said "hello.Application". That's where you set or change it.
I changed that to my "com.mycompany.product.Application" and the app started up as hoped!
The recommended way to get started with a spring boot application is to use the initializr
Click on the 'Switch to full version', fill in the details of your application and select the spring-boot starter packages you want to include. You can look in the pom.xml of the demo project you were using as a tutorial to figure out which ones you need. Then you just click the generate project button and import it into eclipse. Inside eclipse go file -> import -> Maven -> Existing maven projects. Then point to where you unzipped the file you downloaded from spring initializr and it will import your project into Eclipse.

Grails Package name wont change

I have started learning Grails and now familiarizing with configurations.
To change the default package name for my grails project i entered the following in
config.groovy
grails.project.groupId = com.grailspractice.nick
Then ,
grails create-controller testc
But the files are not being created in the package domain structure.
I get the following structure instead
Created file grails-app/controllers/testapp/TestcController.groovy
Created file grails-app/views/testc
Created file test/unit/testapp/TestcControllerSpec.groovy
Please tell me if i am missing anything else.
Also If I run my app using
grails run-app
Then the application runs fine, but if in a separate command window if i create a controller while the application is running i get the following error on my prompt where the app was running
grails error cannot get property on cache operation source null object
Is it an installation problem? Or have i messed up any configuration?

Is it okay to use org.eclipse.birt imports in java file?

I am trying to integrate birt report Engine into my struts2 application, is it okay to have org.eclipse.birt imports ? will they create any problems in server side (when i push into main server)?? please elaborate i am new to this!
Yes, if you are trying to integrate BIRT into your application you can, and will need to, import those packages.
You will need to make sure that the appropriate jars (the one(s)) containing the imported packages) are available to the server at runtime.

Resources