+1 to using IntelliJ's remote debugging facilities.

I've done this with Tomcat too - just edit catalina.sh to add the parameters to 
the JVM invocation that the IntelliJ remote run configuration suggests.

With Tomcat you'll have to build the war using the Ant build, but that's more 
sensible anyway, since that's the official/supported build.

Steve

On Dec 6, 2012, at 7:06 PM, Erick Erickson <erickerick...@gmail.com> wrote:

> Why do this? It's trivial to attach IntelliJ to a running solr, just create
> "remote" configuration. When you do, it'll give you parameters you'll be
> able to start Solr with and attach from IntelliJ, set breakpoints, etc.
> Something like:
> java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5900
> -jar start.jar
> 
> You'll get the parameters to start Solr with when you create the "remote"
> configuration in IntelliJ. Then, I do an "ant example" from
> <solrhome>/solr, go into the example dir and I'm off to the races. The
> "suspend=y" means that solr just sits there until you attach IntelliJ.
> 
> I suspect that if you've copied things around, if you change Solr you'll
> have a world of problems getting the changed jars to the right places.
> 
> It's a bit of a pain that when you do make changes to solr code, you have
> to do another "ant example" but if your goal is to simply step through Solr
> code, it's much easier to do a remote debugging session.
> 
> Best
> Erick
> 
> 
> On Wed, Dec 5, 2012 at 11:55 PM, Artyom <ice...@mail.ru> wrote:
> 
>> See the screenshots:
>> 
>> solr_idea1: adding an IDEA tomcat artifact
>> solr_idea2: adding an IDEA facet
>> solr_idea3: placing modules into the artifact (drag modules from the
>> "Available Elements" to <output root>) and the created facet
>> 
>> 
>> Среда,  5 декабря 2012, 7:28  от "sarowe [via Lucene]" <
>> ml-node+s472066n402448...@n3.nabble.com>:
>>> 
>>> 
>>> 
>> 
>> 
>>> 
>> 
>> 
>> 
>>> 
>> 
>>        Hi Artyom,
>>> 
>>> I don't use IntelliJ artifacts - I just edit/compile/test.
>>> 
>>> I can include this stuff in the IntelliJ configuration if you'll help me.
>> Can you share screenshots of what you're talking about, and/or IntelliJ
>> config files?
>>> 
>>> Steve
>>> 
>>> On Dec 5, 2012, at 8:24 AM, Artyom <[hidden email]> wrote:
>>> 
>>> 
>>>> InelliJ IDEA is not so intelligent with Solr: to fix this problem I've
>>>> dragged these modules into the IDEA's artifact (parent module is wrong):
>>>> 
>>>> analysis-common
>>>> analysis-extras
>>>> analysis-uima
>>>> clustering
>>>> codecs
>>>> codecs-resources
>>>> dataimporthandler
>>>> dataimporthandler-extras
>>>> lucene-core
>>>> lucene-core-resources
>>>> solr-core
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Cannot-run-Solr4-from-Intellij-Idea-tp4024233p4024452.html
>>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>> 
>> 
>> 
>> 
>> 
>> 
>>> 
>> 
>>> 
>> 
>>>> ----------------------------------------------------------------------
>>> 
>>> 
>> 
>>> If you reply to this email, your message will be added to the discussion
>> below:
>> 
>> http://lucene.472066.n3.nabble.com/Cannot-run-Solr4-from-Intellij-Idea-tp4024233p4024484.html
>> 
>> 
>>> 
>> 
>>                To unsubscribe from Cannot run Solr4 from Intellij Idea,
>> click here.
>>> 
>>                NAML
>> 
>>> 
>> 
>> 
>> 
>> 
>> 
>>> 
>> 
>> 
>> 
>> =?UTF-8?B?c29scl9pZGVhMS5wbmc=?= (102K) <
>> http://lucene.472066.n3.nabble.com/attachment/4024723/0/%3D%3FUTF-8%3FB%3Fc29scl9pZGVhMS5wbmc%3D%3F%3D
>>> 
>> =?UTF-8?B?c29scl9pZGVhMi5wbmc=?= (117K) <
>> http://lucene.472066.n3.nabble.com/attachment/4024723/1/%3D%3FUTF-8%3FB%3Fc29scl9pZGVhMi5wbmc%3D%3F%3D
>>> 
>> =?UTF-8?B?c29scl9pZGVhMy5wbmc=?= (148K) <
>> http://lucene.472066.n3.nabble.com/attachment/4024723/2/%3D%3FUTF-8%3FB%3Fc29scl9pZGVhMy5wbmc%3D%3F%3D
>>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Cannot-run-Solr4-from-Intellij-Idea-tp4024233p4024723.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>> 

Reply via email to