Solved

maven pom error  -- missing tools.jar

Posted on 2014-01-16
4
4,014 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

772 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

9 Experts available now in Live!

Get 1:1 Help Now