Solved

maven pom error  -- missing tools.jar

Posted on 2014-01-16
4
4,312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

735 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