You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Furkan KAMACI <fu...@gmail.com> on 2013/03/21 13:56:30 UTC

How can I compile and debug Solr from source code?

I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.

I have opened Solr source code at Intellij IDEA as explained documentation.
I want to deploy Solr into Tomcat 7. When I open the project there are
configurations set previosly (I used ant idea command before I open the
project) . However they are all test configurations and some of them are
not passed test (this is another issue, no need to go detail at this
e-mail). I have added a Tomcat Local configuration into configurations but
I don't know which one is the main method of Solr and is there any
documentation that explains code. i.e. I want to debug a point what Solr
receives from when I say -index from nutch and what Solr does?

I tried somehing to run code (I don't think I could generate a .war or an
exploded folder) an this is the error that I get:(I did't point any
artifact for edit configurations)

Error: Exception thrown by the agent : java.net.MalformedURLException:
Local host name unknown: java.net.UnknownHostException: me.local: me.local:
Name or service not known

(me.local is the name I set when I install Centos 6.4 on my computer)

Any ideas how to run source code will be nice for me.

Re: How can I compile and debug Solr from source code?

Posted by Erick Erickson <er...@gmail.com>.
Furkan:

Stop. back up, you're making it too complicated. Follow Erik's
instructions. The "ant example" just compiles all of Solr, just like the
distribution. Then you can go into the example directory and change it to
look just like whatever you want, change the schema, change the solrconfig,
add custom components, etc. There's no difference between that and the
distro. It _is_ the distro just in a convenient form for running in Jetty.

So you create some custom code (say a filter or whatever). You put the path
to it in your solroconfig in a <lib.../> directive. In fact I usually path
the <lib> directive out to wherever the code gets built by my IDE for
debugging purposes, then I don't have to copy the jar around.

I can then set breakpoints in my custom code. I can debug Solr as well.
It's just way cool.

About the only thing I'd add to Hatchers instructions is the possibility of
specifying "suspend=y" rather than "suspend=n", and that's just if I want
to debug Solr startup code.

BTW, IntelliJ has, under the "edit configurations" section a "remote"
option that guides you through the flags etc that Erik pointed out. Eclipse
has similar but I use IntelliJ.

Best
Erick


On Thu, Mar 21, 2013 at 8:00 PM, Furkan KAMACI <fu...@gmail.com>wrote:

> Ok I run that and see that there is a .war file at
>
> /lucene-solr/solr/dist
>
> Do you know that how can I run that ant phase from Intellij without command
> line (there are many phases under Ant build window) On the other hand
> within Intellij Idea how can I auto deploy it into Tomcat. All in all I
> will edit configurations and it will run that ant command and deploy it to
> Tomcat itself?
>
> 2013/3/22 Steve Rowe <sa...@gmail.com>
>
> > Perhaps you didn't see what I wrote earlier?:
> >
> > Sounds like you want 'ant dist', which will create the .war and put it
> > into the solr/dist/ directory:
> >
> > PROMPT$ ant dist
> >
> > Steve
> >
> > On Mar 21, 2013, at 7:38 PM, Furkan KAMACI <fu...@gmail.com>
> wrote:
> >
> > > I mean I need that:  There is a .war file shipped with Solr source
> code.
> > > How can I regenerate (build my code and generate a .war file) as like
> > that?
> > > I will deploy it to Tomcat then?
> > >
> > > 2013/3/22 Furkan KAMACI <fu...@gmail.com>
> > >
> > >> Your mentioned suggestion is for only example application? Can I imply
> > it
> > >> to just pure Solr (I don't want to generate example application
> because
> > my
> > >> aim is not just debugging Solr, I want to extend it and I will debug
> > that
> > >> extended code)?
> > >>
> > >>
> > >> 2013/3/22 Alexandre Rafalovitch <ar...@gmail.com>
> > >>
> > >>> That's nice. Can we put that on a Wiki? Or as a quick screencast?
> > >>>
> > >>> Regards,
> > >>>   Alex.
> > >>>
> > >>> Personal blog: http://blog.outerthoughts.com/
> > >>> LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
> > >>> - Time is the quality of nature that keeps events from happening all
> at
> > >>> once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
> > book)
> > >>>
> > >>>
> > >>> On Thu, Mar 21, 2013 at 5:42 PM, Erik Hatcher <
> erik.hatcher@gmail.com
> > >>>> wrote:
> > >>>
> > >>>> Here's my development/debug workflow:
> > >>>>
> > >>>>  - "ant idea" at the top-level to generate the IntelliJ project
> > >>>>  - cd solr; ant example - to build the full example
> > >>>>  - cd example; java -Xdebug
> > >>>> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar
> > >>>> start.jar - to launch Jetty+Solr in debug mode
> > >>>>  - set breakpoints in IntelliJ, set up a Remote run option
> > >>>> (localhost:5005) in IntelliJ and debug pleasantly
> > >>>>
> > >>>> All the unit tests in Solr run very nicely in IntelliJ too, and for
> > >>> tight
> > >>>> development loops, I spend my time doing that instead of running
> full
> > on
> > >>>> Solr.
> > >>>>
> > >>>>        Erik
> > >>>>
> > >>>>
> > >>>> On Mar 21, 2013, at 05:56 , Furkan KAMACI wrote:
> > >>>>
> > >>>>> I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit
> computer.
> > >>>>>
> > >>>>> I have opened Solr source code at Intellij IDEA as explained
> > >>>> documentation.
> > >>>>> I want to deploy Solr into Tomcat 7. When I open the project there
> > are
> > >>>>> configurations set previosly (I used ant idea command before I open
> > >>> the
> > >>>>> project) . However they are all test configurations and some of
> them
> > >>> are
> > >>>>> not passed test (this is another issue, no need to go detail at
> this
> > >>>>> e-mail). I have added a Tomcat Local configuration into
> > configurations
> > >>>> but
> > >>>>> I don't know which one is the main method of Solr and is there any
> > >>>>> documentation that explains code. i.e. I want to debug a point what
> > >>> Solr
> > >>>>> receives from when I say -index from nutch and what Solr does?
> > >>>>>
> > >>>>> I tried somehing to run code (I don't think I could generate a .war
> > >>> or an
> > >>>>> exploded folder) an this is the error that I get:(I did't point any
> > >>>>> artifact for edit configurations)
> > >>>>>
> > >>>>> Error: Exception thrown by the agent :
> > java.net.MalformedURLException:
> > >>>>> Local host name unknown: java.net.UnknownHostException: me.local:
> > >>>> me.local:
> > >>>>> Name or service not known
> > >>>>>
> > >>>>> (me.local is the name I set when I install Centos 6.4 on my
> computer)
> > >>>>>
> > >>>>> Any ideas how to run source code will be nice for me.
> > >>>>
> > >>>>
> > >>>
> > >>
> > >>
> >
> >
>

Re: How can I compile and debug Solr from source code?

Posted by Furkan KAMACI <fu...@gmail.com>.
Ok I run that and see that there is a .war file at

/lucene-solr/solr/dist

Do you know that how can I run that ant phase from Intellij without command
line (there are many phases under Ant build window) On the other hand
within Intellij Idea how can I auto deploy it into Tomcat. All in all I
will edit configurations and it will run that ant command and deploy it to
Tomcat itself?

2013/3/22 Steve Rowe <sa...@gmail.com>

> Perhaps you didn't see what I wrote earlier?:
>
> Sounds like you want 'ant dist', which will create the .war and put it
> into the solr/dist/ directory:
>
> PROMPT$ ant dist
>
> Steve
>
> On Mar 21, 2013, at 7:38 PM, Furkan KAMACI <fu...@gmail.com> wrote:
>
> > I mean I need that:  There is a .war file shipped with Solr source code.
> > How can I regenerate (build my code and generate a .war file) as like
> that?
> > I will deploy it to Tomcat then?
> >
> > 2013/3/22 Furkan KAMACI <fu...@gmail.com>
> >
> >> Your mentioned suggestion is for only example application? Can I imply
> it
> >> to just pure Solr (I don't want to generate example application because
> my
> >> aim is not just debugging Solr, I want to extend it and I will debug
> that
> >> extended code)?
> >>
> >>
> >> 2013/3/22 Alexandre Rafalovitch <ar...@gmail.com>
> >>
> >>> That's nice. Can we put that on a Wiki? Or as a quick screencast?
> >>>
> >>> Regards,
> >>>   Alex.
> >>>
> >>> Personal blog: http://blog.outerthoughts.com/
> >>> LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
> >>> - Time is the quality of nature that keeps events from happening all at
> >>> once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
> book)
> >>>
> >>>
> >>> On Thu, Mar 21, 2013 at 5:42 PM, Erik Hatcher <erik.hatcher@gmail.com
> >>>> wrote:
> >>>
> >>>> Here's my development/debug workflow:
> >>>>
> >>>>  - "ant idea" at the top-level to generate the IntelliJ project
> >>>>  - cd solr; ant example - to build the full example
> >>>>  - cd example; java -Xdebug
> >>>> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar
> >>>> start.jar - to launch Jetty+Solr in debug mode
> >>>>  - set breakpoints in IntelliJ, set up a Remote run option
> >>>> (localhost:5005) in IntelliJ and debug pleasantly
> >>>>
> >>>> All the unit tests in Solr run very nicely in IntelliJ too, and for
> >>> tight
> >>>> development loops, I spend my time doing that instead of running full
> on
> >>>> Solr.
> >>>>
> >>>>        Erik
> >>>>
> >>>>
> >>>> On Mar 21, 2013, at 05:56 , Furkan KAMACI wrote:
> >>>>
> >>>>> I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
> >>>>>
> >>>>> I have opened Solr source code at Intellij IDEA as explained
> >>>> documentation.
> >>>>> I want to deploy Solr into Tomcat 7. When I open the project there
> are
> >>>>> configurations set previosly (I used ant idea command before I open
> >>> the
> >>>>> project) . However they are all test configurations and some of them
> >>> are
> >>>>> not passed test (this is another issue, no need to go detail at this
> >>>>> e-mail). I have added a Tomcat Local configuration into
> configurations
> >>>> but
> >>>>> I don't know which one is the main method of Solr and is there any
> >>>>> documentation that explains code. i.e. I want to debug a point what
> >>> Solr
> >>>>> receives from when I say -index from nutch and what Solr does?
> >>>>>
> >>>>> I tried somehing to run code (I don't think I could generate a .war
> >>> or an
> >>>>> exploded folder) an this is the error that I get:(I did't point any
> >>>>> artifact for edit configurations)
> >>>>>
> >>>>> Error: Exception thrown by the agent :
> java.net.MalformedURLException:
> >>>>> Local host name unknown: java.net.UnknownHostException: me.local:
> >>>> me.local:
> >>>>> Name or service not known
> >>>>>
> >>>>> (me.local is the name I set when I install Centos 6.4 on my computer)
> >>>>>
> >>>>> Any ideas how to run source code will be nice for me.
> >>>>
> >>>>
> >>>
> >>
> >>
>
>

Re: How can I compile and debug Solr from source code?

Posted by Steve Rowe <sa...@gmail.com>.
Perhaps you didn't see what I wrote earlier?:

Sounds like you want 'ant dist', which will create the .war and put it into the solr/dist/ directory:

PROMPT$ ant dist

Steve

On Mar 21, 2013, at 7:38 PM, Furkan KAMACI <fu...@gmail.com> wrote:

> I mean I need that:  There is a .war file shipped with Solr source code.
> How can I regenerate (build my code and generate a .war file) as like that?
> I will deploy it to Tomcat then?
> 
> 2013/3/22 Furkan KAMACI <fu...@gmail.com>
> 
>> Your mentioned suggestion is for only example application? Can I imply it
>> to just pure Solr (I don't want to generate example application because my
>> aim is not just debugging Solr, I want to extend it and I will debug that
>> extended code)?
>> 
>> 
>> 2013/3/22 Alexandre Rafalovitch <ar...@gmail.com>
>> 
>>> That's nice. Can we put that on a Wiki? Or as a quick screencast?
>>> 
>>> Regards,
>>>   Alex.
>>> 
>>> Personal blog: http://blog.outerthoughts.com/
>>> LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
>>> - Time is the quality of nature that keeps events from happening all at
>>> once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD book)
>>> 
>>> 
>>> On Thu, Mar 21, 2013 at 5:42 PM, Erik Hatcher <erik.hatcher@gmail.com
>>>> wrote:
>>> 
>>>> Here's my development/debug workflow:
>>>> 
>>>>  - "ant idea" at the top-level to generate the IntelliJ project
>>>>  - cd solr; ant example - to build the full example
>>>>  - cd example; java -Xdebug
>>>> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar
>>>> start.jar - to launch Jetty+Solr in debug mode
>>>>  - set breakpoints in IntelliJ, set up a Remote run option
>>>> (localhost:5005) in IntelliJ and debug pleasantly
>>>> 
>>>> All the unit tests in Solr run very nicely in IntelliJ too, and for
>>> tight
>>>> development loops, I spend my time doing that instead of running full on
>>>> Solr.
>>>> 
>>>>        Erik
>>>> 
>>>> 
>>>> On Mar 21, 2013, at 05:56 , Furkan KAMACI wrote:
>>>> 
>>>>> I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
>>>>> 
>>>>> I have opened Solr source code at Intellij IDEA as explained
>>>> documentation.
>>>>> I want to deploy Solr into Tomcat 7. When I open the project there are
>>>>> configurations set previosly (I used ant idea command before I open
>>> the
>>>>> project) . However they are all test configurations and some of them
>>> are
>>>>> not passed test (this is another issue, no need to go detail at this
>>>>> e-mail). I have added a Tomcat Local configuration into configurations
>>>> but
>>>>> I don't know which one is the main method of Solr and is there any
>>>>> documentation that explains code. i.e. I want to debug a point what
>>> Solr
>>>>> receives from when I say -index from nutch and what Solr does?
>>>>> 
>>>>> I tried somehing to run code (I don't think I could generate a .war
>>> or an
>>>>> exploded folder) an this is the error that I get:(I did't point any
>>>>> artifact for edit configurations)
>>>>> 
>>>>> Error: Exception thrown by the agent : java.net.MalformedURLException:
>>>>> Local host name unknown: java.net.UnknownHostException: me.local:
>>>> me.local:
>>>>> Name or service not known
>>>>> 
>>>>> (me.local is the name I set when I install Centos 6.4 on my computer)
>>>>> 
>>>>> Any ideas how to run source code will be nice for me.
>>>> 
>>>> 
>>> 
>> 
>> 


Re: How can I compile and debug Solr from source code?

Posted by Furkan KAMACI <fu...@gmail.com>.
I mean I need that:  There is a .war file shipped with Solr source code.
How can I regenerate (build my code and generate a .war file) as like that?
I will deploy it to Tomcat then?

2013/3/22 Furkan KAMACI <fu...@gmail.com>

> Your mentioned suggestion is for only example application? Can I imply it
> to just pure Solr (I don't want to generate example application because my
> aim is not just debugging Solr, I want to extend it and I will debug that
> extended code)?
>
>
> 2013/3/22 Alexandre Rafalovitch <ar...@gmail.com>
>
>> That's nice. Can we put that on a Wiki? Or as a quick screencast?
>>
>> Regards,
>>    Alex.
>>
>> Personal blog: http://blog.outerthoughts.com/
>> LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
>> - Time is the quality of nature that keeps events from happening all at
>> once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD book)
>>
>>
>> On Thu, Mar 21, 2013 at 5:42 PM, Erik Hatcher <erik.hatcher@gmail.com
>> >wrote:
>>
>> > Here's my development/debug workflow:
>> >
>> >   - "ant idea" at the top-level to generate the IntelliJ project
>> >   - cd solr; ant example - to build the full example
>> >   - cd example; java -Xdebug
>> > -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar
>> > start.jar - to launch Jetty+Solr in debug mode
>> >   - set breakpoints in IntelliJ, set up a Remote run option
>> > (localhost:5005) in IntelliJ and debug pleasantly
>> >
>> > All the unit tests in Solr run very nicely in IntelliJ too, and for
>> tight
>> > development loops, I spend my time doing that instead of running full on
>> > Solr.
>> >
>> >         Erik
>> >
>> >
>> > On Mar 21, 2013, at 05:56 , Furkan KAMACI wrote:
>> >
>> > > I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
>> > >
>> > > I have opened Solr source code at Intellij IDEA as explained
>> > documentation.
>> > > I want to deploy Solr into Tomcat 7. When I open the project there are
>> > > configurations set previosly (I used ant idea command before I open
>> the
>> > > project) . However they are all test configurations and some of them
>> are
>> > > not passed test (this is another issue, no need to go detail at this
>> > > e-mail). I have added a Tomcat Local configuration into configurations
>> > but
>> > > I don't know which one is the main method of Solr and is there any
>> > > documentation that explains code. i.e. I want to debug a point what
>> Solr
>> > > receives from when I say -index from nutch and what Solr does?
>> > >
>> > > I tried somehing to run code (I don't think I could generate a .war
>> or an
>> > > exploded folder) an this is the error that I get:(I did't point any
>> > > artifact for edit configurations)
>> > >
>> > > Error: Exception thrown by the agent : java.net.MalformedURLException:
>> > > Local host name unknown: java.net.UnknownHostException: me.local:
>> > me.local:
>> > > Name or service not known
>> > >
>> > > (me.local is the name I set when I install Centos 6.4 on my computer)
>> > >
>> > > Any ideas how to run source code will be nice for me.
>> >
>> >
>>
>
>

Re: How can I compile and debug Solr from source code?

Posted by Furkan KAMACI <fu...@gmail.com>.
Your mentioned suggestion is for only example application? Can I imply it
to just pure Solr (I don't want to generate example application because my
aim is not just debugging Solr, I want to extend it and I will debug that
extended code)?

2013/3/22 Alexandre Rafalovitch <ar...@gmail.com>

> That's nice. Can we put that on a Wiki? Or as a quick screencast?
>
> Regards,
>    Alex.
>
> Personal blog: http://blog.outerthoughts.com/
> LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
> - Time is the quality of nature that keeps events from happening all at
> once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD book)
>
>
> On Thu, Mar 21, 2013 at 5:42 PM, Erik Hatcher <erik.hatcher@gmail.com
> >wrote:
>
> > Here's my development/debug workflow:
> >
> >   - "ant idea" at the top-level to generate the IntelliJ project
> >   - cd solr; ant example - to build the full example
> >   - cd example; java -Xdebug
> > -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar
> > start.jar - to launch Jetty+Solr in debug mode
> >   - set breakpoints in IntelliJ, set up a Remote run option
> > (localhost:5005) in IntelliJ and debug pleasantly
> >
> > All the unit tests in Solr run very nicely in IntelliJ too, and for tight
> > development loops, I spend my time doing that instead of running full on
> > Solr.
> >
> >         Erik
> >
> >
> > On Mar 21, 2013, at 05:56 , Furkan KAMACI wrote:
> >
> > > I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
> > >
> > > I have opened Solr source code at Intellij IDEA as explained
> > documentation.
> > > I want to deploy Solr into Tomcat 7. When I open the project there are
> > > configurations set previosly (I used ant idea command before I open the
> > > project) . However they are all test configurations and some of them
> are
> > > not passed test (this is another issue, no need to go detail at this
> > > e-mail). I have added a Tomcat Local configuration into configurations
> > but
> > > I don't know which one is the main method of Solr and is there any
> > > documentation that explains code. i.e. I want to debug a point what
> Solr
> > > receives from when I say -index from nutch and what Solr does?
> > >
> > > I tried somehing to run code (I don't think I could generate a .war or
> an
> > > exploded folder) an this is the error that I get:(I did't point any
> > > artifact for edit configurations)
> > >
> > > Error: Exception thrown by the agent : java.net.MalformedURLException:
> > > Local host name unknown: java.net.UnknownHostException: me.local:
> > me.local:
> > > Name or service not known
> > >
> > > (me.local is the name I set when I install Centos 6.4 on my computer)
> > >
> > > Any ideas how to run source code will be nice for me.
> >
> >
>

Re: How can I compile and debug Solr from source code?

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
That's nice. Can we put that on a Wiki? Or as a quick screencast?

Regards,
   Alex.

Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all at
once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD book)


On Thu, Mar 21, 2013 at 5:42 PM, Erik Hatcher <er...@gmail.com>wrote:

> Here's my development/debug workflow:
>
>   - "ant idea" at the top-level to generate the IntelliJ project
>   - cd solr; ant example - to build the full example
>   - cd example; java -Xdebug
> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar
> start.jar - to launch Jetty+Solr in debug mode
>   - set breakpoints in IntelliJ, set up a Remote run option
> (localhost:5005) in IntelliJ and debug pleasantly
>
> All the unit tests in Solr run very nicely in IntelliJ too, and for tight
> development loops, I spend my time doing that instead of running full on
> Solr.
>
>         Erik
>
>
> On Mar 21, 2013, at 05:56 , Furkan KAMACI wrote:
>
> > I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
> >
> > I have opened Solr source code at Intellij IDEA as explained
> documentation.
> > I want to deploy Solr into Tomcat 7. When I open the project there are
> > configurations set previosly (I used ant idea command before I open the
> > project) . However they are all test configurations and some of them are
> > not passed test (this is another issue, no need to go detail at this
> > e-mail). I have added a Tomcat Local configuration into configurations
> but
> > I don't know which one is the main method of Solr and is there any
> > documentation that explains code. i.e. I want to debug a point what Solr
> > receives from when I say -index from nutch and what Solr does?
> >
> > I tried somehing to run code (I don't think I could generate a .war or an
> > exploded folder) an this is the error that I get:(I did't point any
> > artifact for edit configurations)
> >
> > Error: Exception thrown by the agent : java.net.MalformedURLException:
> > Local host name unknown: java.net.UnknownHostException: me.local:
> me.local:
> > Name or service not known
> >
> > (me.local is the name I set when I install Centos 6.4 on my computer)
> >
> > Any ideas how to run source code will be nice for me.
>
>

Re: How can I compile and debug Solr from source code?

Posted by Erik Hatcher <er...@gmail.com>.
Here's my development/debug workflow:

  - "ant idea" at the top-level to generate the IntelliJ project
  - cd solr; ant example - to build the full example
  - cd example; java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar start.jar - to launch Jetty+Solr in debug mode
  - set breakpoints in IntelliJ, set up a Remote run option (localhost:5005) in IntelliJ and debug pleasantly

All the unit tests in Solr run very nicely in IntelliJ too, and for tight development loops, I spend my time doing that instead of running full on Solr.

	Erik


On Mar 21, 2013, at 05:56 , Furkan KAMACI wrote:

> I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
> 
> I have opened Solr source code at Intellij IDEA as explained documentation.
> I want to deploy Solr into Tomcat 7. When I open the project there are
> configurations set previosly (I used ant idea command before I open the
> project) . However they are all test configurations and some of them are
> not passed test (this is another issue, no need to go detail at this
> e-mail). I have added a Tomcat Local configuration into configurations but
> I don't know which one is the main method of Solr and is there any
> documentation that explains code. i.e. I want to debug a point what Solr
> receives from when I say -index from nutch and what Solr does?
> 
> I tried somehing to run code (I don't think I could generate a .war or an
> exploded folder) an this is the error that I get:(I did't point any
> artifact for edit configurations)
> 
> Error: Exception thrown by the agent : java.net.MalformedURLException:
> Local host name unknown: java.net.UnknownHostException: me.local: me.local:
> Name or service not known
> 
> (me.local is the name I set when I install Centos 6.4 on my computer)
> 
> Any ideas how to run source code will be nice for me.


Re: How can I compile and debug Solr from source code?

Posted by Steve Rowe <sa...@gmail.com>.
As solr/README.txt says in the "Instructions for Building Apache Solr from Source" section: "4.Navigate to the "solr" folder and issue an "ant" command to see the available options for building, testing, and packaging Solr."

PROMPT$ ant
Buildfile: /Users/sarowe/svn/lucene/dev/branches/branch_4x/solr/build.xml
     [echo] Building solr...

usage:
     [echo] Welcome to the Solr project!
     [echo] Use 'ant example' to create a runnable example configuration.
     [echo] Use 'ant run-example' to create and run the example.
     [echo] And for developers:
     [echo] Use 'ant clean' to clean compiled files.
     [echo] Use 'ant compile' to compile the source code.
     [echo] Use 'ant dist' to build the project WAR and JAR files.
     [echo] Use 'ant documentation' to build documentation.
     [echo] Use 'ant generate-maven-artifacts' to generate maven artifacts.
     [echo] Use 'ant package' to generate zip, tgz for distribution.
     [echo] Use 'ant test' to run unit tests.

Sounds like you want 'ant dist', which will create the .war and put it into the solr/dist/ directory:

Steve

On Mar 21, 2013, at 5:22 PM, Furkan KAMACI <fu...@gmail.com> wrote:

> Using embedded is an option. However I see that there is a .war file inside
> Solr source code. So that means that I can generate a .war file and deploy
> it to Tomcat or something like that. My main question arises here. How can
> I generate a .war file from my customized Solr source code? That's why I
> mentioned tomcat. Any ideas?
> 
> 2013/3/21 Shawn Heisey <so...@elyograg.org>
> 
>> On 3/21/2013 6:56 AM, Furkan KAMACI wrote:
>> 
>>> I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
>>> 
>>> I have opened Solr source code at Intellij IDEA as explained
>>> documentation.
>>> I want to deploy Solr into Tomcat 7. When I open the project there are
>>> configurations set previosly (I used ant idea command before I open the
>>> project) . However they are all test configurations and some of them are
>>> not passed test (this is another issue, no need to go detail at this
>>> e-mail). I have added a Tomcat Local configuration into configurations but
>>> I don't know which one is the main method of Solr and is there any
>>> documentation that explains code. i.e. I want to debug a point what Solr
>>> receives from when I say -index from nutch and what Solr does?
>>> 
>>> I tried somehing to run code (I don't think I could generate a .war or an
>>> exploded folder) an this is the error that I get:(I did't point any
>>> artifact for edit configurations)
>>> 
>>> Error: Exception thrown by the agent : java.net.**MalformedURLException:
>>> Local host name unknown: java.net.UnknownHostException: me.local:
>>> me.local:
>>> Name or service not known
>>> 
>> 
>> There actually isn't a way to execute Solr itself, it doesn't have a main
>> method.  Solr is a servlet, so it requires a servlet container to run.  The
>> container that it ships with is jetty.  You have mentioned tomcat.
>> 
>> I don't know how you might go about running tomcat and Solr within
>> IntelliJ.  Perhaps someone else here might.  The debugging instructions on
>> the wiki for IntelliJ seem to indicate that you debug remotely and start
>> the included jetty with some special options:
>> 
>> http://wiki.apache.org/lucene-**java/HowtoConfigureIntelliJ<http://wiki.apache.org/lucene-java/HowtoConfigureIntelliJ>
>> 
>> If you do figure out how to get IntelliJ to deploy directly to a locally
>> installed tomcat, please update the wiki with the steps required.
>> 
>> Thanks,
>> Shawn
>> 
>> 


Re: How can I compile and debug Solr from source code?

Posted by Furkan KAMACI <fu...@gmail.com>.
Using embedded is an option. However I see that there is a .war file inside
Solr source code. So that means that I can generate a .war file and deploy
it to Tomcat or something like that. My main question arises here. How can
I generate a .war file from my customized Solr source code? That's why I
mentioned tomcat. Any ideas?

2013/3/21 Shawn Heisey <so...@elyograg.org>

> On 3/21/2013 6:56 AM, Furkan KAMACI wrote:
>
>> I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
>>
>> I have opened Solr source code at Intellij IDEA as explained
>> documentation.
>> I want to deploy Solr into Tomcat 7. When I open the project there are
>> configurations set previosly (I used ant idea command before I open the
>> project) . However they are all test configurations and some of them are
>> not passed test (this is another issue, no need to go detail at this
>> e-mail). I have added a Tomcat Local configuration into configurations but
>> I don't know which one is the main method of Solr and is there any
>> documentation that explains code. i.e. I want to debug a point what Solr
>> receives from when I say -index from nutch and what Solr does?
>>
>> I tried somehing to run code (I don't think I could generate a .war or an
>> exploded folder) an this is the error that I get:(I did't point any
>> artifact for edit configurations)
>>
>> Error: Exception thrown by the agent : java.net.**MalformedURLException:
>> Local host name unknown: java.net.UnknownHostException: me.local:
>> me.local:
>> Name or service not known
>>
>
> There actually isn't a way to execute Solr itself, it doesn't have a main
> method.  Solr is a servlet, so it requires a servlet container to run.  The
> container that it ships with is jetty.  You have mentioned tomcat.
>
> I don't know how you might go about running tomcat and Solr within
> IntelliJ.  Perhaps someone else here might.  The debugging instructions on
> the wiki for IntelliJ seem to indicate that you debug remotely and start
> the included jetty with some special options:
>
> http://wiki.apache.org/lucene-**java/HowtoConfigureIntelliJ<http://wiki.apache.org/lucene-java/HowtoConfigureIntelliJ>
>
> If you do figure out how to get IntelliJ to deploy directly to a locally
> installed tomcat, please update the wiki with the steps required.
>
> Thanks,
> Shawn
>
>

Re: How can I compile and debug Solr from source code?

Posted by Shawn Heisey <so...@elyograg.org>.
On 3/21/2013 6:56 AM, Furkan KAMACI wrote:
> I use Intellij Idea 12 and Solr 4.1 on a Centos 6.4 64 bit computer.
>
> I have opened Solr source code at Intellij IDEA as explained documentation.
> I want to deploy Solr into Tomcat 7. When I open the project there are
> configurations set previosly (I used ant idea command before I open the
> project) . However they are all test configurations and some of them are
> not passed test (this is another issue, no need to go detail at this
> e-mail). I have added a Tomcat Local configuration into configurations but
> I don't know which one is the main method of Solr and is there any
> documentation that explains code. i.e. I want to debug a point what Solr
> receives from when I say -index from nutch and what Solr does?
>
> I tried somehing to run code (I don't think I could generate a .war or an
> exploded folder) an this is the error that I get:(I did't point any
> artifact for edit configurations)
>
> Error: Exception thrown by the agent : java.net.MalformedURLException:
> Local host name unknown: java.net.UnknownHostException: me.local: me.local:
> Name or service not known

There actually isn't a way to execute Solr itself, it doesn't have a 
main method.  Solr is a servlet, so it requires a servlet container to 
run.  The container that it ships with is jetty.  You have mentioned tomcat.

I don't know how you might go about running tomcat and Solr within 
IntelliJ.  Perhaps someone else here might.  The debugging instructions 
on the wiki for IntelliJ seem to indicate that you debug remotely and 
start the included jetty with some special options:

http://wiki.apache.org/lucene-java/HowtoConfigureIntelliJ

If you do figure out how to get IntelliJ to deploy directly to a locally 
installed tomcat, please update the wiki with the steps required.

Thanks,
Shawn