I'm just testing Intellij IDEA in combination with an Tomcat 7 serveron Arch Linux.
I got the standard Tomcat Page when starting Tomcat by
sudo /etc/rc.d/tomcat start
I just used tutorial at http://wiki.jetbrains.net/intellij/Creating_a_simple_Web_application_and_deploying_it_to_Tomcat to configure Intellij.
Just a blank project but running Tomcat and opening localhost:8080 in Webbrowser causes following exception:
Feb 22, 2012 11:38:57 AM org.apache.catalina.core.StandardWrapperValve invoke
Schwerwiegend: Servlet.service() for servlet [jsp] in context with path [] threw exception [java.lang.IllegalStateException: No Java compiler available] with root cause
java.lang.IllegalStateException: No Java compiler available
at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:228)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:638)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1763)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I'm have no idea why the java compiler is missing. Java Home is set in Tomcat conf correct to
/opt/java
Can anybody help me?
The error is misleading, it can't find Jasper JSP compiler, not Java compiler.
It is org.apache.jasper.compiler.JDTCompiler, and it can't be loaded from the classpath, meaning that most probably JAR file with it (jasper.jar) did not get there for some reason.
Did you download/unpacked Tomcat from apache, or did you install it from your Linux distribution repo? Distribution packages mangle package structure sometimes...
Related
i'am using a library have structure below
i am adding vn.hus.nlp.tokenizer-4.1.1.jar file into libraries by Add JAR/Folder and copy the rest into my project. it work when i using java application. but when i try servlet, i got problem when using this library.
My project
Servlet: class Filter extends HttpServlet
try {
VietTokenizer v = new VietTokenizer(); // error here !
JSONObject jso=new JSONObject();
jso.put("status","A");
jso.put("label","true");
out.print(jso);
} finally {
out.close();
}
log
SEVERE: Servlet.service() for servlet [Filter] in context with path [/BadwordFilter] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
at badword.filter.Filter.processRequest(Filter.java:51)
at badword.filter.Filter.doGet(Filter.java:74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
json-simple-1.1.1.jar is work well.
thank you!
You are missing the commons-cli library. You can find it for example here, included in the archive in the lib folder:
https://code.google.com/p/vntagger-gate-plugin/source/browse/lib/vn.hus.nlp.tokenizer-4.1.1.jar
You can add it the same way you added the first library.
I think, library don't import in libs when you deploy
Right click on your web project, select Libraries. In Complie Tab, make sure your library was checked!
Getting error in web service program in my pc but the same code is working fine in other pc. Any solution to this ?
SEVERE: Servlet.service() for servlet [ServletAdaptor] in context with path [/REST] threw exception [Servlet execution threw an exception] with root cause
java.lang.AbstractMethodError
at com.sun.jersey.core.spi.factory.MessageBodyFactory._getMessageBodyWriter(MessageBodyFactory.java:395)
at com.sun.jersey.core.spi.factory.MessageBodyFactory._getMessageBodyWriter(MessageBodyFactory.java:382)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.getMessageBodyWriter(MessageBodyFactory.java:363)
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:266)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1448)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I am not sure how much did you really searched for this.
Java document state specific reason behind this error.
http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/AbstractMethodError.html
I think your jar are mismatching... Jar that you are compiling at local and jar used while running the application at some other location in different. This is basic issue for most of such issue. You can verify version of your jars...
I looked few more options, but people talk about different versions of jars... Please have a better look on your jars.. It might help....
When I try to run a web app com tomcat I get this error:
FAIL - Encountered exception javax.management.RuntimeOperationsException: Exception invoking method check
I have put the war file in the webapps folder, then when I click in the "Start" button I get the error "FAIL - Application at context path /Black.ArtespPAP could not be started".
So I tried to deploy the app manually in the deploy from (setting the context, xml file and war path) and I get the javax exception above.
Could anyone help me?
catalina.out log:
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: /home/ubuntu/tomcat/conf/pap.properties (No such file or directory)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:78)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:638)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1255)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:714)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:219)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.FileNotFoundException: /home/ubuntu/tomcat/conf/pap.properties (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:97)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.springframework.core.io.UrlResource.getInputStream(UrlResource.java:124)
at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:181)
at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:161)
at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:69)
... 36 more
Sep 17, 2012 10:14:53 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Sep 17, 2012 10:14:53 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Black.ArtespPAP] startup failed due to previous errors
Thanks.
It is clear from the logs that the file /home/ubuntu/tomcat/conf/pap.properties is missing. It looks like a config file used by the Spring framework (based on the stack trace). Afaik it is not a standard file but an application-specific one, so you would have to dig into your application code or documentation to figure out what it is used for and what it should contain.
have you checked tomcat logs (tomcat/logs/catalina.out and/or your application logs)? Stack traces are there... How do you deploy it manually? Generally, for tomcat, to deploy app, it's enough to copy a .war file into tomcat/webapps folder.
I am not sure if the problem lies with the apache server or batik. I am trying to convert svg to image in java using Batik in a servlet. When i instantiate SVGConverter in a servlet
SVGConverter svgConverter = new SVGConverter()
Apache returns this error:
Jun 26, 2012 3:28:10 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [FCImg] in context with path [/jsp_batik] threw exception [Servlet execution threw an exception] with root cause
java.lang.NoClassDefFoundError: org/apache/batik/apps/rasterizer/SVGConverter
at FCImg.doPost(FCImg.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I have included the correct jar files in the project and there doesnt seem to be any errors when compiling the java file that instantiates the SVGConverter object.
Any suggestions are helpful, thanks!
edit: I just had to include the necessary jar files (all the batik jar files) in the WEB-INF/lib folder.
Likely batik-rasterizer.jar is missing in WEB-INF/lib.
I currently have a class, Reporter.java, which uses JasperReports to generate an HTML report. I have a simple Test.java that calls Reporter.report() and the HTML file is properly generated at a specified file location (I currently have it set as a C:/ path that points into my Tomcat project). Now, I run a Tomcat server with an HTML page that calls generateStatus.jsp which calls Reporter.report() and an exception is thrown.
Jun 30, 2011 3:02:08 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/OATS] threw exception [javax.servlet.ServletException: java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JasperCompileManager] with root cause
java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JasperCompileManager
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at com.home.oats.Reporter.report(Reporter.java:22)
at org.apache.jsp.generateStatus_jsp._jspService(generateStatus_jsp.java:58)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The line it errors at is
JasperReport jasperReport = JasperCompileManager.compileReport(jasper.getString(Constants.JRXML));
Any suggestions?
Thanks for your time!
Looks like you are missing the Jasper Jar file in the WEB-INF/lib dir of your web-app.
This was a good example to follow:
http://codebackup.wordpress.com/2008/02/29/howto-jasperreports-framework-deployment-to-tomcat/
But I am still looking into generating a "dump" of reports in a directory rather than displaying a report on a single HTML page.