Axis Error Java.lang.runtimeexception No Compiler Found In Your Classpath
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up tools.jar missing - but only on the very first call (Tomcat 8/Java 8/ Axis) up vote 0 down vote favorite Now that I upgraded my webapp to Java 8, I'm running into strange classloading problem with an axis webservice that is running in Tomcat 8. The very first call to the webservice after installing the webapp will cause a RuntimeException and a "No compiler found in your classpath! (you may need to add 'tools.jar')" fault. All following calls to that webservice work correctly (apparently tools.jar is there after all?). The behaviour is reproducable by deleting the exploded webapp folder in the deploy directory. After the next tomcat start, the first call will fail again. If the exploded folder is already there, a tomcat restart does not cause the error. The error did not occur when tomcat/the webapp were still running with Java 7. Now, that Axis error has a long, long tradition. The solution in earlier times was to copy tools.jar into tomcats lib directory (Aka make tools.jar available in tomcats classpath). Its not there by default, because axis apparently runs with a JRE (even if you start tomcat with a JDK in JAVA_HOME). Sadly that did not help. I tried several ways to put tools.jar into tomcats classpath: I added it to the libs folder I added it to the classpath via setenv.bat I added it to the endorsed lib folder None helped, the very first call was still failing. I then played around with JAVA_HOME and JRE_HOME. Tomcat starts with a JRE whenever possible and only uses a JDK if you use some functions that need a JDK. I tried to get tomcat to use a JDK instad of a JRE, but the error persistet. So, question time: Whats the difference in classloading when tomcat explodes a webapp.war compared to the case that the war has already been exploded in an earlier server run? When starting, tomcat writes the following to the logfile: Server version: Apache Tomcat/8.0.15 Server built: Nov 2 2014 19:25:20 UTC Server number: 8.0.15.0 OS Name: Windows Server 2008 R2 OS Version: 6.1 Architecture: x86 JAVA_HOME: C:\Dev\Java\jdk1.8.0_25\jre JVM Version: 1.8.0_25-b18 JVM
o AXIS 1.4.Tanto quando eu acesso o Tomcat (localhost:8080) quanto quando eu acesso o happyaxis.jws do AXIS (localhot:8080/axis/happyaxis.jsp), o resultado tá perfeito. Porém, http://stackoverflow.com/questions/27965823/tools-jar-missing-but-only-on-the-very-first-call-tomcat-8-java-8-axis quando eu acesso um webservice (localhost:8080/axis/Wevservice01.jws?wsdl) que eu criei ele retorna o seguinte erro: AXIS error Sorry, something seems to have gone wrong... here are the details: Fault - ; nested http://www.guj.com.br/t/axis-error-no-compiler-found-in-your-classpath-you-may-need-to-add-tools-jar/153506 exception is: java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar') AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.RuntimeException: No compiler found in your classpath! (you may need to add 'tools.jar') faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:lapes03.PESQUISA O tools.jar está incluído no meu $CLASSPATH. Alguém poderia me dar um help?Desde já obrigado![b][/b] system 2015-12-29 20:17:22 UTC #2 Início Categorias Perguntas frequentes/Diretrizes Termos de Serviço Política de Privacidade Movido a Discourse, melhor visualizado com JavaScript ativado GUJ Discussões : últimos tópicos | categorias | GUJ Respostas
to add 'tools.jar')While trying to deploy a web service in Tomcat (1.5) with Axis 1.4, you may have encountered the above error message. If you have faced with http://programmingzona.blogspot.com/2008/03/axis-web-services-problem-no-compiler.html that, following information will help you in fixing it.If you are at servier side, this error may be logged in Tomcat log file as follows.- No compiler found in your classpath! (you may need to add 'tools.jar')java.lang.ClassNotFoundException: sun.tools.javac.Main at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355)....On client side, you'll receive this error as follows.Exception in thread "main" AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.RuntimeException: No compiler found in your classpath! (you axis error may need to add 'tools.jar') faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:myhostSo the obvious solution you would try is adding %JAVA_HOME%\lib\tools.jar into your CLASSPATH variable even if you were at server side or the client side. But this will not solve the issue.Solution: Copy %JAVA_HOME%\lib\tools.jar file into %CATALINA_HOME%\common\lib folder and restart tomcat.Why %JAVA_HOME%\lib\tools.jar is not identified?If you check happyaxis.jsp page (http://127.0.0.1:8080/axis/happyaxis.jsp); under "Examining System Properties" you'll see axis error java.lang.runtimeexception that property java.home is set to the JRE path, not the JDK path in your machine. (even though %JAVA_HOME% points to JDK installation). In my machine it looked as follows.java.vm.version=1.6.0_03-b05java.home=C:\Java\jre1.6.0_03I'm not sure why the JAVA_HOME is not identified correctly, but this solved the issue for me. Posted by java Email This BlogThis! Share to Twitter Share to Facebook Tags: Axis, Java, Tech, Web services Newer Post Older Post Home Tags Eclipse Java Spring (Java Server Faces) JSF Hibernate Cout PHP GWT ( Google Web Toolkit ) Tech Cin class Example Programs Netbeans Tomcat Methods loop Android News for loop OOP basic Functions HTML Java Persistence API (JPA) Miscellaneous Tricks Useful Scripts C++ Array else if if if else operator overloading Google Introduction Primefaces Algorithms Red5 Servlet Web Service string GlassFish JAVA EE 6 Web run basic Interview Questions Maven operators JAVA 7 Struts Software inheritance pointers web development Arrays JSP vector web programming EJB Javascript Design Patterns Intoduction to J2EE Memory Allocation STL basic programming numbers CDI (Contexts and Dependency Injection) Problems Spring AOP ( Spring Aspect Oriented Programming concepts ) c++ example c++ programming postgresql variables Strings programming Challenging Problems