vaadin beginner- getting SEVERE: Allocate exception for servlet error - java

I created a test vaadin project- and when I try to run it on local Tomcat 7 server, this is the error I am getting---
SEVERE: Allocate exception for servlet Spin the Bottle
javax.servlet.ServletException: Failed to load application class: com.anyaservices.spinthebottle.App_Main
at com.vaadin.terminal.gwt.server.ApplicationServlet.init(ApplicationServlet.java:71)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:857)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
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.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
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)
What have i done wrong here? I just created a Vaadin project using the new project wizard...I did not even add/edit any code to it.

Check that "com.anyaservices.spinthebottle.App_Main" path points to a valid Java file contains public class which extends Vaadin Application class.

Related

Eclipse error UnsupportedEncodingException

I'm connecting Eclipse and MySQL by using tomcat. But I got some error while running the project on Eclipse.
Running http://localhost:8080/webserver/ is OK. But it's not OK on http://localhost:8080/webserver/ListServlet. I've already try method to set utf-8, but it's not working.
Apr 29, 2016 10:42:22 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [ListServlet] in context with path [/webserver] threw exception
java.io.UnsupportedEncodingException: The character encoding [] is not supported
at org.apache.tomcat.util.buf.B2CConverter.getCharsetLower(B2CConverter.java:91)
at org.apache.tomcat.util.buf.B2CConverter.getCharset(B2CConverter.java:78)
at org.apache.tomcat.util.buf.C2BConverter.<init>(C2BConverter.java:41)
at org.apache.catalina.connector.OutputBuffer.setConverter(OutputBuffer.java:610)
at org.apache.catalina.connector.OutputBuffer.checkConverter(OutputBuffer.java:572)
at org.apache.catalina.connector.Response.getWriter(Response.java:660)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:214)
at com.web.server.ListServlet.doGet(ListServlet.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
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:222)
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:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
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)
Apr 29, 2016 10:42:22 AM org.apache.coyote.http11.AbstractHttp11Processor process
SEVERE: Error processing request
java.lang.NullPointerException
at org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBuffer.java:474)
at org.apache.tomcat.util.buf.CharChunk.flushBuffer(CharChunk.java:464)
at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:291)
at org.apache.catalina.connector.Response.finishResponse(Response.java:513)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:435)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
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)

How can I load a java api of a C++ library in tomcat 7 (linux)?

I am trying to load to Tomcat 7 in linux a java api of a C++ library (freeling). After reading several manuals about how to load a jni library (using LD_LIBRARY_PATH, Wl, rpath in the compilation, ldconfig...) I can't load the library.
I have to say that firstly I wrote a java standalone application and the library is loaded correctly. The problem appears when I transform the standalone application in a axis2 web service. I have followed the pojo axis2 approach to build the service, and them I have embebed axis2 in tomcat. The error appears when I try to run the service. Also, I have to say that the system.loadlibrary works, and the error is returned when the first method of the library is called.
The error that I get when I call the web application is the following:
[ERROR] edu.upc.freeling.freelingJNI.Util_initLocale(Ljava/lang/String;)V
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:117)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
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:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.UnsatisfiedLinkError: edu.upc.freeling.freelingJNI.Util_initLocale(Ljava/lang/String;)V
at edu.upc.freeling.freelingJNI.Util_initLocale(Native Method)
at edu.upc.freeling.Util.initLocale(Util.java:39)
at es.ujaen.metaphor.FreelingNLP.<init>(Unknown Source)
at es.ujaen.metaphor.FigurativeLanguageWS.identifyFigurativeLanguageLemma(Unknown Source)
at es.ujaen.metaphor.TestMetaphor.main(Unknown Source)
... 29 more
Thanks

java.lang.AbstractMethodError

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....

Tomcat in combination with Intellij IDEA: no compiler available

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...

Generate HTML Pages with JasperReports on Tomcat

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.

Categories

Resources