You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Maulin Rathod <mn...@gmail.com> on 2022/11/09 15:02:25 UTC
Problem in importing project in Eclipse
Hi,
I am a developer with 15 year experience and using Solr for the last 7-8
years. Now I want to contribute to solr...
I followed the instructions provided on this link to import the project in
Eclipse.
https://cwiki.apache.org/confluence/display/solr/HowToContribute
After checking the main branch locally (git clone
http://gitbox.apache.org/repos/asf/solr.git), when I import (using *Existing
Gradle Project* option) in eclipse, the build process is stuck at around 5%
with thousands of errors. Refer below screenshot.
Am I missing something? Please help...
[image: image.png]
Re: Problem in importing project in Eclipse
Posted by Shawn Heisey <ap...@elyograg.org>.
On 11/9/22 08:02, Maulin Rathod wrote:
> I am a developer with 15 year experience and using Solr for the last
> 7-8 years. Now I want to contribute to solr...
>
> I followed the instructions provided on this link to import the
> project in Eclipse.
>
> https://cwiki.apache.org/confluence/display/solr/HowToContribute
>
> After checking the main branch locally (git clone
> http://gitbox.apache.org/repos/asf/solr.git), when I import (using
> *Existing Gradle Project* option) in eclipse, the build process is
> stuck at around 5% with thousands of errors. Refer below screenshot.
Your screenshot did not come through. Attachments sent to the mailing
list rarely make it through.
You should run "./gradlew clean cleanEclipse eclipse" before you import
the project. Then it will be an eclipse project that gets imported, not
a gradle project. This is on the wiki article you linked, but does not
include the "clean" and "cleanEclipse" targets that I added.
For Windows, you must install perl and remove the "./" part from the
gradlew command, and run it in a command prompt. Elevation of the
command prompt should not be required. I know for sure that Strawberry
Perl works, but I think that something like ActivePerl would also work.
Note that Java 19 is not yet supported by Gradle, so you must use a JDK
version between 11 and 17 on any OS. Only versions 11 and 17 are
recommended. I think 14 is also an LTS release, but it isn't often
referenced. I have no idea whether Java 18 works, but I wouldn't
recommend using it as it is an interim release that I believe is no
longer supported.
I just did these steps with branch_9x (the branch I already had checked
out) and there are still a few errors. One class with the same name as
another in a different package, and the existence of package-info.java
files for the same package in both the test and src trees. Fixing those
was pretty easy, I need to work on getting that into the codebase.
Did it with the main branch, I ran into the same errors and fixed them
the same way. The patches for both main and branch_9x are identical.
Thanks,
Shawn
Re: Problem in importing project in Eclipse
Posted by Maulin Rathod <mn...@gmail.com>.
Hi Shawn,
I am able to build successfully using .\gradlew clean dev command. Thanks
for your help.
I want to add/modify solr code (e.g. Adding new plugin/Stream Decorator)
and debug it locally.
https://solr.apache.org/guide/8_4/solr-plugins.html - This link provides
details about existing plugins but details not available for creating own
plugins.
Is there any documentation which describes how to create a new
plugin/Stream Decorator?
Regards,
Maulin
On Fri, Nov 11, 2022 at 7:36 AM Shawn Heisey <ap...@elyograg.org> wrote:
> On 11/10/2022 2:39 PM, Shawn Heisey wrote:
> > My tests above were done on Ubuntu Server 22.04. I will try it on a
> > Windows 10 pro machine and reply back if I have any problems with that.
>
> Installed Strawberry Perl, Git for Windows, and Temurin JDK 17.
>
> The build failed, with a different error than you are getting.
>
> ---
> > Task :checkJdkInternalsExportedToGradle FAILED
>
> FAILURE: Build failed with an exception.
>
> * Where:
> Script
> 'C:\Users\elyograg\git\solr\gradle\generation\local-settings.gradle'
> line: 42
>
> * What went wrong:
> Execution failed for task ':checkJdkInternalsExportedToGradle'.
> > Certain gradle tasks and plugins require access to jdk.compiler
> internals, your gradle.properties might have just been generated or
> could be out of sync (see help/localSettings.txt)
>
> * Try:
> > Run with --stacktrace option to get the stack trace.
> > Run with --info or --debug option to get more log output.
> > Run with --scan to get full insights.
>
> * Get more help at https://help.gradle.org
>
> Deprecated Gradle features were used in this build, making it
> incompatible with Gradle 8.0.
>
> You can use '--warning-mode all' to show the individual deprecation
> warnings and determine if they come from your own scripts or plugins.
>
> See
>
> https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
>
> BUILD FAILED in 5m 41s
> 185 actionable tasks: 185 executed
> Error: Something went wrong. Make sure you're using Java 11 - 18.
> ---
>
> I found that an issue had been filed against something called OpenSearch
> for the same problem. The fix was apparently this commit:
>
> https://github.com/opensearch-project/OpenSearch/pull/3396/files
>
> So what I tried next was ".\gradlew clean localSettings build" ... and
> that gave me the same error you're getting.
>
> With the --info build option I saw the following. It might have been
> there before adding --info, but on that build I hadn't scrolled up.
>
> ---
> > Task :solr:documentation:checkBrokenLinks FAILED
> Caching disabled for task ':solr:documentation:checkBrokenLinks' because:
> Build cache is disabled
> Task ':solr:documentation:checkBrokenLinks' is not up-to-date because:
> Task has failed previously.
> External tool 'python3' resolved to: python3
> Starting process 'command 'python3''. Working directory:
> C:\Users\elyograg\git\solr\solr\documentation Command: python3 -B
> C:\Users\elyograg\git\solr\dev-tools\scripts\checkJavadocLinks.py
> C:\Users\elyograg\git\solr\solr\documentation\build\site
> Successfully started process 'command 'python3''
> :solr:documentation:checkBrokenLinks (Thread[Execution worker Thread
> 3,5,main]) completed. Took 0.383 secs.
> ---
>
> I manually tried running 'python3' and that fired up the Microsoft Store
> where I could download python. Which I did, then tried the same gradlew
> command again.
>
> Now it gets past the error you are getting and I am seeing failed tests.
>
> What is your goal with building Solr from source? If you're trying to
> build something you can run, then you want ".\gradlew clean dev" and if
> you're trying to make a package like what you can download, you want
> ".\gradlew clean distTar" or ".\gradlew clean assemble". These targets
> only require perl, not python. The build target requires python3 and
> runs all the tests, which takes a long time and often fails. And until
> we can fix the problem in the codebase, if you really do want the build
> target, you will need to add localSettings before it.
>
> Thanks,
> Shawn
>
>
--
Regards,
Maulin Rathod
Development Director
Asite Solution Pvt Ltd.
M: 9723286945
E : mnrathod@gmail.com
W: www.asite.com
Re: Problem in importing project in Eclipse
Posted by Maulin Rathod <mn...@gmail.com>.
Thanks Shawn for the detailed response.
In my use case, I want to fetch data from multiple collections. so I want
to use the stream expression (innerJoin decorator for joining collections).
But I can't see (on this
https://solr.apache.org/guide/8_7/stream-decorator-reference.html#stream-decorator-reference
) any decorator that can help to implement paging. so I am planning to
implement a skip/limit decorator to support paging.
On Fri, Nov 11, 2022 at 7:46 PM Shawn Heisey <ap...@elyograg.org> wrote:
> On 11/11/22 00:32, Maulin Rathod wrote:
> > On Windows, I have installed python3 and now I am able to execute
> > '.\gradlew clean dev' successfully.
> >
> > I want to add/modify solr code (e.g. Adding new plugin/Stream Decorator)
> > and debug it locally.
> > Is there any documentation which describes how to create a new
> > plugin/Stream Decorator?
>
> I don't think there is. Your best option is to examine code in Solr or
> Lucene for existing classes of the same sort of plugin you want to
> create and use that as a template for your plugin. What kind of plugin
> did you want to write? There are a lot of possibilities. Somebody here
> can figure out what class to use for inspiration. If you are wanting to
> do a stream decorator (your question includes that) then I have no idea
> what class in Solr you would want to use as astarting point. I can't
> find any examples when I search the codebase, so apparently I do not
> know what to search for.
>
> As for the way to build a project for the plugin, use your favorite Java
> project building mechanism and have it add solr-core as a compile
> dependency, but not a build dependency. I generally use
> https://start.spring.io to build a new project and import that into
> eclipse. The nice thing about that is that when you compile it, you'll
> get two jars ... one with just your code and one with all the
> dependencies included. You would most likely want to use the one with
> just your code. It's a bad idea for a plugin to include any classes
> already loaded into Solr. That tends to cause problems, even if those
> classes are identical to what Solr already has.
>
> Thanks,
> Shawn
>
>
--
Regards,
Maulin Rathod
Development Director
Asite Solution Pvt Ltd.
M: 9723286945
E : mnrathod@gmail.com
W: www.asite.com
Re: Problem in importing project in Eclipse
Posted by Shawn Heisey <ap...@elyograg.org>.
On 11/11/22 00:32, Maulin Rathod wrote:
> On Windows, I have installed python3 and now I am able to execute
> '.\gradlew clean dev' successfully.
>
> I want to add/modify solr code (e.g. Adding new plugin/Stream Decorator)
> and debug it locally.
> Is there any documentation which describes how to create a new
> plugin/Stream Decorator?
I don't think there is. Your best option is to examine code in Solr or
Lucene for existing classes of the same sort of plugin you want to
create and use that as a template for your plugin. What kind of plugin
did you want to write? There are a lot of possibilities. Somebody here
can figure out what class to use for inspiration. If you are wanting to
do a stream decorator (your question includes that) then I have no idea
what class in Solr you would want to use as astarting point. I can't
find any examples when I search the codebase, so apparently I do not
know what to search for.
As for the way to build a project for the plugin, use your favorite Java
project building mechanism and have it add solr-core as a compile
dependency, but not a build dependency. I generally use
https://start.spring.io to build a new project and import that into
eclipse. The nice thing about that is that when you compile it, you'll
get two jars ... one with just your code and one with all the
dependencies included. You would most likely want to use the one with
just your code. It's a bad idea for a plugin to include any classes
already loaded into Solr. That tends to cause problems, even if those
classes are identical to what Solr already has.
Thanks,
Shawn
Re: Problem in importing project in Eclipse
Posted by Maulin Rathod <mn...@gmail.com>.
On Windows, I have installed python3 and now I am able to execute
'.\gradlew clean dev' successfully.
I want to add/modify solr code (e.g. Adding new plugin/Stream Decorator)
and debug it locally.
Is there any documentation which describes how to create a new
plugin/Stream Decorator?
On Fri, Nov 11, 2022 at 9:17 AM Shawn Heisey <ap...@elyograg.org> wrote:
> On 11/10/22 19:04, Shawn Heisey wrote:
> > Now it gets past the error you are getting and I am seeing failed tests.
>
> I haven't yet gotten a good run on Windows. The tests seem to fail a
> lot more there.
>
> One problem might be that my Windows machine has a 4-core 7th generation
> Intel desktop CPU and my Linux server has two 12-core Xeon CPUs. The
> server is quite a bit faster than the desktop. When I looked into one of
> the test failures, it failed with this message, which certainly sounds
> like an issue with test performance:
>
> java.lang.Exception: Custom 'security.json' not applied in 10000ms
>
> If you really do need the build target, you're going to need to install
> python. Just running python3, from a command prompt, powershell, or
> even the Run box or start menu, will open the python page on the
> Microsoft Store and it's easy to install from there. Perl is also
> required.
>
> I need to look into why building no longer works in Git Bash, which is
> part of Git for Windows. It used to work.
>
> Thanks,
> Shawn
>
>
--
Regards,
Maulin Rathod
Development Director
Asite Solution Pvt Ltd.
M: 9723286945
E : mnrathod@gmail.com
W: www.asite.com
Re: Problem in importing project in Eclipse
Posted by Shawn Heisey <ap...@elyograg.org>.
On 11/10/22 19:04, Shawn Heisey wrote:
> Now it gets past the error you are getting and I am seeing failed tests.
I haven't yet gotten a good run on Windows. The tests seem to fail a
lot more there.
One problem might be that my Windows machine has a 4-core 7th generation
Intel desktop CPU and my Linux server has two 12-core Xeon CPUs. The
server is quite a bit faster than the desktop. When I looked into one of
the test failures, it failed with this message, which certainly sounds
like an issue with test performance:
java.lang.Exception: Custom 'security.json' not applied in 10000ms
If you really do need the build target, you're going to need to install
python. Just running python3, from a command prompt, powershell, or
even the Run box or start menu, will open the python page on the
Microsoft Store and it's easy to install from there. Perl is also required.
I need to look into why building no longer works in Git Bash, which is
part of Git for Windows. It used to work.
Thanks,
Shawn
Re: Problem in importing project in Eclipse
Posted by Shawn Heisey <ap...@elyograg.org>.
On 11/10/2022 2:39 PM, Shawn Heisey wrote:
> My tests above were done on Ubuntu Server 22.04. I will try it on a
> Windows 10 pro machine and reply back if I have any problems with that.
Installed Strawberry Perl, Git for Windows, and Temurin JDK 17.
The build failed, with a different error than you are getting.
---
> Task :checkJdkInternalsExportedToGradle FAILED
FAILURE: Build failed with an exception.
* Where:
Script
'C:\Users\elyograg\git\solr\gradle\generation\local-settings.gradle'
line: 42
* What went wrong:
Execution failed for task ':checkJdkInternalsExportedToGradle'.
> Certain gradle tasks and plugins require access to jdk.compiler
internals, your gradle.properties might have just been generated or
could be out of sync (see help/localSettings.txt)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation
warnings and determine if they come from your own scripts or plugins.
See
https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5m 41s
185 actionable tasks: 185 executed
Error: Something went wrong. Make sure you're using Java 11 - 18.
---
I found that an issue had been filed against something called OpenSearch
for the same problem. The fix was apparently this commit:
https://github.com/opensearch-project/OpenSearch/pull/3396/files
So what I tried next was ".\gradlew clean localSettings build" ... and
that gave me the same error you're getting.
With the --info build option I saw the following. It might have been
there before adding --info, but on that build I hadn't scrolled up.
---
> Task :solr:documentation:checkBrokenLinks FAILED
Caching disabled for task ':solr:documentation:checkBrokenLinks' because:
Build cache is disabled
Task ':solr:documentation:checkBrokenLinks' is not up-to-date because:
Task has failed previously.
External tool 'python3' resolved to: python3
Starting process 'command 'python3''. Working directory:
C:\Users\elyograg\git\solr\solr\documentation Command: python3 -B
C:\Users\elyograg\git\solr\dev-tools\scripts\checkJavadocLinks.py
C:\Users\elyograg\git\solr\solr\documentation\build\site
Successfully started process 'command 'python3''
:solr:documentation:checkBrokenLinks (Thread[Execution worker Thread
3,5,main]) completed. Took 0.383 secs.
---
I manually tried running 'python3' and that fired up the Microsoft Store
where I could download python. Which I did, then tried the same gradlew
command again.
Now it gets past the error you are getting and I am seeing failed tests.
What is your goal with building Solr from source? If you're trying to
build something you can run, then you want ".\gradlew clean dev" and if
you're trying to make a package like what you can download, you want
".\gradlew clean distTar" or ".\gradlew clean assemble". These targets
only require perl, not python. The build target requires python3 and
runs all the tests, which takes a long time and often fails. And until
we can fix the problem in the codebase, if you really do want the build
target, you will need to add localSettings before it.
Thanks,
Shawn
Re: Problem in importing project in Eclipse
Posted by Shawn Heisey <ap...@elyograg.org>.
On 11/10/22 09:17, Maulin Rathod wrote:
> Hi Joshua, Shawn
>
> Thanks for your help.
>
> Now I am able to import project in eclipse.
>
> Now when I execute below build command (for main branch) it fails with the
> below exception.
>
> PS D:\solr\SolrReadwrite\solr> ./gradlew build
>
> FAILURE: Build failed with an exception.
>
> Task :solr:documentation:checkBrokenLinks FAILED
I had never actually used the build target.
[final jeopardy music while running "./gradlew build" on a fully
up-to-date main branch]
BUILD SUCCESSFUL in 21m 20s
That takes a lot longer to run than the "dev" or "distTar" targets,
which are what I normally use to get something I can either run or
install. I occasionally use the "check" target which takes several
minutes longer than build did.
After I did the above build, I ran "./gradlew clean distTar" and it took
1m 4s. The distTar target on main creates a solr-10.0.0-SNAPSHOT.tgz
file that works just like the binary downloads you can get from the Solr
website.
You might try doing "./gradlew clean build" instead, to make sure any
existing build artifacts are gone, or use a different target depending
on what it is you're after. Do you have perl installed on the Windows
machine? The build system does use perl, and it would need to be on the
PATH that the command prompt uses.
My tests above were done on Ubuntu Server 22.04. I will try it on a
Windows 10 pro machine and reply back if I have any problems with that.
Thanks,
Shawn
Re: Problem in importing project in Eclipse
Posted by Maulin Rathod <mn...@gmail.com>.
Hi Joshua, Shawn
Thanks for your help.
Now I am able to import project in eclipse.
Now when I execute below build command (for main branch) it fails with the
below exception.
PS D:\solr\SolrReadwrite\solr> ./gradlew build
FAILURE: Build failed with an exception.
Task :solr:documentation:checkBrokenLinks FAILED
In "check-broken-links-output.txt" file it complains about
BROKEN LINK:
file:///D%3A/solr/SolrReadwrite/solr/solr/documentation/build/site/core/org/apache/solr/common.SolrInputDocument.html
Actually SolrInputDocument.html is available in different location. i.e.
instead of "core" its available in "solrj"...
D:\solr\SolrReadwrite\solr\solr\documentation\build\site\solrj\org\apache\solr\common.SolrInputDocument.html
How can I fix this?
On Wed, Nov 9, 2022 at 9:43 PM Joshua Ouma <jo...@gmail.com> wrote:
> To add on Shawn comment after building the project, click on file menu
> then open projects from file system.
>
> On Wed, Nov 9, 2022 at 6:45 PM Maulin Rathod <mn...@gmail.com> wrote:
>
> > Thanks Joshua. Can you please help with more details (with some steps)
> > about how to import in eclipse? Or point to some link where steps are
> > mentioned for importing solr project in eclipse?
> >
> >
> >
> > On Wed, Nov 9, 2022 at 8:41 PM Joshua Ouma <jo...@gmail.com>
> wrote:
> >
> > > Hi Mualin,
> > >
> > > After executing the grade task. Don't import as an existing gradle
> > project
> > > but from folder(not sure of the exact wording)
> > >
> > > On Wed, 9 Nov 2022, 18:02 Maulin Rathod, <mn...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > I am a developer with 15 year experience and using Solr for the last
> > 7-8
> > > > years. Now I want to contribute to solr...
> > > >
> > > > I followed the instructions provided on this link to import the
> project
> > > in
> > > > Eclipse.
> > > >
> > > > https://cwiki.apache.org/confluence/display/solr/HowToContribute
> > > >
> > > > After checking the main branch locally (git clone
> > > > http://gitbox.apache.org/repos/asf/solr.git), when I import (using
> > > *Existing
> > > > Gradle Project* option) in eclipse, the build process is stuck at
> > around
> > > > 5% with thousands of errors. Refer below screenshot.
> > > >
> > > > Am I missing something? Please help...
> > > >
> > > >
> > > > [image: image.png]
> > > >
> > >
> >
> >
> > --
> > Regards,
> >
> > Maulin Rathod
> > Development Director
> > Asite Solution Pvt Ltd.
> >
> > M: 9723286945
> > E : mnrathod@gmail.com
> > W: www.asite.com
> >
>
--
Regards,
Maulin Rathod
Development Director
Asite Solution Pvt Ltd.
M: 9723286945
E : mnrathod@gmail.com
W: www.asite.com
Re: Problem in importing project in Eclipse
Posted by Joshua Ouma <jo...@gmail.com>.
To add on Shawn comment after building the project, click on file menu
then open projects from file system.
On Wed, Nov 9, 2022 at 6:45 PM Maulin Rathod <mn...@gmail.com> wrote:
> Thanks Joshua. Can you please help with more details (with some steps)
> about how to import in eclipse? Or point to some link where steps are
> mentioned for importing solr project in eclipse?
>
>
>
> On Wed, Nov 9, 2022 at 8:41 PM Joshua Ouma <jo...@gmail.com> wrote:
>
> > Hi Mualin,
> >
> > After executing the grade task. Don't import as an existing gradle
> project
> > but from folder(not sure of the exact wording)
> >
> > On Wed, 9 Nov 2022, 18:02 Maulin Rathod, <mn...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > I am a developer with 15 year experience and using Solr for the last
> 7-8
> > > years. Now I want to contribute to solr...
> > >
> > > I followed the instructions provided on this link to import the project
> > in
> > > Eclipse.
> > >
> > > https://cwiki.apache.org/confluence/display/solr/HowToContribute
> > >
> > > After checking the main branch locally (git clone
> > > http://gitbox.apache.org/repos/asf/solr.git), when I import (using
> > *Existing
> > > Gradle Project* option) in eclipse, the build process is stuck at
> around
> > > 5% with thousands of errors. Refer below screenshot.
> > >
> > > Am I missing something? Please help...
> > >
> > >
> > > [image: image.png]
> > >
> >
>
>
> --
> Regards,
>
> Maulin Rathod
> Development Director
> Asite Solution Pvt Ltd.
>
> M: 9723286945
> E : mnrathod@gmail.com
> W: www.asite.com
>
Re: Problem in importing project in Eclipse
Posted by Maulin Rathod <mn...@gmail.com>.
Thanks Joshua. Can you please help with more details (with some steps)
about how to import in eclipse? Or point to some link where steps are
mentioned for importing solr project in eclipse?
On Wed, Nov 9, 2022 at 8:41 PM Joshua Ouma <jo...@gmail.com> wrote:
> Hi Mualin,
>
> After executing the grade task. Don't import as an existing gradle project
> but from folder(not sure of the exact wording)
>
> On Wed, 9 Nov 2022, 18:02 Maulin Rathod, <mn...@gmail.com> wrote:
>
> > Hi,
> >
> > I am a developer with 15 year experience and using Solr for the last 7-8
> > years. Now I want to contribute to solr...
> >
> > I followed the instructions provided on this link to import the project
> in
> > Eclipse.
> >
> > https://cwiki.apache.org/confluence/display/solr/HowToContribute
> >
> > After checking the main branch locally (git clone
> > http://gitbox.apache.org/repos/asf/solr.git), when I import (using
> *Existing
> > Gradle Project* option) in eclipse, the build process is stuck at around
> > 5% with thousands of errors. Refer below screenshot.
> >
> > Am I missing something? Please help...
> >
> >
> > [image: image.png]
> >
>
--
Regards,
Maulin Rathod
Development Director
Asite Solution Pvt Ltd.
M: 9723286945
E : mnrathod@gmail.com
W: www.asite.com
Re: Problem in importing project in Eclipse
Posted by Joshua Ouma <jo...@gmail.com>.
Hi Mualin,
After executing the grade task. Don't import as an existing gradle project
but from folder(not sure of the exact wording)
On Wed, 9 Nov 2022, 18:02 Maulin Rathod, <mn...@gmail.com> wrote:
> Hi,
>
> I am a developer with 15 year experience and using Solr for the last 7-8
> years. Now I want to contribute to solr...
>
> I followed the instructions provided on this link to import the project in
> Eclipse.
>
> https://cwiki.apache.org/confluence/display/solr/HowToContribute
>
> After checking the main branch locally (git clone
> http://gitbox.apache.org/repos/asf/solr.git), when I import (using *Existing
> Gradle Project* option) in eclipse, the build process is stuck at around
> 5% with thousands of errors. Refer below screenshot.
>
> Am I missing something? Please help...
>
>
> [image: image.png]
>