Solved

maven pom error  -- missing tools.jar

Posted on 2014-01-16
4
4,195 Views
Last Modified: 2014-01-17
Hello ,
  I have many issue getting my code to work in tomcat. One of error I get now is "Missing artifact jdk.tools:jdk.tools:jar:1.7" How do I resolve this issue

Thanks
pom.xml
0
Comment
Question by:SiemensSEN
  • 3
4 Comments
 
LVL 6

Accepted Solution

by:
Mahesh Bhutkar earned 200 total points
ID: 39787715
The tools.jar must be inside your JDK path.
Check  Java\jdk1.7.0\lib\tools.jar

Go windows -> settings -> Java -> installed JREs -> select JDK and click Edit -> click Add External JARs and add tools.jar (placed in JDK/lib)

Also you can add dependency inside your pom file,
<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <scope>system</scope>
    <systemPath>${JAVA_HOME}/../lib/tools.jar</systemPath>
</dependency>

and then reference it like this,
<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <version>1.7</version>
</dependency>
0
 

Author Comment

by:SiemensSEN
ID: 39789014
Thanks.

My program works from within eclipse However, when I deploy the war in tomcat it fails with error below..


Thanks for your help

Servlet.init() for servlet LogServerController threw exception
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
	java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	java.lang.Thread.run(Unknown Source)
</pre></p><p><b>root cause</b> <pre>java.lang.IncompatibleClassChangeError: Class org.apache.log4j.Logger does not implement the requested interface org.slf4j.Logger
	org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(HttpClientUtil.java:103)
	org.apache.solr.client.solrj.impl.HttpSolrServer.&lt;init&gt;(HttpSolrServer.java:159)
	org.apache.solr.client.solrj.impl.HttpSolrServer.&lt;init&gt;(HttpSolrServer.java:132)
	net.ansible.platform.logmanager.ui.LogServerController.init(LogServerController.java:51)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
	java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	java.lang.Thread.run(Unknown Source)

Open in new window

0
 

Author Comment

by:SiemensSEN
ID: 39789086
I was to get pass the error above but now a new error . It works from within eclipse..

.java.lang.NoClassDefFoundError: Could not initialize class org.apache.solr.client.solrj.impl.HttpSolrServer
0
 

Author Comment

by:SiemensSEN
ID: 39789364
I think it's working now.

In Eclipse
maven clean
Maven update project
Maven build

also, had to put the dependency in this order::

logback-core
lf4j-api
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to add new optional parameter to JSP 1 42
Way to decrease size of apk file 9 69
tomcat startup error 5 65
jboss wildfly 10.1 10 94
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question