High bing,

If you compile your project with solrj jars, you should just make sure they
are explicitly listed in your classpath, not only the directory that
contains them.
You could start with a clean (not maven) java project in NetBeans, create
your class and add the jar dependencies via: right click project node ->
Properties -> Libraries -> Add JAR/Folder

Add the solrj related jars and try to compile.

Dmitry

On Thu, Feb 2, 2012 at 6:19 AM, bing <nibing_...@hotmail.com> wrote:

> Hi, all,
>
> Following the previous topic, if I abandon my own code and try to build a
> project with the original package apache-solr-3.5.0-src, I failed again.
> Following are the description of some technical details, and I hope someone
> can help to point out my mistakes.
>
> What I Have
> Besides the tools mentioned above, I install the following tool:
> NetBeans 7 IDE
>
> What I Set
> 2. Pom.xml in C:\apache-solr-3.5.0-src\apache-solr-3.5.0\
> Adding the following dependency:
>          <dependency>
>           <groupId>org.apache.solr</groupId>
>           <artifactId>solr-solrj</artifactId>
>           <version>3.5.0</version>
>          </dependency>
>
>
> What I Did:
> 2. Open the project by loading the original package apache-solr-3.5.0-src,
> and try to build it in NetBeans.
>
> What I Get:
> 2. Following are part of the messages shown in the output :
>
> ------------------------------------------------------------------------
> BUILD FAILURE
> ------------------------------------------------------------------------
> Total time: 5:39.460s
> Finished at: Thu Feb 02 11:00:45 CST 2012
> Final Memory: 28M/129M
> ------------------------------------------------------------------------
> Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on
> project lucene-core: There are test failures.
>
> Please refer to
> C:\apache-solr-3.5.0-src\apache-solr-3.5.0\lucene\build\surefire-reports
> for
> the individual test results.
> -> [Help 1]
>
> To see the full stack trace of the errors, re-run Maven with the -e switch.
> Re-run Maven using the -X switch to enable full debug logging.
>
> For more information about the errors and possible solutions, please read
> the following articles:
> [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>
> After correcting the problems, you can resume the build with the command
>  mvn <goals> -rf :lucene-core
> 'cmd' is not recognized as an internal or external command,
> operable program or batch file.
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Fail-to-compile-Java-code-trying-to-use-SolrJ-with-Solr-tp3708902p3708923.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Regards,

Dmitry Kan

Reply via email to