How to get jar lib files of jongo? - java

Follow at jongo a java library on top of MongoDB allow Query in Java as in Mongo shell.
Example:
SHELL
db.friends.find({"age": {$gt: 18}});
JAVA DRIVER
friends.find(new BasicDBObject("age",new BasicDBObject("$gt", 18)));
JONGO
friends.find("{age: {$gt: 18}}").as(Friend.class);
But I can't find anything to download these jar lib files.
Who could share this file with me?

The project is hosted on the Sonatype OSS library, so you could search for it here https://oss.sonatype.org/index.html#nexus-search;quick~jongo
A quick search for the latest jar turned up https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases&g=org.jongo&a=jongo&v=0.2&e=jar

As said by David Welch, you can download Jongo directly on Sonatype.
You can also use its maven dependency, it will ease the version upgrades to come:
<dependency>
<groupId>org.jongo</groupId>
<artifactId>jongo</artifactId>
<version>0.2</version>
</dependency>

Related

Apache and Thrift installed but Netbeans can't see import org.apache.thrift

I'm using Archlinux with both Thrift 0.9.3 and Apache installed. In my Netbeans project, when I import org.apache.thrift.*; I got "package org.apache.thrift does not exist". This answer didn't solved the problem because I got not /lib/java folder neither the other answer. Until the moment I couldn't find an answer on the internet. Thanks in advance.
You need the libthrift JAR file in order to use java code generated by the Thrift compiler.
If your project is set up to be able to use Maven repositories, you can add this artifact to your project:
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.9.3</version>
</dependency>
Alternatively you could just download the JAR file from Maven central and add it to your project:
http://central.maven.org/maven2/org/apache/thrift/libthrift/0.9.3/libthrift-0.9.3.jar
Also important to note is that the version of the JAR you use should match the version of the Thrift compiler that you use for code generation; so if you upgrade the Thrift compiler used for your project, you should upgrade the version of the JAR file as well.

Cant setup Elastic Search JAVA API

I have used elastic search in nodejs. But now for a java app I need elasticsearch. So I read the documentation in elastic search official website. But I cant follow one thing
I have installed Maven plugin in Eclipse.
I have done dependency setup in pom.xml in my project.
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.5.0</version>
</dependency>
</dependencies>
But whenever I write below line in java it says cant resolve.
import static org.elasticsearch.node.NodeBuilder.*;
So I'm unable to use elastic search in java.
I have read this as source
https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html
http://java.dzone.com/articles/elasticsearch-java-api
I am not sure what you are doing here, you shouldnt have to download the jar manually and add to eclipse as a project dependency. Please go through this tutorial to understand how maven dependency works. Relevant text below:
Maven connects to remote repositories (or you can set up your own
local repos) and automatically downloads all of the dependencies
needed to build your project. For example, lets say you have a project
that uses Apache's Camel routing tool, version 2.10.6, but a new
version of Camel is released, 2.11.1. Instead of having to go to
Apache's website, download the 2.11.1 distribution and replace 2.10.6
with it, you can just tell Maven to use the new distribution and the
work will be done for you.

Integrating a open source java lib on grails application

I want to intergate the apache tika jar or source files into my grail application and how can i do it please ...
what about access source files into my groovy controller or something
There are a lot's of way to include jar on a grails project, however i think that te best way is using maven.
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>...</version>
</dependency>
add on your BuildConfig.groovy file
dependencies {
...
compile'org.apache.tika:tika-core:1.7'
...
}
try grails apache tika plugin http://grails.org/plugin/tika-parser
there is a thrird option. you can put the downloaded .jar file into the /lib dir of your grails project. do grails package and it should get picked up. this of course is a much inferior solution, than just using a plug-in or dependencies, but might come handy.

Where do I get a proper Cassandra Thrift API jar file?

Refer to Is there a Java interface to Cassandra database that works out of the box? for my original issue.
I determined that the cassandra thrift API jar file I downloade was incomplete or out of sync with the Hector API. Where can I download it? I haven't been able to find a download for it from the official site.
The Maven repository are always a good choice for precompiled libs:
http://mvnrepository.com/artifact/org.apache.cassandra/cassandra-thrift
It also lists all dependencies. You could also use a Maven file (or another compatible build system) to download the lib with all it's dependencies automatically.
As far as I know there isn't an official jar that you can download. But you can grab the source-code here and compile it yourself:
http://thrift.apache.org/download/
If you use maven then you can just include the following in your pom:
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>x.y.z</version>
</dependency>
If you download one of the release tgz files from https://github.com/rantav/hector/downloads it has the correct cassandra thrift to match the version of hector.

how to include javax.jms.* in eclipse?

Iam trying to implement JMS using eclipse.But when I tried to save the code, it showed that javax.jms.* cannot be resolved and there are no suggestions as well recommended by it.
How can I include it and use it? when I googled I found that javax.jms.* is not a part of java API,then how can I use it in eclipse and get my program run successfully?
I would like to implement JMS with the help of activemq,what all do I need to download and include in code?
Iam a newbie to this JMS, please suggest some references or sample code that can implement JMS using activemq.
When you download the activemq archive file from Internet. Extract this archive: /apache-activemq-x.x.x
cd into this apache... directory.
You will see activemq-all-x.x.x jar file.
Include this in your build path.
This should resolve your issue.
If it is a maven project, add the following dependency to your pom.xml and it should start working as expected.
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
<version>1.1</version>
</dependency>
There are actually many ways to fix this. As already stated in the comment you need the Java Enterprise Edition API. Java EE is an abstract specification so what you need is an implementation of the JMS API. Since JMS is part of the Java EE specification the easiest thing is to download a application server such as GlassFish (which is the reference implementation) or JBoss.
I assume you already got the Java compiler so you only need the SDK, not the JDK.
Java EE 6 SDK Update 4 A free integrated development kit used to
build, test, and deploy Java EE 6 applications.
http://www.oracle.com/technetwork/java/javaee/downloads/index.html
Then after you have downloaded GlassFish you will end up with a lot of files that is an implementation of the different Java EE specification API's. You will probably want to download the plugin that I linked to beneath so that you can start, deploy and do many other administration task of your server from Eclipse. I do not use Eclipse so I don't remember if you want this version of Eclipse as well.
http://marketplace.eclipse.org/node/867
At last you want to add GlassFish to your buildpath.
I found this blog post (Scroll to "Create projects in Eclipse") if you are unsure what to add, but there are several blog posts on how to add GlassFish to the build path in Eclipse so I won't list them here.
http://www.webagesolutions.com/knowledgebase/javakb/jkb005/index.html
In addition to the answers already provided, if you are using Maven you can add the following dependency (available from Maven2 Central repo):
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</dependency>
When you have downloaded activemq zip file from http://activemq.apache.org then when you extract it, head on to .jar file of activemq(This jar file is required). Now from Eclipse do as follows:
RightClick on Project and go to Properties
Java Build Path tab
Libraries tab
Add External JARs...
Get that .jar file from activemq folder
I fixed this problem by including the dependency of Activemq.
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.15.0</version>
</dependency>
It can be found in jboss-jms-api.jar
If you are using/Testing ActiveMQ.
Then configure your build path and add external jar activemq-all-.jar. (Path:In )
Clean and Build.
This will helped me , will do same to you as well.
Danke,
Rahul.
If you want to resolve this issue using maven, then the correct maven dependency, available in maven repository, is the following:
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms-api</artifactId>
<version>1.1-rev-1</version>
</dependency>
See post: The following artifacts could not be resolved: javax.jms:jms:jar:1.1

Categories

Resources