You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Nikhil Jindal <ni...@google.com> on 2010/06/25 14:55:59 UTC

Problem with the Java Library

Hello All,

I am trying to use Thrift with Java. As the readme file in /lib/java says I
have run ant cmd and I get a libthrift.java file which I have included in my
Java Project.
This resolves all the org.apache.* package imports but is unable to resolve
org.slf4j.Logger and LoggerFactory imports.

I gave the following .thrift file:

namespace java Test

service Something {
  i32 ping()
}

And after running thrift --gen java sample.thrift I got a Something.java
file which I have included in my project. This autogenerated Something.java
imports org.slf4j.Logger and LoggerFactory

I have done everything what the Readme says and dont know how to resolve
this import.

Any help will be highly appreciated.

Thanks and Regards
Nikhil Jindal

Re: Problem with the Java Library

Posted by Nikhil Jindal <ni...@google.com>.
Thanks Bjorn!

I am actually using Eclipse IDE.
I am now doing the same thing as you have told.
I am using 1.6.0 versions of the files u have told, though.
Shouldnt be a problem.

Thanks a lot
Nikhil Jindal

2010/6/25 Bjørn Borud <bb...@gmail.com>

> do you use Maven?  if so you want to add this to the dependencies section
> of
> your pom.xml file:
>
>      <dependency>
>        <groupId>org.slf4j</groupId>
>        <artifactId>slf4j-api</artifactId>
>        <version>1.5.8</version>
>      </dependency>
>      <dependency>
>        <groupId>org.slf4j</groupId>
>        <artifactId>slf4j-simple</artifactId>
>        <version>1.5.8</version>
>      </dependency>
>
> -Bjørn
>

Re: Problem with the Java Library

Posted by Bjørn Borud <bb...@gmail.com>.
do you use Maven?  if so you want to add this to the dependencies section of
your pom.xml file:

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.5.8</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.5.8</version>
      </dependency>

-Bjørn

Re: Problem with the Java Library

Posted by Nikhil Jindal <ni...@google.com>.
Thanks a lot man for such a quick reply.
This is precisely what I wanted.
Just missed SLF4J as a requirement for Java on the site and took so much
time to figure it out. I am not sure, if I would have been able to figure it
out myself if not for ur help.

Thanks a lot.
I really Appreciate it.

Thanks
Nikhil Jindal

On Fri, Jun 25, 2010 at 6:29 PM, Michael Ward <m2...@gmail.com> wrote:

> http://www.slf4j.org/
>
> On Fri, Jun 25, 2010 at 7:55 AM, Nikhil Jindal wrote:
>
> > Hello All,
> >
> > I am trying to use Thrift with Java. As the readme file in /lib/java says
> I
> > have run ant cmd and I get a libthrift.java file which I have included in
> > my
> > Java Project.
> > This resolves all the org.apache.* package imports but is unable to
> resolve
> > org.slf4j.Logger and LoggerFactory imports.
> >
> > I gave the following .thrift file:
> >
> > namespace java Test
> >
> > service Something {
> >  i32 ping()
> > }
> >
> > And after running thrift --gen java sample.thrift I got a Something.java
> > file which I have included in my project. This autogenerated
> Something.java
> > imports org.slf4j.Logger and LoggerFactory
> >
> > I have done everything what the Readme says and dont know how to resolve
> > this import.
> >
> > Any help will be highly appreciated.
> >
> > Thanks and Regards
> > Nikhil Jindal
> >
>

Re: Problem with the Java Library

Posted by Michael Ward <m2...@gmail.com>.
http://www.slf4j.org/

On Fri, Jun 25, 2010 at 7:55 AM, Nikhil Jindal <ni...@google.com>wrote:

> Hello All,
>
> I am trying to use Thrift with Java. As the readme file in /lib/java says I
> have run ant cmd and I get a libthrift.java file which I have included in
> my
> Java Project.
> This resolves all the org.apache.* package imports but is unable to resolve
> org.slf4j.Logger and LoggerFactory imports.
>
> I gave the following .thrift file:
>
> namespace java Test
>
> service Something {
>  i32 ping()
> }
>
> And after running thrift --gen java sample.thrift I got a Something.java
> file which I have included in my project. This autogenerated Something.java
> imports org.slf4j.Logger and LoggerFactory
>
> I have done everything what the Readme says and dont know how to resolve
> this import.
>
> Any help will be highly appreciated.
>
> Thanks and Regards
> Nikhil Jindal
>