Solved

maven pom error  -- missing tools.jar

Posted on 2014-01-16
4
4,103 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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 only allow authenticated (logged in) users to access Spring restful service 3 48
oracle 11g 23 50
MySQL  on Tomcat 8 29
expectj telnet failing 5 26
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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 will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

920 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now